Bash wrappers for the claude and copilot CLIs that add an OpenRouter-backed mode, so you can run either agent against any tool-capable model on OpenRouter instead of the provider's default backend.
claude— wraps the Claude Code CLI.copilot— wraps the GitHub Copilot CLI, and always launches it with a fixed tool-permission policy (see below).
Put both scripts on your $PATH ahead of the real claude/copilot binaries, and make them executable:
chmod +x claude copilotEach wrapper resolves the real binary itself (skipping its own path), so the actual claude/copilot install just needs to also be on $PATH somewhere.
Normal usage passes straight through to the real CLI:
claude "some prompt" # behaves exactly like the real claude
copilot "some prompt" # behaves like the real copilotPrefix your args with or to run the session through OpenRouter instead:
export OPENROUTER_API_KEY=sk-...
claude or --model gpt-4.1
copilot or --model gpt-4.1--modelmatches on the model ID's suffix after the last/(e.g.gpt-4.1matchesopenai/gpt-4.1).- If the filter matches exactly one model, it's used directly.
- If it matches multiple models, or no
--modelis given, anfzfpicker opens over the full list of tool-capable OpenRouter models (context_length+ model ID). - If the filter matches nothing, the picker opens with the filter pre-filled as the initial query.
Pass --profile <name> (or --profile=<name>) to use a separate config directory for that CLI, isolating configs, plugins, and auth from your default user config:
claude --profile work "some prompt" # uses ~/.claude-work as CLAUDE_CONFIG_DIR
copilot --profile=work "some prompt" # uses ~/.copilot-work as COPILOT_HOME--profileis optional; if omitted, the CLI's default config directory is used unchanged.- It can appear anywhere in the argument list, including mixed in with other flags or before/after
or. - It's stripped before the remaining args are passed to the real CLI — the underlying binary never sees
--profile. - Combine with OpenRouter mode freely:
claude --profile work or --model gpt-4.1.
bashcurlandjq(used to fetch and parse the OpenRouter model list)fzf(only needed when a model isn't uniquely resolved from--model)
- No build system or test suite — these are standalone scripts. Test changes manually by running
./claude or --model <id>/./copilot or --model <id>, and by invoking withoutorto confirm plain pass-through still works. - See
CLAUDE.mdfor implementation details aimed at AI coding agents working in this repo.