Magpie CLI

magpie

Magpie — an app and local gateway that connect any model to Claude Code, Codex, Gemini CLI and OpenCode and switch them from the menu bar

  • 19,906 ★ on the repository
  • Last commit
  • MIT
CLI

Broad access

Why this level

  • Reads the Claude Code and Codex sign-in files and the keychain to offer subscriptions to other agents, and stores provider keys in `providers.json`
  • All agent traffic goes through a local gateway, and JavaScript plugins and middleware see and can rewrite prompts and replies
  • Edits installed agents' configs, and the Claude subscription bridge launches the local `claude` with the `--dangerously-skip-permissions` flag
All reasons and checks

yetone/magpie

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add cli/magpie

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Reads the Claude Code and Codex sign-in files and the keychain to offer subscriptions to other agents, and stores provider keys in `providers.json`
  • All agent traffic goes through a local gateway, and JavaScript plugins and middleware see and can rewrite prompts and replies
  • Edits installed agents' configs, and the Claude subscription bridge launches the local `claude` with the `--dangerously-skip-permissions` flag

This is third-party code. Review the repository files before installing.

What it does

Magpie keeps provider keys and subscription sign-ins in one place and assigns a model to each installed agent. The app, written in Go, runs as a menu bar icon, a window, the `magpie tui` terminal interface, the `magpie web` web interface or a set of commands: `magpie claude deepseek/deepseek-v4-pro` puts Claude Code on DeepSeek and `magpie codex moonshot/kimi-k2.5` moves Codex to Kimi. Magpie edits the needed value in the agent's own config and leaves comments and line order alone. Profiles save the setup of every agent under one name, and Gemini CLI, OpenCode, Goose, Cline, Cursor CLI and several dozen other agents connect the same way. All requests go through a local gateway at `127.0.0.1:3425`. It understands OpenAI Chat, OpenAI Responses, Anthropic Messages and Gemini formats and translates between them, streaming, tool calls and reasoning included. An agent that accepts a base URL connects to the gateway through `OPENAI_BASE_URL` or `ANTHROPIC_BASE_URL`. A routing group joins several models and accounts under one name such as `group/daily-coding`, and the `smart`, `order`, `rotate`, `usage` and `pace` modes decide who answers next. When one account's quota runs out, the gateway moves to the next without an error. Magpie also reads the sign-ins agents are already authorized with and offers Claude, ChatGPT, Copilot, Gemini and Grok subscriptions as providers to the other agents. It shows token use, list-price cost, remaining quota (`magpie quota`) and agent sessions. Bun-based plugins add providers from OpenCode and Pi packages as well as request middleware. A library writes instructions, MCP servers, skills and subagents into each agent's files and later removes only what the program wrote.

Who it is for. For developers who use more than one agent, provider or account and are tired of editing each agent's config by hand and losing the session when a quota runs out.

Good fit when

  • You want Claude Code on DeepSeek or Kimi and Codex on another model, and to swap them without opening configs
  • You have several subscription accounts and work should carry on with the next one when a quota runs out
  • Models need to be split as you work: tests go to a strong model and quick questions to a cheap one (intent routing)
  • You need one view of spend and balances across keys, subscriptions and agents, which `magpie quota` shows
  • One key and one set of groups should serve a laptop, a server and a NAS: sharing on the local network and a Docker image cover that

Not a fit when

  • You use one agent on its vendor's own plan and that is enough: the author says Magpie is not for such a user
  • You only need to switch provider profiles with MCP and skills management in a simple app: the catalog has CC Switch for that
  • You need a narrow gateway for Claude Code only, with routing by conditions and a log: Claude Code Router does that
  • Company policy forbids programs from reading other agents' sign-in files and the keychain

Example request

Install magpie, add the DeepSeek provider with my key and switch Claude Code to deepseek-v4-pro, leaving Codex as it is

Limitations

  • MIT license. The repository does not take pull requests: only maintainers change code, and the authors ask for wishes to be left on Discord.
  • macOS builds are signed and notarized, Windows and Linux builds are not signed yet, and Windows SmartScreen may ask for confirmation on first run. The app updates itself: it downloads a new version in the background and installs it on restart.
  • Once a day a released build sends an anonymous signal: a random id, the version, the system and the names of agents, providers and models by internal ids. For partners shown first in the add-provider sheet it counts shows, opens and adds, and clicks on their links pass through `usemagpie.ai/go`. Part of the sending can be switched off in privacy settings, and `DO_NOT_TRACK=1` turns it all off.
  • Provider keys sit in `providers.json` in the `~/.config/magpie` folder with 0600 permissions, and subscription sign-ins in `logins.json`. A backup to a GitHub repository is encrypted.
  • Availability from Russia depends on the chosen provider: Claude, ChatGPT and Copilot subscriptions work only if their servers are reachable. The installer and updater accept `--proxy` and `--mirror` for networks without access to GitHub.

How to disable. Before the first switch, save your current setup with `magpie save before` and bring it back later with `magpie use before`. The values the program replaced in agent configs sit in `stash.json` and are restored on switch-back. `magpie daemon uninstall` removes the background service. To delete the data, remove the `~/.config/magpie` folder and the `~/.cache/magpie` cache.

FAQ

How do I run Claude Code on another model through Magpie?

Add a provider: `magpie provider add deepseek sk-…`, where a ready preset needs only the key. Then run `magpie claude deepseek/deepseek-v4-pro`. Magpie changes the needed value in Claude Code's config, and a new session starts on the chosen model. Running sessions stay on the old model because the agent reads its config at start.

What do the routing group modes do?

`smart` takes the subscription with quota left that renews soonest. `order` goes down the list until a model stops answering. `rotate` moves to the next member each turn. `usage` takes the least-used one, and `pace` picks the account with the most of its week left per hour before reset. A conversation stays on the account that first answered while the vendor's prompt cache is worth keeping.

How does Magpie find the subscriptions I am signed in to?

It reads agents' sign-ins: Claude Code and Codex files and the macOS keychain. To forbid that, turn off the subscriptions item in privacy settings or run `magpie accounts discovery off`. For a single run the `MAGPIE_NO_ACCOUNTS=1` variable is enough. API-key providers work either way.

Can I run Magpie on a server or in Docker?

Yes. `magpie daemon install` sets up `magpie serve` as a systemd or launchd service, and the `ghcr.io/yetone/magpie` image runs it on a server or NAS managed from the web interface. A laptop can use the providers and groups of another Magpie and still set up its own agents.

How do I give other computers on the network access to the gateway?

Turn on sharing on the local network and give each client its own named gateway key with a daily, weekly or monthly limit on tokens and cost. Keys for callers live in the `caller-keys.json` file. For HTTPS, pass a certificate and key with `--tls-cert` and `--tls-key`.

What is middleware in the gateway?

These are JavaScript extensions that see what an agent sends and gets back. `onRequest` can rewrite a request or turn it away, `onEvent` sees each stream event and `onResponse` the whole reply. If a hook throws or runs too long, the request stays as it was. The ready-made packages are `param-override`, `model-map`, `system-prompt`, `word-guard` and `think-tags`.

Discussion

No questions or reviews yet.

CLI tools

A skill for messaging between Claude Code, Codex, Gemini CLI and other CLI agents through a shared local SQLite database, written in bash

SkillBroad access1.6KRepository stars
Official

An ai-forever proxy that serves GigaChat through OpenAI, Anthropic and Gemini APIs so Claude Code, Codex and Gemini CLI can run on it

CLIBroad access138Repository stars
Needs a VPN

An MCP server that lets Claude Code, Codex and other agents call Gemini, GPT, Grok and local models for review, debugging and consensus

MCP serverExtended access11.8KRepository stars

Self-hosted system for a team of AI agents: org chart, tasks, budgets and oversight of Claude Code, Codex and OpenClaw

CLIBroad access106.7KRepository stars

A Go CLI that configures the AI coding agents you already use: it gives them shared memory, a workflow and deterministic steps without replacing the agents them

CLIExtended access8KRepository stars

botmux connects Lark and Feishu to Claude Code, Codex, Gemini CLI and OpenCode: each message starts its own agent session with live cards

CLIBroad access1.7KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialRepository starsMain difference
Magpie (this entry)no19,906
CC Switchno147,989a desktop app for switching provider profiles with a shared panel for MCP, prompts and skills
Claude Code Routerno37,825a local gateway for agents with routing by conditions, retry on error and a request log
cc-fleetno185connects third-party models only to Claude Code orchestration, launching real claude processes

README in short

The repository's front page opens with the question of whether you need Magpie and three setup steps: install, add a provider, pick a model. It continues with a list of more than sixty supported agents, a gateway diagram and sections on providers, subscriptions, routing groups, plugins, cost, sharing and the library. Separate pages describe each subsystem: agent wiring, the Claude subscription bridge, providers, sync and backups. A reference of about a hundred and eighty kilobytes lists every command, setting and file. There is also a code standards guide and an architecture description for people who build the project themselves.

README badge

Report a problem

Foxx AIMagpie
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.