feat: extend ai config with codex and gemini fallbacks

This commit is contained in:
rob 2025-11-01 14:59:45 -03:00
parent 4680f4b629
commit ca73528068
3 changed files with 33 additions and 0 deletions

View File

@ -166,6 +166,11 @@ cat config/ai.yml
# Try environment variable override
CDEV_AI_COMMAND="claude -p '{prompt}'" git commit -m "test"
# Other provider notes
# codex-cli --stdin --model gpt-4.1-mini (requires OPENAI_API_KEY)
# gemini-cli --model=gemini-1.5-pro --stdin (requires GEMINI_API_KEY or GOOGLE_API_KEY)
# customize claude with --model or --agent to select a saved persona
```
### Votes Not Updating

View File

@ -16,7 +16,12 @@ version: 1
runner:
command_chain:
# Anthropic Claude CLI (reads prompt from stdin when -p is present)
- "claude -p"
# OpenAI / Codex-compatible wrapper (expects prompt on stdin)
- "codex-cli --stdin --model gpt-4.1-mini"
# Google Gemini CLI (prompt via stdin, raw text response)
- "gemini-cli --model=gemini-1.5-pro --stdin"
sentinel: "CASCADINGDEV_NO_CHANGES"
ramble:
@ -28,3 +33,16 @@ ramble:
kind: claude_cli
command: "claude"
args: []
codex:
kind: codex_cli
command: "codex-cli"
args:
- "--stdin"
- "--model"
- "gpt-4.1-mini"
gemini:
kind: gemini_cli
command: "gemini-cli"
args:
- "--model=gemini-1.5-pro"
- "--stdin"

View File

@ -93,6 +93,16 @@ export CDEV_AI_PROVIDER="claude-cli"
export CDEV_AI_COMMAND="claude -p '{prompt}'"
```
Common non-interactive setups:
| Provider | Example command | Required auth | Tips |
| --- | --- | --- | --- |
| Claude CLI | `claude -p` (reads prompt from stdin) | `ANTHROPIC_API_KEY` or `claude login` | Add `--model claude-3-5-sonnet-20241022` or `--agent my-cascading-agent` to target a specific model or saved agent persona. |
| Codex / OpenAI | `codex-cli --stdin --model gpt-4.1-mini` | `OPENAI_API_KEY` (+ `OPENAI_ORG_ID` if needed) | The stock `openai` CLI works via `openai api chat.completions.create -m gpt-4o-mini --input -`; wrap it if you prefer shorter aliases. |
| Gemini | `gemini-cli --model=gemini-1.5-pro --stdin` | `GOOGLE_API_KEY`/`GEMINI_API_KEY` with Generative Language API enabled | Some CLIs default to streaming mode—add `--no-stream` or similar so stdout is plain text. |
Update `config/ai.yml` to match the actual binary names or wrapper scripts on your machine.
**Option 2: Direct API (Alternative)**
```bash
pip install anthropic