.clinerules/cli.md
The CLI lives in cli/ and uses React Ink for terminal UI.
cli/src/constants/colors.ts for re-used terminal colors, e.g. COLORS.primaryBlue highlight color (selections, spinners, success states).dimColor with gray (e.g. <Text color="gray" dimColor>) - it's too hard to read. Use color="gray" for secondary text and normal foreground (no color) for primary text.When adding a new API provider to the extension, you must also update the CLI:
Update cli/src/components/ModelPicker.tsx: Add the provider to the providerModels map so getDefaultModelId() returns the correct default model. Import the models and default ID from @shared/api:
import { newProviderDefaultModelId, newProviderModels } from "@/shared/api"
export const providerModels = {
// ...existing providers
"new-provider": { models: newProviderModels, defaultId: newProviderDefaultModelId },
}
Use applyProviderConfig() for auth flows: When implementing OAuth or other auth flows for the provider, use the shared utility at cli/src/utils/provider-config.ts:
import { applyProviderConfig } from "../utils/provider-config"
// After successful auth:
await applyProviderConfig({ providerId: "new-provider", controller })
This handles setting provider, default model, API key mapping, state persistence, and rebuilding the API handler.
Provider-specific auth: If the provider uses OAuth (like openai-codex), add handling in SettingsPanelContent.tsx's handleProviderSelect callback. See the existing Codex OAuth flow as a reference.