This project is a Bright Code-style CLI clone built with React + Ink + TypeScript, with a complete terminal UI (TUI).
# 1) Install dependencies
npm install
# 2) Create YAML config
cp config.example.yaml config.yaml
# Then edit config.yaml and set provider.apiKey / provider.baseUrl / provider.model
# 3) Start in development mode (no build required)
npm run dev
# Or build first, then run
npm run build && npm startThis project now targets OpenAI-compatible APIs only.
Minimal config:
provider:
apiKey: "sk-xxx"
baseUrl: "https://api.moonshot.cn/v1"
model: "moonshot-v1-8k"Extended config (for better compatibility across providers):
provider:
apiKey: "sk-xxx"
baseUrl: "https://your-provider.example/v1"
model: "your-model"
endpoint: "/chat/completions"
maxTokens: "4096"
maxTokensParam: "max_tokens"
apiKeyHeader: "Authorization"
apiKeyPrefix: "Bearer "
apiKeyQueryParam: ""
extraHeaders: "HTTP-Referer=https://your.site,X-Title=Bright Code"
extraBody: "temperature=0.7,top_p=0.95"
skills:
enabled: "true"
directory: "./skills"
# include: "general-coding,code-review.md"Field notes:
provider.endpoint: can be/chat/completions,chat/completions, or a full URL.provider.maxTokensParam: usemax_tokensormax_completion_tokensdepending on provider.provider.apiKeyQueryParam: if set (e.g.key), API key goes in query string instead of auth header.provider.extraHeaders/provider.extraBody: comma-separatedkey=valuepairs.
skills.enabled: enable skills ("true"/"false")skills.directory: skill file directory (supports.md,.txt,.skill)skills.include(optional): comma-separated allowlist; if empty, all skill files in the directory are loaded
All loaded skill files are appended to the system prompt. Recommended practice: keep one capability per skill file, for example:
skills/general-coding.mdskills/code-review.mdskills/frontend-ui.md
.
├── main.tsx # Entry point: render(<REPLScreen />)
├── REPL.tsx # Main screen component
├── engine.ts # Agentic query loop (LLM + tools)
├── index.ts # Tool definitions and execution
├── config.ts # YAML config loader
├── skills.ts # Skill loader and prompt builder
├── types.ts # Message and block types
├── useAppState.ts # App state hook
├── Header.tsx # Top header
├── Messages.tsx # Message list rendering
├── PromptInput.tsx # Prompt input with cursor controls
├── Spinner.tsx # Loading animation
├── StatusBar.tsx # Bottom status bar
├── HelpOverlay.tsx # /help overlay panel
├── skills/ # Skill files
└── dist/ # Build output
| Tool | Purpose |
|---|---|
bash |
Execute shell commands |
read_file |
Read full file contents |
write_file |
Create or overwrite files |
list_files |
List directory contents |
| Key | Action |
|---|---|
Enter |
Send message |
← → |
Move cursor |
Ctrl+A / Ctrl+E |
Jump to start / end of line |
Ctrl+K |
Delete to end of line |
Ctrl+U |
Delete to beginning of line |
Ctrl+C |
Cancel current request / exit |
| Command | Action |
|---|---|
/help |
Show / hide help panel |
/clear |
Clear conversation history |
/exit |
Exit the CLI |