Documentation
¶
Overview ¶
magpie — one place to pick every agent's model. The commands live in internal/cli; this is only where the binary starts.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
access
Package access keeps the named API keys issued by the gateway.
|
Package access keeps the named API keys issued by the gateway. |
|
agent
Package agent describes every coding agent magpie can drive: where its config lives, which fields matter (model, effort, …) and which values to offer.
|
Package agent describes every coding agent magpie can drive: where its config lives, which fields matter (model, effort, …) and which values to offer. |
|
agentenv
Package agentenv names the environment variables through which an agent really installed on this machine reaches magpie: the one list a test sandbox clears, so that a test meets only the agents it put there itself.
|
Package agentenv names the environment variables through which an agent really installed on this machine reaches magpie: the one list a test sandbox clears, so that a test meets only the agents it put there itself. |
|
agentplug
Package agentplug runs the agents plugins add: a module, named by a plugin's package.json magpie.agent, that says where an agent magpie has no wiring of its own keeps its model, and what else to write there for it to use magpie's gateway.
|
Package agentplug runs the agents plugins add: a module, named by a plugin's package.json magpie.agent, that says where an agent magpie has no wiring of its own keeps its model, and what else to write there for it to use magpie's gateway. |
|
appdir
Package appdir decides where magpie keeps its own files: the one place every other package asks (#508).
|
Package appdir decides where magpie keeps its own files: the one place every other package asks (#508). |
|
autostart
Package autostart opens magpie when the user logs in, in the tray with no window, so the gateway every agent is pointed at is there from the start.
|
Package autostart opens magpie when the user logs in, in the tray with no window, so the gateway every agent is pointed at is there from the start. |
|
awake
Package awake keeps the computer from going to sleep by itself while agents work through magpie's gateway (xiao_wang24004 on X: the computer went to sleep in the middle of an agent's task).
|
Package awake keeps the computer from going to sleep by itself while agents work through magpie's gateway (xiao_wang24004 on X: the computer went to sleep in the middle of an agent's task). |
|
backup
Package backup packs what the user set up in magpie into one file, sealed with a passphrase, to carry to another machine: the providers (their keys too, unless left out), the pictures picked for them, the settings, the profiles, every agent's model and the library (the instructions, MCP servers and skills magpie gives the agents).
|
Package backup packs what the user set up in magpie into one file, sealed with a passphrase, to carry to another machine: the providers (their keys too, unless left out), the pictures picked for them, the settings, the profiles, every agent's model and the library (the instructions, MCP servers and skills magpie gives the agents). |
|
budget
Package budget holds each gateway key to its own limit (#585): what a key has used in its window is summed from usage.jsonl, the records the Usage page shows, so it survives a restart; a request is let in only while the key has something left after what its requests in flight are expected to use, and those are settled with what the call recorded.
|
Package budget holds each gateway key to its own limit (#585): what a key has used in its window is summed from usage.jsonl, the records the Usage page shows, so it survives a restart; a request is let in only while the key has something left after what its requests in flight are expected to use, and those are settled with what the call recorded. |
|
catalog
Package catalog knows which models exist.
|
Package catalog knows which models exist. |
|
claudebridge
Package claudebridge contains the small stdio MCP helper used by magpie's Claude Subscription bridge.
|
Package claudebridge contains the small stdio MCP helper used by magpie's Claude Subscription bridge. |
|
claudecode
Package claudecode finds the Claude Code magpie's Claude subscription runs, and downloads Anthropic's own build of it when the user asks, for a machine with none: a server or a container (Jorben on Discord).
|
Package claudecode finds the Claude Code magpie's Claude subscription runs, and downloads Anthropic's own build of it when the user asks, for a machine with none: a server or a container (Jorben on Discord). |
|
cli
Package cli is magpie's command line: every command, and the app, tray and TUI it opens (the root's main.go only calls Main).
|
Package cli is magpie's command line: every command, and the app, tray and TUI it opens (the root's main.go only calls Main). |
|
codexcat
Package codexcat renders models the way Codex describes them: the entries of its models.json, for `model_catalog_json` and for the model list magpie hands Codex in place of the ChatGPT backend's.
|
Package codexcat renders models the way Codex describes them: the entries of its models.json, for `model_catalog_json` and for the model list magpie hands Codex in place of the ChatGPT backend's. |
|
daemon
Package daemon runs `magpie serve` as a service of the user's own: a systemd user unit on Linux, a launch agent on the Mac.
|
Package daemon runs `magpie serve` as a service of the user's own: a systemd user unit on Linux, a launch agent on the Mac. |
|
davsync
Package davsync keeps magpie's setup the same on every computer through a WebDAV folder, an S3-compatible bucket or a GitHub repository.
|
Package davsync keeps magpie's setup the same on every computer through a WebDAV folder, an S3-compatible bucket or a GitHub repository. |
|
desktopdir
Package desktopdir finds Claude Desktop's folders: the one place the agent, the library and the session readers ask.
|
Package desktopdir finds Claude Desktop's folders: the one place the agent, the library and the session readers ask. |
|
edit
Package edit provides format-preserving editors for the config files that coding agents keep: JSON/JSONC, TOML and YAML.
|
Package edit provides format-preserving editors for the config files that coding agents keep: JSON/JSONC, TOML and YAML. |
|
filelock
Package filelock keeps a change to a file one at a time across the magpies on a computer: the gateway that runs all day, and each magpie run from a terminal or a script meanwhile.
|
Package filelock keeps a change to a file one at a time across the magpies on a computer: the gateway that runs all day, and each magpie run from a terminal or a script meanwhile. |
|
filememo
Package filememo keeps what was parsed from a file until the file changes, so a page that asks many times over reads it once.
|
Package filememo keeps what was parsed from a file until the file changes, so a page that asks many times over reads it once. |
|
fonts
Package fonts describes the installed faces a desktop page can choose.
|
Package fonts describes the installed faces a desktop page can choose. |
|
fx
Package fx keeps the dollar-to-yuan rate the CNY currency preference (see internal/settings) converts list-price costs with.
|
Package fx keeps the dollar-to-yuan rate the CNY currency preference (see internal/settings) converts list-price costs with. |
|
gateway
Package gateway is the local LLM endpoint agents talk to.
|
Package gateway is the local LLM endpoint agents talk to. |
|
ghtoken
Package ghtoken has magpie's requests to GitHub's REST API carry the user's GitHub token, and says plainly when GitHub turns them away.
|
Package ghtoken has magpie's requests to GitHub's REST API carry the user's GitHub token, and says plainly when GitHub turns them away. |
|
gui
Package gui hosts the desktop app: a tray panel and a regular window that share one small web UI.
|
Package gui hosts the desktop app: a tray panel and a regular window that share one small web UI. |
|
gui/genpurposes
command
genpurposes generates the browser's request-kind catalog from usage's catalog.
|
genpurposes generates the browser's request-kind catalog from usage's catalog. |
|
gui/windowshape
Package windowshape measures a Mac window for the GUI's tests: the radius of its corners, where its traffic lights are, whether it has a toolbar, where a sheet on it begins and whether a first press on it begins a window drag.
|
Package windowshape measures a Mac window for the GUI's tests: the radius of its corners, where its traffic lights are, whether it has a toolbar, where a sheet on it begins and whether a first press on it begins a window drag. |
|
iconproxy
Package iconproxy names where magpie downloads a remote picture from.
|
Package iconproxy names where magpie downloads a remote picture from. |
|
imagemcp
Package imagemcp is `magpie mcp image`: a stdio MCP server an agent is given, when it is picked for it in the Library, to make images with the model the Settings' Image generation names, and videos with the first video model the gateway has (gateway.AutoVideomaker).
|
Package imagemcp is `magpie mcp image`: a stdio MCP server an agent is given, when it is picked for it in the Library, to make images with the model the Settings' Image generation names, and videos with the first video model the gateway has (gateway.AutoVideomaker). |
|
jsmod
Package jsmod compiles a plugin's JavaScript module for moejs, the JavaScript engine written in Go that magpie runs plugin code in its own process with: gateway middleware (internal/middleware) and agents (internal/agentplug).
|
Package jsmod compiles a plugin's JavaScript module for moejs, the JavaScript engine written in Go that magpie runs plugin code in its own process with: gateway middleware (internal/middleware) and agents (internal/agentplug). |
|
lastgood
Package lastgood keeps the last good generation of magpie's own state files (accounts, sign-ins, providers, settings) and reads it back when the file itself can't be read.
|
Package lastgood keeps the last good generation of magpie's own state files (accounts, sign-ins, providers, settings) and reads it back when the file itself can't be read. |
|
libc
Package libc tells which C library this Linux runs on, for the downloads that come in a glibc build and a musl one: Claude Code's and Bun's.
|
Package libc tells which C library this Linux runs on, for the downloads that come in a glibc build and a musl one: Claude Code's and Bun's. |
|
library
Package library keeps what every agent should know, once: the instructions each reads before a conversation, the MCP servers it can call and the skills it can load.
|
Package library keeps what every agent should know, once: the instructions each reads before a conversation, the MCP servers it can call and the skills it can load. |
|
mcpauth
Package mcpauth signs magpie in to a remote MCP server that asks for an OAuth sign-in (Neon, Notion, Supabase…), once for every agent (#615).
|
Package mcpauth signs magpie in to a remote MCP server that asks for an OAuth sign-in (Neon, Notion, Supabase…), once for every agent (#615). |
|
mcpauth/mcpauthtest
Package mcpauthtest is a remote MCP server behind an OAuth sign-in, as Neon's or Notion's is, for the tests of magpie signing in to one (#615).
|
Package mcpauthtest is a remote MCP server behind an OAuth sign-in, as Neon's or Notion's is, for the tests of magpie signing in to one (#615). |
|
middleware
Package middleware runs the gateway middleware plugins declare: a module with onRequest, onEvent and onResponse hooks that the gateway calls on every request an agent sends it, every event of the reply's stream and every whole reply.
|
Package middleware runs the gateway middleware plugins declare: a module with onRequest, onEvent and onResponse hooks that the gateway calls on every request an agent sends it, every event of the reply's stream and every whole reply. |
|
netproxy
Package netproxy decides which proxy magpie's own requests to vendors go through.
|
Package netproxy decides which proxy magpie's own requests to vendors go through. |
|
omarchy
Package omarchy is what magpie knows of Omarchy (omarchy.org), the Hyprland desktop: whether it runs on one, and the look its current theme gives every surface, so magpie's windows can take that look there and nowhere else.
|
Package omarchy is what magpie knows of Omarchy (omarchy.org), the Hyprland desktop: whether it runs on one, and the look its current theme gives every surface, so magpie's windows can take that look there and nowhere else. |
|
plugin
Package plugin runs OpenCode's provider plugins for magpie.
|
Package plugin runs OpenCode's provider plugins for magpie. |
|
pluginrt
Package pluginrt runs magpie's built-in plugins: the parts of magpie not everyone needs (Lxxyx on X: "功能太多了"), each one a package under plugins/ that registers a Manifest.
|
Package pluginrt runs magpie's built-in plugins: the parts of magpie not everyone needs (Lxxyx on X: "功能太多了"), each one a package under plugins/ that registers a Manifest. |
|
proc
Package proc makes the commands magpie runs: agents' CLIs, the probes that ask them what they have, the system's own tools.
|
Package proc makes the commands magpie runs: agents' CLIs, the probes that ask them what they have, the system's own tools. |
|
profile
Package profile stores named snapshots of every agent's settings, and of who gets what from the library, so a whole setup can be switched in one move.
|
Package profile stores named snapshots of every agent's settings, and of who gets what from the library, so a whole setup can be switched in one move. |
|
provider
Package provider holds the model vendors magpie can reach: where each one lives, which protocols it speaks, the API key the user typed in, and which of its models should show up in the agents' pickers.
|
Package provider holds the model vendors magpie can reach: where each one lives, which protocols it speaks, the API key the user typed in, and which of its models should show up in the agents' pickers. |
|
qoder
Package qoder speaks Qoder's inference API (api3.qoder.sh agent_chat_generation SSE) the way the Qoder desktop client does, so a Qoder subscription can serve every agent through magpie's gateway.
|
Package qoder speaks Qoder's inference API (api3.qoder.sh agent_chat_generation SSE) the way the Qoder desktop client does, so a Qoder subscription can serve every agent through magpie's gateway. |
|
redact
Package redact keeps secrets on the machine.
|
Package redact keeps secrets on the machine. |
|
sessions
Package sessions lists the agents' recent sessions from their own session files — Claude Code's projects/*/<id>.jsonl (and Qoder's, the same kind), Codex's rollout files, OpenCode's database (or its older JSON files) and ZCode's, Pi's session files and omp's, DeepSeek Harness's, Cline's, Grok Build's, WorkBuddy's, Droid's, Cursor CLI's and Alma's chat stores — with the tokens each spent, what that cost at the effective price, and the command that resumes it.
|
Package sessions lists the agents' recent sessions from their own session files — Claude Code's projects/*/<id>.jsonl (and Qoder's, the same kind), Codex's rollout files, OpenCode's database (or its older JSON files) and ZCode's, Pi's session files and omp's, DeepSeek Harness's, Cline's, Grok Build's, WorkBuddy's, Droid's, Cursor CLI's and Alma's chat stores — with the tokens each spent, what that cost at the effective price, and the command that resumes it. |
|
settings
Package settings keeps the few preferences the desktop app has: which palette to paint with, which language to speak, how the agents are arranged.
|
Package settings keeps the few preferences the desktop app has: which palette to paint with, which language to speak, how the agents are arranged. |
|
shortcut
Package shortcut puts magpie in the Start menu on Windows.
|
Package shortcut puts magpie in the Start menu on Windows. |
|
source
Package source chooses where magpie reads from, with a mirror as a fallback when the official address can't be reached.
|
Package source chooses where magpie reads from, with a mirror as a fallback when the official address can't be reached. |
|
stats
Package stats counts magpie's users: once a day a running magpie tells PostHog it is in use, under an id made up on this computer, with its version and system, and, unless the user turned that part off, which agents, providers and models it is used with, by their built-in ids (Usage): a provider of the user's own is only "custom".
|
Package stats counts magpie's users: once a day a running magpie tells PostHog it is in use, under an id made up on this computer, with its version and system, and, unless the user turned that part off, which agents, providers and models it is used with, by their built-in ids (Usage): a provider of the user's own is only "custom". |
|
steady
Package steady reads and replaces files that another process may be replacing at that moment.
|
Package steady reads and replaces files that another process may be replacing at that moment. |
|
testenv
Package testenv gives a package's tests a home of their own, on every OS: HOME, USERPROFILE (Windows' home), the XDG folders and Windows' APPDATA and LOCALAPPDATA all point into one new temporary folder, the agents' own variables (agentenv.Vars) are cleared, and the keychain tools and agent CLIs on PATH are failing stand-ins, so that no test reads or writes the files of the user running it.
|
Package testenv gives a package's tests a home of their own, on every OS: HOME, USERPROFILE (Windows' home), the XDG folders and Windows' APPDATA and LOCALAPPDATA all point into one new temporary folder, the agents' own variables (agentenv.Vars) are cleared, and the keychain tools and agent CLIs on PATH are failing stand-ins, so that no test reads or writes the files of the user running it. |
|
tui
Package tui is magpie in the terminal: one row per agent, arrow keys to pick a field, enter to change it; and pages for providers and usage beside it (pages.go), routing groups (routing.go), sessions (sessions.go) and the library (library.go), 1–6 to go between them.
|
Package tui is magpie in the terminal: one row per agent, arrow keys to pick a field, enter to change it; and pages for providers and usage beside it (pages.go), routing groups (routing.go), sessions (sessions.go) and the library (library.go), 1–6 to go between them. |
|
tune
Package tune works out, from what one user's agents really did, the settings that would have cost that user the fewest tokens: when each agent compacts its conversation, and how long Claude Code keeps its prompt cache.
|
Package tune works out, from what one user's agents really did, the settings that would have cost that user the fewest tokens: when each agent compacts its conversation, and how long Claude Code keeps its prompt cache. |
|
update
Package update keeps magpie current.
|
Package update keeps magpie current. |
|
upstream
Package upstream reads the vendors' own status pages (#971, emo172): a request that fails while Anthropic's or OpenAI's API is down looks, in magpie, like a sign-in or quota problem, and the user signs in again and again for nothing.
|
Package upstream reads the vendors' own status pages (#971, emo172): a request that fails while Anthropic's or OpenAI's API is down looks, in magpie, like a sign-in or quota problem, and the user signs in again and again for nothing. |
|
usage
Package usage keeps the token count of every call the gateway serves, so magpie can show what each agent and model consumed and roughly what it cost.
|
Package usage keeps the token count of every call the gateway serves, so magpie can show what each agent and model consumed and roughly what it cost. |
|
usageapi
Package usageapi builds what magpie tells of its usage log: the Usage page's summary and its requests, a page at a time.
|
Package usageapi builds what magpie tells of its usage log: the Usage page's summary and its requests, a page at a time. |
|
wslrun
Package wslrun runs, from magpie on Windows, a command that is installed only in a WSL distro: Claude Code signed in to inside Ubuntu, say.
|
Package wslrun runs, from magpie on Windows, a command that is installed only in a WSL distro: Claude Code signed in to inside Ubuntu, say. |
|
zed
Package zed speaks to Zed's hosted models, the way the Zed editor does for a Zed Pro (or trial, student, business) account.
|
Package zed speaks to Zed's hosted models, the way the Zed editor does for a Zed Pro (or trial, student, business) account. |
|
plugins
|
|
|
all
Package all registers every built-in plugin.
|
Package all registers every built-in plugin. |
|
gateway
Package gateway is the Gateway page: the gateway's state, its keys, how to connect a client, the models it serves and its recent calls.
|
Package gateway is the Gateway page: the gateway's state, its keys, how to connect a client, the models it serves and its recent calls. |
|
groups
Package groups is routing groups' part of the window: several models agents pick as one, each request sent to the right one and on to the next when one fails.
|
Package groups is routing groups' part of the window: several models agents pick as one, each request sent to the right one and on to the next when one fails. |
|
library
Package library is the Library page: instructions, MCP servers, skills and hooks, kept once and given to every agent.
|
Package library is the Library page: instructions, MCP servers, skills and hooks, kept once and given to every agent. |
|
otel
Package otel is Settings' Observability: each request's traces and metrics sent to an OpenTelemetry collector, such as Langfuse.
|
Package otel is Settings' Observability: each request's traces and metrics sent to an OpenTelemetry collector, such as Langfuse. |
|
sessions
Package sessions is the Sessions page: the agents' past conversations, to read, search, resume and export.
|
Package sessions is the Sessions page: the agents' past conversations, to read, search, resume and export. |
|
warmups
Package warmups is warm-up and check-in: start a subscription's usage window at a time the user picks, and claim vendors' daily check-in credits.
|
Package warmups is warm-up and check-in: start a subscription's usage window at a time the user picks, and claim vendors' daily check-in credits. |
Click to show internal directories.
Click to hide internal directories.