Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cli-agent-wrappers

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.

What's included

  • claude — wraps the Claude Code CLI.
  • copilot — wraps the GitHub Copilot CLI, and always launches it with a fixed tool-permission policy (see below).

Installation

Put both scripts on your $PATH ahead of the real claude/copilot binaries, and make them executable:

chmod +x claude copilot

Each wrapper resolves the real binary itself (skipping its own path), so the actual claude/copilot install just needs to also be on $PATH somewhere.

Usage

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 copilot

OpenRouter mode

Prefix 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
  • --model matches on the model ID's suffix after the last / (e.g. gpt-4.1 matches openai/gpt-4.1).
  • If the filter matches exactly one model, it's used directly.
  • If it matches multiple models, or no --model is given, an fzf picker 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.

Profiles

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
  • --profile is 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.

Requirements

  • bash
  • curl and jq (used to fetch and parse the OpenRouter model list)
  • fzf (only needed when a model isn't uniquely resolved from --model)

Notes

  • 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 without or to confirm plain pass-through still works.
  • See CLAUDE.md for implementation details aimed at AI coding agents working in this repo.

About

CLI Agents wrap scripts to auto inject BYOK and profiles

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages