Claude CLI Command Wrappers & Options
| Command/Option | Usage | Location | Description |
|---|---|---|---|
| claude | Base command | commands.ts:68 | Main CLI binary |
| Non-interactive mode | commands.ts:50 | Execute without interactive prompts | |
| --output-format stream-json | JSON streaming | commands.ts:51-52 | Get structured JSON output for parsing |
| --verbose | Verbose logging | commands.ts:53 | Enable detailed logging |
| --dangerously-skip-permissions | Bypass permissions | commands.ts:54 | Skip permission checks |
| --permission-mode bypassPermissions | Permission mode | commands.ts:55-56 | Set permission handling mode |
| --model <model> | Model selection | commands.ts:62 | Specify Claude model (sonnet/opus/haiku) |
| claude setup-token | Authentication | auth.ts:131 | Interactive token setup |
| claude --version | Version check | auth.ts:14 | Check if CLI is installed |
Authentication Flow
Execution Environment Variables
| Variable | Purpose | Default |
|---|---|---|
| CLAUDE_CONFIG_DIR | Auth config location | ~/.codemachine/claude |
| CODEMACHINE_SKIP_CLAUDE | Skip execution (dry-run) | false |
| CODEMACHINE_SKIP_AUTH | Skip auth for testing | false |
| CODEMACHINE_PLAIN_LOGS | Strip ANSI codes | false |
| LOG_LEVEL=debug | Enable debug logs | info |
Required Elements to Add New Engine
src/infra/engines/providers/<engine-name>/ ├── index.ts # Main module export ├── metadata.ts # Engine metadata ├── auth.ts # Authentication logic ├── config.ts # Configuration & model mapping └── execution/ ├── index.ts # Execution exports ├── commands.ts # CLI command builder ├── runner.ts # Main runner logic └── executor.ts # High-level execution wrappers
metadata.ts - Engine Metadata (Required)
export const metadata: EngineMetadata = { id: string, // Unique ID (e.g., 'claude') name: string, // Display name (e.g., 'Claude') description: string, // UI description cliCommand: string, // CLI namespace cliBinary: string, // Binary name to execute installCommand: string, // Installation command defaultModel?: string, // Default model name order?: number, // Display order experimental?: boolean, // Experimental flag };
auth.ts - Authentication Module (Required)
Must implement EngineAuthModule: