CLI Package
@cdoing/cli — The terminal interface with interactive chat, configuration wizard, and multiple output formats.
Overview
The CLI package provides the cdoing command-line tool. It's built with Commander for argument parsing and Ink (React for terminals) for the interactive UI.
CLI Flags
| Flag | Description |
|---|---|
| -m, --model <model> | Model identifier (e.g., claude-sonnet-4-6, gpt-4o) |
| -p, --provider <name> | LLM provider (anthropic, openai, google, ollama, custom) |
| --base-url <url> | Custom base URL for API requests |
| --api-key <key> | API key (overrides stored config) |
| --mode <mode> | Permission mode |
| -d, --dir <directory> | Working directory |
| --login | Start Anthropic OAuth login flow |
| --logout | Clear stored OAuth tokens |
| Non-interactive mode (single prompt, exit after response) | |
| -r, --resume <id> | Resume a previous conversation by ID |
| -c, --continue | Continue the most recent conversation |
| --max-turns <n> | Limit number of agent turns |
| --output-format <fmt> | Output format: text, json, stream-json |
| --verbose | Enable verbose logging |
| --system-prompt <prompt> | Custom system prompt |
| --allowed-tools <tools> | Comma-separated list of allowed tools |
| --disallowed-tools <tools> | Comma-separated list of disallowed tools |
Subcommands
cdoing config
Manage configuration settings from the terminal:
cdoing init
Initialize a project with a .cdoing/config.md file containing project-specific instructions for the agent.
cdoing doctor
Diagnose setup issues. Checks Node.js version, API key configuration, provider connectivity, and tool availability.
cdoing completions
Generate shell completion scripts for bash, zsh, or fish.
Output Formats
| Format | Use Case | Description |
|---|---|---|
| text | Interactive use | Formatted text with colors and markdown rendering |
| json | Programmatic use | Single JSON object with the full response |
| stream-json | Real-time integration | Newline-delimited JSON objects streamed as they arrive |
Setup Wizard
On first run, the CLI launches an interactive setup wizard that guides you through:
- Selecting an LLM provider
- Entering your API key
- Choosing a default model
- Setting the permission mode
- Configuring optional features (indexing, embeddings)
Configuration is persisted to ~/.cdoing/config.json and can be modified later with cdoing config set.