btca-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

btca CLI

btca CLI

Setup From Scratch

从零开始搭建

  1. Ensure Bun is installed (see https://bun.sh if needed).
  2. Install the btca CLI globally:
bash
bun add -g btca
  1. Initialize the project from the repo root:
bash
btca init
Choose CLI for local resources.
  1. Connect a provider and model:
bash
btca connect
Follow the prompts.
  1. Add resources:
bash
undefined
  1. 确保已安装Bun(如需安装请查看https://bun.sh)。
  2. 全局安装btca CLI:
bash
bun add -g btca
  1. 从仓库根目录初始化项目:
bash
btca init
选择CLI以使用本地资源。
  1. 连接服务提供商和模型:
bash
btca connect
按照提示操作。
  1. 添加资源:
bash
undefined

Git resource

Git资源

Local directory

本地目录

btca add -n my-docs -t local /absolute/path/to/docs

6. Verify resources:

```bash
btca resources
  1. Ask a question:
bash
btca ask -r svelte-dev -q "How do I define remote functions?"
  1. Optional TUI:
bash
btca
btca add -n my-docs -t local /absolute/path/to/docs

6. 验证资源:

```bash
btca resources
  1. 发起查询:
bash
btca ask -r svelte-dev -q "How do I define remote functions?"
  1. 可选的TUI:
bash
btca

Common Tasks

常见任务

  • Ask with multiple resources:
bash
btca ask -r react -r typescript -q "How do I type useState?"
  • You can see which resources are configured with
    btca resources
    .
  • 基于多资源发起查询:
bash
btca ask -r react -r typescript -q "How do I type useState?"
  • 可通过
    btca resources
    查看已配置的资源。

Config Overview

配置概述

  • Config lives in
    btca.config.jsonc
    (project) and
    ~/.config/btca/btca.config.jsonc
    (global).
  • Project config overrides global and controls provider/model and resources.
  • 配置文件位于项目目录下的
    btca.config.jsonc
    以及全局目录
    ~/.config/btca/btca.config.jsonc
  • 项目配置会覆盖全局配置,用于控制服务提供商/模型以及资源。

Troubleshooting

故障排除

  • "No resources configured": add resources with
    btca add ...
    and re-run
    btca resources
    .
  • "Provider not connected": run
    btca connect
    and follow the prompts.
  • "未配置资源":使用
    btca add ...
    添加资源后重新运行
    btca resources
  • "未连接服务提供商":运行
    btca connect
    并按照提示操作。