Skip to content

PengSpirit/agent-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agent-switch

One verb to migrate seamlessly between AI coding tools and models — no re-setup. switch claude drops you into Claude Code (Opus, subscription + connectors); switch flash runs aider on Gemini 3.5 Flash; switch opus runs aider on Opus for the money-path. It remembers your last pick, so a bare switch re-launches it.

switch claude    # Claude Code  — Opus, subscription + org connectors        → start
switch aider     # aider, cost-routed ladder                                 → agent
switch cursor    # Cursor editor (if installed)
switch flash     # aider · Gemini 3.5 Flash   (alias: gemini)                → fcode
switch pro       # aider · Gemini 3.1 Pro                                     → mcode
switch opus      # aider · Opus (API, money-path)                            → ocode
switch           # re-launch your last target

Install

npx @incultnitollc/agent-switch      # idempotent; safe to re-run
# then:
#   1) paste real keys into ~/.config/agent-keys.env
#   2) source ~/.zshrc

The installer: copies the shell lib to ~/.config/agent-switch.zsh, seeds ~/.config/agent-keys.env (chmod 600, placeholders — never clobbers real keys), source-guards it into your ~/.zshrc (skips if you already define these functions inline), and reports any missing prerequisites.

What you get

Command Launches Tool Model Billing
start Claude Code, cwd-anchored to your repos root, same memory/CLAUDE.md/MCP/plugins Claude Code Opus subscription + connectors
agent [-f|-a|-o] <repo> [task] aider via a cost-router (Flash routine, Opus on money/auth/schema) aider Gemini / Opus API
switch <target> the right tool+model for target, remembers it any of the above
fcode / mcode / ocode aider on Fast / Mid / Smart pin directly aider Gemini / Opus API

Configure

Models are pinned in one file, ~/.config/agent-keys.env — edit these, nothing else:

export FAST_MODEL="gemini/gemini-3.5-flash"       # switch flash
export MID_MODEL="gemini/gemini-3.1-pro-preview"  # switch pro
export SMART_MODEL="anthropic/claude-opus-4-8"    # switch opus

Point start / agent at a different repos root:

export AGENT_REPOS_ROOT="/path/to/your/repos"     # default: ~/incultnito/Dev/Backend/repos

Prerequisites

  • aider (uv tool install aider-chat) — for agent, fcode/mcode/ocode, switch flash/pro/opus.
  • Claude Code (npm i -g @anthropic-ai/claude-code) — for start, switch claude.
  • Cursor (optional) — for switch cursor.
  • A CONVENTIONS.md in each repo (aider --reads it). Seed one with newrepo-aider ..

Uninstall

Remove the # >>> agent-switch >>> block from ~/.zshrc and delete ~/.config/agent-switch.zsh. Your keys in agent-keys.env are left untouched.

Notes

  • switch claude uses a claude() wrapper that unsets ANTHROPIC_API_KEY in a subshell, so Claude Code uses your subscription login + org connectors instead of metered API. Remove the wrapper if you prefer metered API billing.
  • New terminal tab + switch claude again = a parallel agent with the same memory.

About

One verb to migrate seamlessly between AI coding tools (Claude Code, aider, Cursor) and models (Gemini, Opus). Canonical installer + start/agent/switch.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages