site: the docs have Docker and Remote magpie pages in English, Chinese and Japanese, listed in every docs page's contents and footer and linked from the READMEs (HuanCheng Bai on Discord)

Until now, both were only in docs/reference.md. The new pages are at
/docs/docker, /docs/remote and their zh/ and ja/ versions.

- docker: the image, its tags, ports, the /config volume and the nonroot
  user. How to run it with the browser UI (`web --addr 0.0.0.0:3430
  --no-open`, MAGPIE_WEB_KEY, the ?k= cookie). Signing in through the
  Callback URL paste or `docker exec ... magpie accounts add`. What
  /config keeps, the env vars, sharing with gateway keys, and a Compose
  file for a NAS. Healthcheck and updates.
- remote: sharing the main magpie, then adding it as a Remote magpie
  from the app, the TUI (a/w/m) or `magpie provider add remote-magpie
  <key> url=... id=office`. What comes over (models, groups, APIs,
  images, System One, embeddings, prices, quotas) and the errors magpie
  shows, quoted from remote_quotas.go and lan.go.

The facts were checked against the code, not reference.md:
- the Dockerfile ENV, VOLUME, HEALTHCHECK and EXPOSE;
- docker.yml's tags;
- web_cli.go;
- the lanGuard in internal/gateway/lan.go;
- the remote-magpie preset.

The Docker page's warning says a Docker gateway answers anyone until
sharing is on, because MAGPIE_ADDR is 0.0.0.0 there.

The new links in the top nav bar carry a toc-only class:
- docs.js still lists them in the contents;
- the bar keeps today's width, since nine links overflowed it at
  1024-1280px.

`.steps li` gets min-width: 0, so a long inline code no longer widens
the grid past a phone's width, where `overflow: hidden` clipped the
text.

Run:
- Real containers from ghcr.io/yetone/magpie:latest (v0.1.1150):
  - the documented `docker run ... web` came up healthy, and its log
    output is what the page shows;
  - with "lan": true, `Bearer magpie` got 401 and a gateway key got 200;
  - a second container ran `provider add remote-magpie <key>
    url=http://<a>:3425 id=office` and listed office/test-relay/... models.
- `node --test site/*.test.mjs`: 23 pass.
- Playwright, in Chromium and WebKit, at 1280, 1024 and 390, light and
  dark:
  - no horizontal scroll and no nav overflow on all 20 docs pages;
  - every internal link and #anchor resolves. /zh/ and /ja/ are routed
    by the worker and return 200 live.
This commit is contained in:
yetone committed 2026-10-10 09:08:03 +08:00
1 parent c65d9fb473
commit d86a4e0568
23 files changed
+1326 -7

No files matched your search

+5 -3
View File
@@ -57,7 +57,7 @@ Runs on macOS, Windows and Linux (menu bar app, window, TUI, web UI and CLI), in
curl -fsSL https://usemagpie.ai/install.sh | sh
```
<sub>Mac builds are signed and notarised, and every build updates itself. Behind a firewall, use `--proxy` or `--mirror`. Or `go install github.com/yetone/magpie@latest`, or the [Docker image](docs/reference.md#docker).</sub>
<sub>Mac builds are signed and notarised, and every build updates itself. Behind a firewall, use `--proxy` or `--mirror`. Or `go install github.com/yetone/magpie@latest`, or the [Docker image](https://usemagpie.ai/docs/docker).</sub>
**2 · Add a provider.** Open magpie and go to **Providers → Add provider**. Pick a preset and paste a key, or sign in with a subscription.
@@ -251,8 +251,8 @@ Find them under Plugins › Discover › Gateway middleware. See [Gateway middle
| | |
| :-- | :-- |
| **Local network** | Turn on *Share on local network* and give each client a named gateway key with its own daily, weekly or monthly token and cost limit |
| **Remote magpie** | A laptop uses the providers, accounts and groups of the magpie on your desktop, and still wires its own agents |
| **Docker** | Run `ghcr.io/yetone/magpie` on a server or a NAS and manage it from the web UI |
| **[Remote magpie](https://usemagpie.ai/docs/remote)** | A laptop uses the providers, accounts and groups of the magpie on your desktop, and still wires its own agents |
| **[Docker](https://usemagpie.ai/docs/docker)** | Run `ghcr.io/yetone/magpie` on a server or a NAS and manage it from the web UI |
| **Sync** | Back up to a file, or sync machines over WebDAV (Nutstore, Nextcloud…) or S3 |
### Also
@@ -272,6 +272,8 @@ Find them under Plugins › Discover › Gateway middleware. See [Gateway middle
| **[Plugins](https://usemagpie.ai/docs/plugins)** | Use plugins and write your own |
| **[Intent routing](https://usemagpie.ai/docs/intent)** | Route each turn by what it asks for |
| **[Import links](https://usemagpie.ai/docs/import)** | "Add to magpie" buttons for provider websites |
| **[Remote magpie](https://usemagpie.ai/docs/remote)** | Use one magpie's providers and groups from your other computers |
| **[Docker](https://usemagpie.ai/docs/docker)** | Run magpie on a server or a NAS |
## Privacy
+5 -3
View File
@@ -57,7 +57,7 @@
curl -fsSL https://usemagpie.ai/install.sh | sh
```
<sub>Mac 版已签名并公证,每个版本都会自动更新。网络受限时可用 `--proxy` 或 `--mirror`。也可以 `go install github.com/yetone/magpie@latest`,或者用 [Docker 镜像](docs/reference.md#docker)。</sub>
<sub>Mac 版已签名并公证,每个版本都会自动更新。网络受限时可用 `--proxy` 或 `--mirror`。也可以 `go install github.com/yetone/magpie@latest`,或者用 [Docker 镜像](https://usemagpie.ai/docs/zh/docker)。</sub>
**2 · 添加 provider。**打开 magpie,进入 **Providers → 添加 provider**。选一个预设、粘贴 key,或者登录一个订阅。
@@ -251,8 +251,8 @@ magpie plugin options model-map '{"mapping": {"fast": "deepseek/deepseek-chat"}}
| | |
| :-- | :-- |
| **局域网** | 打开「在局域网共享」,给每个客户端一个命名的网关 key,各自设每天、每周或每月的 token 和花费上限 |
| **远程 magpie** | 笔记本用台式机上那个 magpie 的 provider、账号和路由组,同时照样配置自己的 Agent |
| **Docker** | 在服务器或 NAS 上跑 `ghcr.io/yetone/magpie`,用 Web 界面管理 |
| **[远程 magpie](https://usemagpie.ai/docs/zh/remote)** | 笔记本用台式机上那个 magpie 的 provider、账号和路由组,同时照样配置自己的 Agent |
| **[Docker](https://usemagpie.ai/docs/zh/docker)** | 在服务器或 NAS 上跑 `ghcr.io/yetone/magpie`,用 Web 界面管理 |
| **同步** | 备份到文件,或者通过 WebDAV(坚果云、Nextcloud……)或 S3 在多台机器间同步 |
### 还有
@@ -272,6 +272,8 @@ magpie plugin options model-map '{"mapping": {"fast": "deepseek/deepseek-chat"}}
| **[插件](https://usemagpie.ai/docs/zh/plugins)** | 使用插件和编写插件 |
| **[意图路由](https://usemagpie.ai/docs/zh/intent)** | 按每轮对话的内容选择模型 |
| **[导入链接](https://usemagpie.ai/docs/zh/import)** | 给 provider 网站用的「添加到 magpie」按钮 |
| **[远程 magpie](https://usemagpie.ai/docs/zh/remote)** | 在其他电脑上用同一个 magpie 的 provider 和路由组 |
| **[Docker](https://usemagpie.ai/docs/zh/docker)** | 在服务器或 NAS 上运行 magpie |
## 隐私
+3 -1
View File
@@ -69,6 +69,8 @@ nav .wrap { display: flex; align-items: center; gap: 14px; height: 60px; }
nav .links { display: flex; gap: 24px; margin-left: auto; margin-right: 10px; font-size: 14px; color: var(--ink2); }
nav .links a { text-decoration: none; }
nav .links a:hover { color: var(--ink); }
/* listed in the contents (docs.js reads them from here) but kept out of the bar, which has no room */
nav .links a.toc-only { display: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink2); cursor: pointer; padding: 0; flex: none; }
.icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
@@ -129,7 +131,7 @@ article :not(pre) > code { font-size: .86em; background: var(--code); border: 1p
.figure figcaption { font-size: 13px; color: var(--ink3); margin-top: 12px; text-align: center; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.steps li { counter-increment: s; background: var(--card); margin: 0 !important; padding: 18px 20px 18px 60px; position: relative; }
.steps li { counter-increment: s; background: var(--card); margin: 0 !important; padding: 18px 20px 18px 60px; position: relative; min-width: 0; }
.steps li::before { content: counter(s); position: absolute; left: 20px; top: 18px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.steps li b { display: block; margin-bottom: 2px; }
+236
View File
@@ -0,0 +1,236 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Docker · magpie docs</title>
<meta name="description" content="Run magpie in Docker on a server or a NAS: the ghcr.io/yetone/magpie image, its ports, volume and environment, the browser UI, signing in to subscriptions, sharing the gateway with gateway keys, and a Compose file.">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/docker">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/docker">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/docker">
<link rel="stylesheet" href="/docs.css">
<meta property="og:title" content="magpie in Docker">
<meta property="og:description" content="Run magpie&#x27;s gateway on a server or a NAS and manage it from the browser.">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/docker">
<meta name="twitter:card" content="summary_large_image">
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>Docs</small></a>
<div class="links">
<a href="/">Home</a>
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a class="toc-only" href="/docs/remote">Remote magpie</a>
<a class="toc-only" href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="Language" title="Language" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/docker" hreflang="en" lang="en">English</a>
<a href="/docs/zh/docker" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/docker" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="magpie on Discord" title="Join us on Discord"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="magpie on GitHub" title="Source on GitHub"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">Download</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>Docker</p>
<a href="#overview">Overview</a>
<a href="#run">Run it</a>
<a href="#web">The browser UI</a>
<a href="#signin">Sign in to subscriptions</a>
<a href="#volume">What is kept</a>
<a href="#env">Environment</a>
<a href="#share">Share it with other machines</a>
<a href="#compose">Docker Compose on a NAS</a>
<a href="#ops">Health, terminal, updates</a>
</aside>
<article>
<p class="eyebrow" id="overview">Docs · Servers</p>
<h1>magpie in Docker</h1>
<p class="lede">Run magpie on a server or a NAS that has no desktop: its gateway serves your models to agents on other computers, and you add providers and sign in to subscriptions from a page in your browser.</p>
<div class="table-wrap"><table>
<tr><td><b>Image</b></td><td><code>ghcr.io/yetone/magpie</code>, for <code>linux/amd64</code> and <code>linux/arm64</code></td></tr>
<tr><td><b>Tags</b></td><td><code>latest</code> (the newest release), <code>0.1.1150</code> (one release), <code>0.1</code>, <code>edge</code> (every change on <code>main</code>)</td></tr>
<tr><td><b>Ports</b></td><td><code>3425</code> the gateway agents call; <code>3430</code> the browser UI, when the container runs <code>magpie web</code></td></tr>
<tr><td><b>Volume</b></td><td><code>/config</code>: providers, keys, sign-ins, plugins and usage</td></tr>
<tr><td><b>User</b></td><td>nonroot (uid 65532)</td></tr>
</table></div>
<p>The image holds magpie’s terminal-only build on distroless, with bash and busybox for a terminal in the container. It runs <code>magpie serve</code> (the gateway alone) unless given another command. The container finds no agents to wire, so magpie in it is a gateway: the agents that use it run elsewhere.</p>
<h2 id="run"><a class="anchor" href="#run">Run it</a></h2>
<p>Run it with the browser UI, a key for that page you keep across restarts, and both ports on the host’s loopback only:</p>
<div class="code">
<span class="lang">Shell</span>
<button class="copy" data-copy="ex-run">Copy</button>
<pre id="ex-run">docker run -d --name magpie --restart unless-stopped \
-p 127.0.0.1:3425:3425 -p 127.0.0.1:3430:3430 \
-e MAGPIE_WEB_KEY=$(openssl rand -hex 16) \
-v magpie-config:/config \
ghcr.io/yetone/magpie:latest web --addr 0.0.0.0:3430 --no-open
docker logs magpie</pre>
</div>
<p>The log names the page with its key:</p>
<div class="code">
<span class="lang">Output</span>
<pre>● magpie web on http://127.0.0.1:3430/?k=0f3c9a1e…
on the network http://172.17.0.2:3430/?k=0f3c9a1e…
these are the container's own addresses: other machines use the host's, and MAGPIE_PUBLIC_URL=http://&lt;host&gt;:&lt;port&gt; puts it here
! anyone with the link can change magpie and see its keys, and the network carries it unencrypted
the link carries MAGPIE_WEB_KEY · gateway http://127.0.0.1:3425 · Ctrl-C to stop</pre>
</div>
<div class="callout"><b>Keep the ports on 127.0.0.1 for now.</b> Until it is <a href="#share">shared</a>, a gateway in Docker answers anyone who reaches it, with any key (<code>Bearer magpie</code> included). <code>-p 3425:3425</code> would publish it on every interface of the host, past its firewall. Publish it further only after sharing is on and you have a gateway key.</div>
<p>Without <code>web --addr 0.0.0.0:3430 --no-open</code> the container runs the gateway alone, which you then set up from a terminal in it (<code>docker exec -it magpie magpie provider add …</code>). A folder bind-mounted at <code>/config</code> works in place of the named volume, if uid 65532 can write it: <code>sudo chown -R 65532:65532 /volume1/docker/magpie/config</code>.</p>
<h2 id="web"><a class="anchor" href="#web">The browser UI</a></h2>
<p>Open the link from the log. The key in it is traded for a cookie and taken out of the address; a page opened without it is turned away (401). With <code>MAGPIE_WEB_KEY</code> set (16 or more letters, digits or <code>- . _ ~</code>; <code>openssl rand -hex 16</code> makes one) the key stays the same across restarts and the browser stays signed in for 400 days. Without it, every start makes a new key and the cookie lasts the browser session.</p>
<p>The page is in <b>gateway mode</b>: <span class="ui">Providers</span>, <span class="ui">Gateway</span>, <span class="ui">Routing</span>, <span class="ui">Usage</span>, <span class="ui">Plugins</span> and <span class="ui">Settings</span>, with no Agents, Sessions or Library, since there are no agents in the container. <span class="ui">Settings</span> → <span class="ui">General</span> → <span class="ui">Gateway mode</span> turns it off.</p>
<p>On a NAS or a server you reach over SSH, open the page through a tunnel rather than publishing 3430: <code>ssh -L 3430:127.0.0.1:3430 you@nas</code>, then the log’s link on your own computer.</p>
<div class="callout"><b>Anyone with the link can change magpie and see its keys.</b> The page has no HTTPS of its own. Keep 3430 on loopback or a VPN, or put it behind a reverse proxy with TLS.</div>
<h2 id="signin"><a class="anchor" href="#signin">Sign in to subscriptions</a></h2>
<p>Add API keys on <span class="ui">Providers</span> as on the desktop. A subscription’s sign-in (ChatGPT, Claude…) opens the vendor’s page in your browser, and when you are done the vendor sends that browser back to <code>localhost</code>, for ChatGPT <code>http://localhost:1455/auth/callback?code=…</code>. That is your own computer, not the container, so the page doesn’t load. Copy its whole address from the address bar and paste it into the sign-in’s <span class="ui">Callback URL</span> field.</p>
<p>The same from a terminal:</p>
<div class="code">
<span class="lang">Shell</span>
<button class="copy" data-copy="ex-signin">Copy</button>
<pre id="ex-signin">docker exec -it magpie magpie accounts add codex</pre>
</div>
<p>Open the link it prints, sign in, then paste the address the browser ended on. The browser UI can also import sign-ins from a file.</p>
<h2 id="volume"><a class="anchor" href="#volume">What is kept</a></h2>
<p>Everything magpie writes is under <code>/config</code>, so a restart, or a new container on the same volume, keeps your providers, keys, sign-ins and plugins.</p>
<div class="table-wrap"><table>
<tr><th>Path</th><th>Holds</th></tr>
<tr><td><code>/config/magpie</code></td><td>magpie’s own files: <code>settings.json</code>, providers, gateway keys, routing groups</td></tr>
<tr><td><code>/config/home</code></td><td>the container’s <code>HOME</code>: sign-ins kept where their agent keeps them (<code>~/.codex</code>, <code>~/.claude</code>…)</td></tr>
<tr><td><code>/config/cache</code></td><td>the model catalog, and Bun, which plugins run on (downloaded the first time one is used)</td></tr>
<tr><td><code>/config/data</code>, <code>/config/state</code></td><td>the rest of what magpie keeps</td></tr>
</table></div>
<p>A volume made by an older image keeps working: magpie adds the folders it lacks when it starts. Only sign-ins made with that older image, which lived outside the volume, have to be made again.</p>
<h2 id="env"><a class="anchor" href="#env">Environment</a></h2>
<div class="table-wrap"><table>
<tr><th>Variable</th><th>What it does</th></tr>
<tr><td><code>MAGPIE_ADDR</code></td><td>where the gateway listens. The image sets <code>0.0.0.0:3425</code>, so the published port reaches it.</td></tr>
<tr><td><code>MAGPIE_PUBLIC_URL</code></td><td>the address other machines reach the gateway at, such as <code>http://192.168.1.20:3425</code> (the host’s or the NAS’s, on the published port), or a reverse proxy’s base URL. In the container magpie sees only Docker’s own <code>172.17.x</code> address; with this set, the address it shows and prints is the one to use.</td></tr>
<tr><td><code>MAGPIE_WEB_KEY</code></td><td>the browser UI’s key, kept across restarts (16+ characters)</td></tr>
<tr><td><code>HOME</code>, <code>XDG_CONFIG_HOME</code>, <code>XDG_CACHE_HOME</code>, <code>XDG_DATA_HOME</code>, <code>XDG_STATE_HOME</code></td><td>set by the image to the folders under <code>/config</code> above; leave them</td></tr>
</table></div>
<h2 id="share"><a class="anchor" href="#share">Share it with other machines</a></h2>
<ol class="steps">
<li><b>Turn on sharing</b>In the browser UI, <span class="ui">Settings</span> → <span class="ui">Share on local network</span> → <span class="ui">On</span>. That also makes a gateway key named <span class="ui">Magpie</span>. From then on every request from outside the container must carry an enabled gateway key, and one without gets 401. Without the UI, put <code>"lan": true</code> in <code>/config/magpie/settings.json</code>.</li>
<li><b>Give each client a key</b><span class="ui">Gateway</span> → <span class="ui">Gateway keys</span>, or in a terminal <code>docker exec magpie magpie gateway-key add "Laptop"</code>, which prints the new <code>sk-magpie-key-…</code>. A key can have its own daily, weekly or monthly limit and its own list of models (<code>magpie gateway-key limit</code>, <code>magpie gateway-key models</code>).</li>
<li><b>Publish the port</b>Recreate the container with <code>-p 3425:3425</code>, or bound to the NAS’s LAN or VPN address (<code>-p 192.168.1.20:3425:3425</code>), and with <code>-e MAGPIE_PUBLIC_URL=http://192.168.1.20:3425</code>.</li>
</ol>
<p>On each other computer, point the agent at the gateway with one of those keys as its API key: <code>http://192.168.1.20:3425/v1</code> for an OpenAI client, <code>http://192.168.1.20:3425</code> for an Anthropic or Gemini one. Model ids are <code>provider/model</code>, or a routing group’s; <code>GET /v1/models</code> lists them. If that computer runs magpie itself, add the container as a <a href="/docs/remote">Remote magpie</a> instead, and magpie wires its agents for you.</p>
<div class="callout"><b>Over the internet, prefer a VPN</b> such as Tailscale or WireGuard to opening 3425. A reverse proxy or tunnel in front of the container is the network too: turn sharing on first, so that its clients need a gateway key.</div>
<h2 id="compose"><a class="anchor" href="#compose">Docker Compose on a NAS</a></h2>
<div class="code">
<span class="lang">compose.yaml</span>
<button class="copy" data-copy="ex-compose">Copy</button>
<pre id="ex-compose">services:
magpie:
image: ghcr.io/yetone/magpie:latest
restart: unless-stopped
ports:
<span class="c"># on loopback until sharing is on and there is a gateway key</span>
- "127.0.0.1:3425:3425"
- "127.0.0.1:3430:3430"
environment:
MAGPIE_PUBLIC_URL: http://&lt;nas-address&gt;:3425
MAGPIE_WEB_KEY: &lt;random-key&gt;
volumes:
- ./config:/config
command: [web, --addr, 0.0.0.0:3430, --no-open]</pre>
</div>
<p>Then: <code>sudo chown -R 65532:65532 ./config</code>, <code>docker compose up -d</code>, open <code>http://127.0.0.1:3430/?k=&lt;random-key&gt;</code> through an SSH tunnel, add your providers, turn on <span class="ui">Share on local network</span> and make a gateway key for each machine. Then change the gateway’s line to <code>"3425:3425"</code> (or the NAS’s LAN or VPN address) and run <code>docker compose up -d</code> again.</p>
<h2 id="ops"><a class="anchor" href="#ops">Health, terminal, updates</a></h2>
<ul>
<li><b>Health.</b> The image has a <code>HEALTHCHECK</code>: <code>magpie healthcheck</code> exits 0 while the gateway answers, under <code>serve</code> and <code>web</code> alike, so <code>docker ps</code> shows the container as healthy and Compose can wait for it with <code>depends_on: condition: service_healthy</code>.</li>
<li><b>Terminal.</b> <code>docker exec -it magpie bash</code>, or a NAS panel’s terminal, opens a shell with <code>magpie</code> on its PATH: <code>magpie providers</code>, <code>magpie models</code>, <code>magpie usage</code>, <code>magpie quota</code> and the rest of the <a href="https://github.com/yetone/magpie/blob/main/docs/reference.md">CLI</a>.</li>
<li><b>Updates.</b> Pull the new image and recreate the container on the same volume: <code>docker pull ghcr.io/yetone/magpie:latest</code>, then <code>docker rm -f magpie</code> and the same <code>docker run</code>, or <code>docker compose pull &amp;&amp; docker compose up -d</code>.</li>
<li><b>Build it yourself.</b> <code>docker build -t magpie .</code> in a checkout of <a href="https://github.com/yetone/magpie">the repository</a> makes the same image.</li>
</ul>
<p style="margin-top:48px">Questions or a setup worth sharing? Ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a>. The <a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#docker">reference</a> has the details.</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/">Home</a>
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a href="/docs/remote">Remote magpie</a>
<a href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "Copied"; setTimeout(() => (b.textContent = "Copy"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a class="toc-only" href="/docs/remote">Remote magpie</a>
<a class="toc-only" href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
@@ -255,6 +257,8 @@ href = <span class="s">"https://usemagpie.ai/import#"</span> + urlencode({
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a href="/docs/remote">Remote magpie</a>
<a href="/docs/docker">Docker</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
+4
View File
@@ -45,6 +45,8 @@
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a class="toc-only" href="/docs/remote">Remote magpie</a>
<a class="toc-only" href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
@@ -147,6 +149,8 @@ curl -s http://127.0.0.1:3425/v1/models -H "Authorization: Bearer magpie-acme"</
<a href="/">Home</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a href="/docs/remote">Remote magpie</a>
<a href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a class="toc-only" href="/docs/remote">Remote magpie</a>
<a class="toc-only" href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
@@ -316,6 +318,8 @@ The number of its kind (0 for none):</pre>
<a href="/">Home</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a href="/docs/remote">Remote magpie</a>
<a href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+236
View File
@@ -0,0 +1,236 @@
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Docker · magpie ドキュメント</title>
<meta name="description" content="サーバーや NAS で magpie を Docker で動かす:ghcr.io/yetone/magpie イメージのポート、ボリューム、環境変数、ブラウザ UI、サブスクリプションへのサインイン、ゲートウェイキーでの共有、Compose の例。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/docker">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/docker">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/docker">
<link rel="stylesheet" href="/docs.css">
<meta property="og:title" content="Docker で magpie を動かす">
<meta property="og:description" content="サーバーや NAS で magpie のゲートウェイを動かし、ブラウザから管理します。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/ja/docker">
<meta name="twitter:card" content="summary_large_image">
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/ja/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>ドキュメント</small></a>
<div class="links">
<a href="/ja/">ホーム</a>
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a class="toc-only" href="/docs/ja/remote">リモート magpie</a>
<a class="toc-only" href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="言語" title="言語" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/docker" hreflang="en" lang="en">English</a>
<a href="/docs/zh/docker" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/docker" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="Discord の magpie" title="Discord に参加"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="GitHub の magpie" title="GitHub のソースコード"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">ダウンロード</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>Docker</p>
<a href="#overview">概要</a>
<a href="#run">起動する</a>
<a href="#web">ブラウザ UI</a>
<a href="#signin">サブスクリプションにサインイン</a>
<a href="#volume">保存されるもの</a>
<a href="#env">環境変数</a>
<a href="#share">ほかのマシンと共有する</a>
<a href="#compose">NAS で Docker Compose</a>
<a href="#ops">ヘルスチェック・ターミナル・更新</a>
</aside>
<article>
<p class="eyebrow" id="overview">ドキュメント · サーバー</p>
<h1>Docker で magpie を動かす</h1>
<p class="lede">デスクトップのないサーバーや NAS で magpie を動かします。そのゲートウェイがほかのコンピューターのエージェントにモデルを提供し、プロバイダの追加やサブスクリプションへのサインインはブラウザのページから行います。</p>
<div class="table-wrap"><table>
<tr><td><b>イメージ</b></td><td><code>ghcr.io/yetone/magpie</code>(<code>linux/amd64</code> と <code>linux/arm64</code>)</td></tr>
<tr><td><b>タグ</b></td><td><code>latest</code>(最新リリース)、<code>0.1.1150</code>(特定のリリース)、<code>0.1</code>、<code>edge</code>(<code>main</code> の変更ごと)</td></tr>
<tr><td><b>ポート</b></td><td><code>3425</code> はエージェントが呼ぶゲートウェイ、<code>3430</code> はコンテナが <code>magpie web</code> を動かすときのブラウザ UI</td></tr>
<tr><td><b>ボリューム</b></td><td><code>/config</code>:プロバイダ、キー、サインイン、プラグイン、使用量</td></tr>
<tr><td><b>ユーザー</b></td><td>nonroot(uid 65532)</td></tr>
</table></div>
<p>イメージに入っているのはターミナル専用ビルドの magpie で、distroless をベースに、コンテナ内でターミナルを使うための bash と busybox を含みます。コマンドを指定しなければ <code>magpie serve</code>(ゲートウェイのみ)を実行します。コンテナ内には設定するエージェントがないので、ここでの magpie はゲートウェイです。それを使うエージェントはほかのマシンで動きます。</p>
<h2 id="run"><a class="anchor" href="#run">起動する</a></h2>
<p>ブラウザ UI 付きで、再起動しても変わらないページ用のキーを渡し、両方のポートをホストのループバックだけに公開して起動します。</p>
<div class="code">
<span class="lang">Shell</span>
<button class="copy" data-copy="ex-run">コピー</button>
<pre id="ex-run">docker run -d --name magpie --restart unless-stopped \
-p 127.0.0.1:3425:3425 -p 127.0.0.1:3430:3430 \
-e MAGPIE_WEB_KEY=$(openssl rand -hex 16) \
-v magpie-config:/config \
ghcr.io/yetone/magpie:latest web --addr 0.0.0.0:3430 --no-open
docker logs magpie</pre>
</div>
<p>ログにキー付きのページのアドレスが出ます。</p>
<div class="code">
<span class="lang">出力</span>
<pre>● magpie web on http://127.0.0.1:3430/?k=0f3c9a1e…
on the network http://172.17.0.2:3430/?k=0f3c9a1e…
these are the container's own addresses: other machines use the host's, and MAGPIE_PUBLIC_URL=http://&lt;host&gt;:&lt;port&gt; puts it here
! anyone with the link can change magpie and see its keys, and the network carries it unencrypted
the link carries MAGPIE_WEB_KEY · gateway http://127.0.0.1:3425 · Ctrl-C to stop</pre>
</div>
<div class="callout"><b>今はポートを 127.0.0.1 のままにしてください。</b><a href="#share">共有</a>をオンにするまで、Docker 内のゲートウェイは届いた相手すべてに、どんなキー(<code>Bearer magpie</code> も含む)でも応答します。<code>-p 3425:3425</code> はホストのすべてのインターフェイスに公開し、ホストのファイアウォールも通り抜けます。外に公開するのは、共有をオンにしてゲートウェイキーを用意してからにしてください。</div>
<p><code>web --addr 0.0.0.0:3430 --no-open</code> を付けなければコンテナはゲートウェイだけを動かし、設定はコンテナ内のターミナルから行います(<code>docker exec -it magpie magpie provider add …</code>)。名前付きボリュームの代わりにフォルダを <code>/config</code> にバインドマウントすることもできます。uid 65532 が書き込める必要があります:<code>sudo chown -R 65532:65532 /volume1/docker/magpie/config</code>。</p>
<h2 id="web"><a class="anchor" href="#web">ブラウザ UI</a></h2>
<p>ログのリンクを開きます。リンクのキーは cookie に置き換わり、アドレスから消えます。キーなしで開いたページは拒否されます(401)。<code>MAGPIE_WEB_KEY</code>(英数字か <code>- . _ ~</code> で 16 文字以上。<code>openssl rand -hex 16</code> で作れます)を設定すると、再起動してもキーは変わらず、ブラウザは 400 日サインインしたままです。設定しなければ起動のたびに新しいキーができ、cookie はそのブラウザセッションの間だけ有効です。</p>
<p>ページは<b>ゲートウェイモード</b>で開きます:<span class="ui">プロバイダ</span>、<span class="ui">ゲートウェイ</span>、<span class="ui">ルーティング</span>、<span class="ui">使用量</span>、<span class="ui">プラグイン</span>、<span class="ui">設定</span>だけで、コンテナにはエージェントがないのでエージェント、セッション、ライブラリはありません。<span class="ui">設定</span> → <span class="ui">一般</span> → <span class="ui">ゲートウェイモード</span>でオフにできます。</p>
<p>NAS や SSH で入るサーバーでは、3430 を公開せずにトンネル経由でページを開きます:<code>ssh -L 3430:127.0.0.1:3430 you@nas</code> を実行してから、自分のコンピューターでログのリンクを開きます。</p>
<div class="callout"><b>リンクを持つ人は誰でも magpie を変更し、そのキーを見られます。</b>ページ自体に HTTPS はありません。3430 はループバックか VPN 上に置くか、TLS 付きのリバースプロキシの後ろに置いてください。</div>
<h2 id="signin"><a class="anchor" href="#signin">サブスクリプションにサインイン</a></h2>
<p>API キーはデスクトップと同じく<span class="ui">プロバイダ</span>で追加します。サブスクリプション(ChatGPT、Claude…)のサインインはブラウザでベンダーのページを開き、終わるとベンダーはそのブラウザを <code>localhost</code> に戻します。ChatGPT なら <code>http://localhost:1455/auth/callback?code=…</code> です。これはコンテナではなく自分のコンピューターなので、ページは開けません。アドレスバーのアドレスを丸ごとコピーし、サインインの <span class="ui">コールバック URL</span> 欄に貼り付けます。</p>
<p>ターミナルからも同じことができます。</p>
<div class="code">
<span class="lang">Shell</span>
<button class="copy" data-copy="ex-signin">コピー</button>
<pre id="ex-signin">docker exec -it magpie magpie accounts add codex</pre>
</div>
<p>表示されたリンクを開いてサインインし、ブラウザが最後に表示したアドレスを貼り付けます。ブラウザ UI からはファイルからサインインを取り込むこともできます。</p>
<h2 id="volume"><a class="anchor" href="#volume">保存されるもの</a></h2>
<p>magpie が書くものはすべて <code>/config</code> の下にあるので、再起動しても、同じボリュームで新しいコンテナを作っても、プロバイダ、キー、サインイン、プラグインは残ります。</p>
<div class="table-wrap"><table>
<tr><th>パス</th><th>中身</th></tr>
<tr><td><code>/config/magpie</code></td><td>magpie 自身のファイル:<code>settings.json</code>、プロバイダ、ゲートウェイキー、ルーティンググループ</td></tr>
<tr><td><code>/config/home</code></td><td>コンテナの <code>HOME</code>:サインインは各エージェントが保存する場所(<code>~/.codex</code>、<code>~/.claude</code>…)に保存されます</td></tr>
<tr><td><code>/config/cache</code></td><td>モデルカタログと、プラグインが動く Bun(初めてプラグインを使うときにダウンロード)</td></tr>
<tr><td><code>/config/data</code>、<code>/config/state</code></td><td>magpie が保存するその他のもの</td></tr>
</table></div>
<p>古いイメージで作ったボリュームもそのまま使えます。magpie は起動時に足りないフォルダを作ります。古いイメージで行ったサインイン(ボリュームの外に保存されていたもの)だけはやり直しが必要です。</p>
<h2 id="env"><a class="anchor" href="#env">環境変数</a></h2>
<div class="table-wrap"><table>
<tr><th>変数</th><th>役割</th></tr>
<tr><td><code>MAGPIE_ADDR</code></td><td>ゲートウェイが待ち受けるアドレス。イメージでは <code>0.0.0.0:3425</code> に設定され、公開したポートから届きます。</td></tr>
<tr><td><code>MAGPIE_PUBLIC_URL</code></td><td>ほかのマシンがゲートウェイに届くアドレス。例:<code>http://192.168.1.20:3425</code>(ホストや NAS のアドレスと公開ポート)、またはリバースプロキシのベース URL。コンテナ内の magpie には Docker 自身の <code>172.17.x</code> のアドレスしか見えません。これを設定すると、表示されるアドレスが使うべきものになります。</td></tr>
<tr><td><code>MAGPIE_WEB_KEY</code></td><td>ブラウザ UI のキー。再起動しても変わりません(16 文字以上)</td></tr>
<tr><td><code>HOME</code>、<code>XDG_CONFIG_HOME</code>、<code>XDG_CACHE_HOME</code>、<code>XDG_DATA_HOME</code>、<code>XDG_STATE_HOME</code></td><td>イメージが上の <code>/config</code> 配下のフォルダに設定しています。変えないでください</td></tr>
</table></div>
<h2 id="share"><a class="anchor" href="#share">ほかのマシンと共有する</a></h2>
<ol class="steps">
<li><b>共有をオンにする</b>ブラウザ UI で <span class="ui">設定</span> → <span class="ui">ローカルネットワークで共有</span> → <span class="ui">オン</span>。<span class="ui">Magpie</span> という名前のゲートウェイキーも作られます。以後、コンテナの外からのリクエストには有効なゲートウェイキーが必要で、ないものは 401 になります。UI を使わない場合は <code>/config/magpie/settings.json</code> に <code>"lan": true</code> を書きます。</li>
<li><b>クライアントごとにキーを渡す</b><span class="ui">ゲートウェイ</span> → <span class="ui">ゲートウェイキー</span>、またはターミナルで <code>docker exec magpie magpie gateway-key add "Laptop"</code>。新しい <code>sk-magpie-key-…</code> が表示されます。キーごとに日・週・月の上限と使えるモデルを決められます(<code>magpie gateway-key limit</code>、<code>magpie gateway-key models</code>)。</li>
<li><b>ポートを公開する</b><code>-p 3425:3425</code>(または NAS の LAN や VPN のアドレスに限定して <code>-p 192.168.1.20:3425:3425</code>)と <code>-e MAGPIE_PUBLIC_URL=http://192.168.1.20:3425</code> を付けてコンテナを作り直します。</li>
</ol>
<p>ほかのコンピューターでは、エージェントをゲートウェイに向け、そのキーのどれかを API キーにします:OpenAI クライアントなら <code>http://192.168.1.20:3425/v1</code>、Anthropic や Gemini なら <code>http://192.168.1.20:3425</code>。モデル ID は <code>provider/model</code> かルーティンググループの名前で、<code>GET /v1/models</code> が一覧を返します。そのコンピューターでも magpie を動かしているなら、コンテナを<a href="/docs/ja/remote">リモート magpie</a> として追加すれば、magpie がエージェントを設定します。</p>
<div class="callout"><b>インターネット越しなら VPN を</b>(Tailscale や WireGuard など)。3425 を開けるより安全です。コンテナの前に置くリバースプロキシやトンネルもネットワークです。先に共有をオンにして、そのクライアントにゲートウェイキーが必要になるようにしてください。</div>
<h2 id="compose"><a class="anchor" href="#compose">NAS で Docker Compose</a></h2>
<div class="code">
<span class="lang">compose.yaml</span>
<button class="copy" data-copy="ex-compose">コピー</button>
<pre id="ex-compose">services:
magpie:
image: ghcr.io/yetone/magpie:latest
restart: unless-stopped
ports:
<span class="c"># 共有をオンにしてゲートウェイキーができるまではループバックのみ</span>
- "127.0.0.1:3425:3425"
- "127.0.0.1:3430:3430"
environment:
MAGPIE_PUBLIC_URL: http://&lt;nas-address&gt;:3425
MAGPIE_WEB_KEY: &lt;random-key&gt;
volumes:
- ./config:/config
command: [web, --addr, 0.0.0.0:3430, --no-open]</pre>
</div>
<p>続いて <code>sudo chown -R 65532:65532 ./config</code>、<code>docker compose up -d</code> を実行し、SSH トンネル経由で <code>http://127.0.0.1:3430/?k=&lt;random-key&gt;</code> を開いて、プロバイダを追加し、<span class="ui">ローカルネットワークで共有</span>をオンにして、マシンごとにゲートウェイキーを作ります。そのあとゲートウェイの行を <code>"3425:3425"</code>(または NAS の LAN や VPN のアドレス)に変えて、もう一度 <code>docker compose up -d</code> を実行します。</p>
<h2 id="ops"><a class="anchor" href="#ops">ヘルスチェック・ターミナル・更新</a></h2>
<ul>
<li><b>ヘルスチェック。</b>イメージには <code>HEALTHCHECK</code> があります。ゲートウェイが応答している間 <code>magpie healthcheck</code> は 0 で終わり、<code>serve</code> でも <code>web</code> でも同じです。<code>docker ps</code> は healthy と表示し、Compose は <code>depends_on: condition: service_healthy</code> で待てます。</li>
<li><b>ターミナル。</b><code>docker exec -it magpie bash</code> や NAS の管理画面のターミナルで、<code>magpie</code> が PATH にあるシェルが開きます:<code>magpie providers</code>、<code>magpie models</code>、<code>magpie usage</code>、<code>magpie quota</code> など、<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md">CLI</a> のすべてが使えます。</li>
<li><b>更新。</b>新しいイメージを取得し、同じボリュームでコンテナを作り直します:<code>docker pull ghcr.io/yetone/magpie:latest</code> のあと <code>docker rm -f magpie</code> と同じ <code>docker run</code>、または <code>docker compose pull &amp;&amp; docker compose up -d</code>。</li>
<li><b>自分でビルドする。</b><a href="https://github.com/yetone/magpie">リポジトリ</a>のチェックアウトで <code>docker build -t magpie .</code> を実行すると同じイメージができます。</li>
</ul>
<p style="margin-top:48px">質問や共有したいセットアップがあれば <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> へどうぞ。詳細は<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#docker">リファレンス</a>(英語)にあります。</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/ja/">ホーム</a>
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a href="/docs/ja/remote">リモート magpie</a>
<a href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "コピーしました"; setTimeout(() => (b.textContent = "コピー"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a class="toc-only" href="/docs/ja/remote">リモート magpie</a>
<a class="toc-only" href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
@@ -255,6 +257,8 @@ href = <span class="s">"https://usemagpie.ai/import#"</span> + urlencode({
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a href="/docs/ja/remote">リモート magpie</a>
<a href="/docs/ja/docker">Docker</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a class="toc-only" href="/docs/ja/remote">リモート magpie</a>
<a class="toc-only" href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
@@ -316,6 +318,8 @@ The number of its kind (0 for none):</pre>
<a href="/ja/">ホーム</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a href="/docs/ja/remote">リモート magpie</a>
<a href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a class="toc-only" href="/docs/ja/remote">リモート magpie</a>
<a class="toc-only" href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
@@ -709,6 +711,8 @@ magpie plugin options model-map '{"mapping": {"fast": "deepseek/deepseek-chat"}}
<a href="/ja/">ホーム</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a href="/docs/ja/remote">リモート magpie</a>
<a href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+183
View File
@@ -0,0 +1,183 @@
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>リモート magpie · magpie ドキュメント</title>
<meta name="description" content="1 つの magpie を複数のコンピューターで使う:ネットワークで共有し、ほかのコンピューターでリモート magpie として追加する(アプリ、TUI、CLI)方法と、使えるもの:モデル、ルーティンググループ、画像、System One、価格、クォータ。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/remote">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/remote">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/remote">
<link rel="stylesheet" href="/docs.css">
<meta property="og:title" content="リモート magpie">
<meta property="og:description" content="1 つの magpie のプロバイダ、アカウント、ルーティンググループを、使うすべてのコンピューターで。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/ja/remote">
<meta name="twitter:card" content="summary_large_image">
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/ja/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>ドキュメント</small></a>
<div class="links">
<a href="/ja/">ホーム</a>
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a class="toc-only" href="/docs/ja/remote">リモート magpie</a>
<a class="toc-only" href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="言語" title="言語" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/remote" hreflang="en" lang="en">English</a>
<a href="/docs/zh/remote" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/remote" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="Discord の magpie" title="Discord に参加"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="GitHub の magpie" title="GitHub のソースコード"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">ダウンロード</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>リモート magpie</p>
<a href="#overview">概要</a>
<a href="#share">1. メインの magpie を共有する</a>
<a href="#add">2. ほかのコンピューターで追加する</a>
<a href="#models">使えるもの</a>
<a href="#quotas">クォータと使用量</a>
<a href="#trouble">うまくいかないとき</a>
</aside>
<article>
<p class="eyebrow" id="overview">ドキュメント · 共有</p>
<h1>リモート magpie</h1>
<p class="lede">1 つの magpie で複数のコンピューターをまかなえます。プロバイダを保存するコンピューター(デスクトップ、サーバー、<a href="/docs/ja/docker">Docker で動かす NAS</a>)でサインインとプロバイダ・ルーティンググループの設定を一度だけ行い、ほかの各コンピューターではその magpie を 1 つのプロバイダとして追加します。それが<b>リモート magpie</b>(Remote magpie)です。</p>
<div class="table-wrap"><table>
<tr><th></th><th>共有する magpie</th><th>ほかのコンピューターの magpie</th></tr>
<tr><td>プロバイダ、サブスクリプション、キー</td><td>ここに保存・サインイン</td><td>リモート magpie 経由で使う</td></tr>
<tr><td>ルーティンググループ</td><td>ここで作る</td><td><code>office/group/…</code> として選ぶ</td></tr>
<tr><td>エージェント</td><td>自分のもの</td><td>引き続きこのコンピューターの magpie が設定</td></tr>
<tr><td>使用量とクォータ</td><td>ここで集計・取得</td><td>ここに表示(リモートの名前付き)</td></tr>
</table></div>
<p>手元のコンピューターでも magpie は動き続けます。そのコンピューターのエージェントを設定し、モデルを選び、セッションを保存します。モデルだけがもう一方から来ます。</p>
<h2 id="share"><a class="anchor" href="#share">1. メインの magpie を共有する</a></h2>
<ol class="steps">
<li><b>共有をオンにする</b>プロバイダを保存しているコンピューターで <span class="ui">設定</span> → <span class="ui">ローカルネットワークで共有</span> → <span class="ui">オン</span>。magpie はローカルネットワークで待ち受け、<span class="ui">Magpie</span> という名前のゲートウェイキーを作ります。スイッチの下の <span class="ui">アドレス</span> の行に、ほかのコンピューターから届くアドレス(例:<code>http://192.168.1.20:3425</code>)が表示されます。</li>
<li><b>コンピューターごとにキーを作る</b><span class="ui">ゲートウェイ</span> → <span class="ui">ゲートウェイキー</span>、または <code>magpie gateway-key add "Laptop"</code>。<code>sk-magpie-key-…</code> が表示されます。キーごとに日・週・月の上限と使えるモデルを決められ、呼び出しはその名前で集計されます。</li>
</ol>
<p>共有がオフの間、デスクトップの magpie は自分のコンピューターでしか待ち受けず、ほかのコンピューターからは届きません。Docker の magpie は公開したポートから届きますが、キーを求めるようにするには同じスイッチをオンにする必要があります。<a href="/docs/ja/docker#share">Docker</a> を参照してください。</p>
<h2 id="add"><a class="anchor" href="#add">2. ほかのコンピューターで追加する</a></h2>
<p>手順 1 のアドレスとキーが必要です。次のどれでも追加できます。</p>
<ul>
<li><b>アプリ:</b><span class="ui">プロバイダ</span> タブで <span class="ui">+ プロバイダを追加</span> を押し、<span class="ui">Remote magpie</span> を選んで、アドレスとキーを入力します。</li>
<li><b>TUI</b>(<code>magpie tui</code>):Providers ページで <code>a</code> を押し、Remote magpie を選んでアドレスとキーを入力します。その行で <code>w</code> はアドレスの変更、<code>m</code> は一覧の再取得です。</li>
<li><b>CLI:</b></li>
</ul>
<div class="code">
<span class="lang">Shell</span>
<button class="copy" data-copy="ex-add">コピー</button>
<pre id="ex-add">magpie provider add remote-magpie sk-magpie-key-… url=http://192.168.1.20:3425 id=office
magpie models <span class="c"># office/… が共有する magpie のモデル</span>
magpie provider refresh office <span class="c"># 一覧を再取得</span></pre>
</div>
<p><code>id=</code> はこのコンピューターでのプロバイダ名で、モデル ID の先頭にもなります(<code>office/…</code>)。アドレスは <code>192.168.1.20:3425</code>(<code>http://</code> とみなされます)、末尾に <code>/v1</code> を付けた形、ルートのどれでも構いません。magpie はどの場合もすべての API をそこにつなぎます。共有元のコンピューターごとに、別の id でリモート magpie を 1 つ追加します。</p>
<h2 id="models"><a class="anchor" href="#models">使えるもの</a></h2>
<ul>
<li><b>そのモデル</b>。向こうのエージェントに見えるとおりです:<code>office/relay-a/claude-sonnet-5</code>、ラベルは <code>Claude Sonnet 5 · Relay A · office</code>。ID は ID のままで、名前はラベルにだけ付きます。ほかのモデルと同じようにエージェントに選べます。</li>
<li><b>そのルーティンググループ</b>。<code>office/group/…</code> として現れます。振り分けは共有する magpie 上で、そのアカウントを使って決まります。</li>
<li><b>すべての API。</b>リクエストはエージェントが使った API のまま転送されます(Anthropic Messages とトークン計数、Responses、Chat Completions)。共有側のプロバイダが別の API でしか提供しないモデルは、変換が 1 回だけ行われ、両方のコンピューターで変換されることはありません。Responses は WebSocket ではなく HTTP(SSE を含む)で送られます。</li>
<li><b>画像と動画。</b>画像・動画モデルは自動で見つかり、向こうの画像生成・編集・動画 API を通して使えます。</li>
<li><b>System One。</b>決定モデル(Jev、Clef、自分で名前を付けたモデル)は向こうの <code>/v1/systemone</code> につながり、チャットモデルではなく決定モデルとして現れます。新しいものはプロバイダの一覧を更新すると見つかります。<code>office</code> だけを指定すると一覧の最初の決定モデルに問い合わせます。</li>
<li><b>Embeddings と rerank</b> は向こうの対応する API に送られます。エージェントの一覧ではリモートでの扱いのままです。一覧にあっても会話に使えるわけではありません。</li>
<li><b>価格。</b>各モデルは共有する magpie の計算どおり(向こうで手動設定した価格、なければプロバイダの定価)になるので、2 台の集計は一致します。このコンピューターで設定した価格が優先されます。</li>
</ul>
<h2 id="quotas"><a class="anchor" href="#quotas">クォータと使用量</a></h2>
<p>使用量ページ、メニューバー、<code>magpie quota</code> には、共有する magpie のサブスクリプションカードがその名前付きで(<code>Codex · office</code>、id <code>office/codex</code>)、向こうが最後に読んだ内容で表示されます。ベンダーに問い合わせるのはサインインを持つコンピューターだけです。このコンピューターでカードを更新すると、向こうがもう一度読みます(最大で 30 秒に 1 回)。Codex のリセットや WorkBuddy のチェックインは、向こうのコンピューターのアプリ、TUI、CLI で行います。</p>
<p>共有する magpie は、このコンピューターのリクエストを、送ってきたゲートウェイキーの名前と応答したアカウントで記録します。</p>
<h2 id="trouble"><a class="anchor" href="#trouble">うまくいかないとき</a></h2>
<div class="table-wrap"><table>
<tr><th>表示</th><th>対処</th></tr>
<tr><td>「magpie isn’t shared on the local network」または「remote magpie isn’t shared」</td><td>そのコンピューターで <span class="ui">ローカルネットワークで共有</span> をオンにする</td></tr>
<tr><td>「remote magpie didn’t take this key」(401)</td><td>向こうの有効なゲートウェイキーを使う:向こうの <span class="ui">ゲートウェイ</span> → <span class="ui">ゲートウェイキー</span></td></tr>
<tr><td>モデルで 403</td><td>そのキーは一部のモデルしか使えない可能性があります。向こうで <code>magpie gateway-key models &lt;id&gt;</code> を実行すると確認・変更できます。<code>office</code> だけだとキーの許可に関係なく System One の最初の決定モデルに問い合わせます。完全な <code>office/provider/model</code> ID を使ってください</td></tr>
<tr><td>「couldn’t reach the remote magpie」</td><td>アドレス、向こうで magpie が共有オンで動いているか、ファイアウォールがポートを通すかを確認する</td></tr>
<tr><td>System One のモデルがない、または「doesn’t share its quotas」</td><td>向こうの magpie を更新し、こちらで一覧を更新する</td></tr>
</table></div>
<div class="callout"><b>外出先からは</b>、Tailscale や WireGuard などの VPN 越しに、VPN 上のアドレスで共有する magpie に届くようにしてください。ポートをインターネットに開けないでください。</div>
<p style="margin-top:48px">質問や共有したいセットアップがあれば <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> へどうぞ。詳細は<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md">リファレンス</a>(英語)にあります。</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/ja/">ホーム</a>
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a href="/docs/ja/remote">リモート magpie</a>
<a href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "コピーしました"; setTimeout(() => (b.textContent = "コピー"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/ja/start">はじめに</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a class="toc-only" href="/docs/ja/remote">リモート magpie</a>
<a class="toc-only" href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie-releases/releases">リリース</a>
@@ -284,6 +286,8 @@ IP-CIDR6,::1/128,DIRECT,no-resolve</pre>
<a href="/ja/">ホーム</a>
<a href="/docs/ja/intent">インテントルーティング</a>
<a href="/docs/ja/plugins">プラグイン</a>
<a href="/docs/ja/remote">リモート magpie</a>
<a href="/docs/ja/docker">Docker</a>
<a href="/docs/ja/import">magpie に追加</a>
<a href="/docs/integrate">アプリ連携</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a class="toc-only" href="/docs/remote">Remote magpie</a>
<a class="toc-only" href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
@@ -709,6 +711,8 @@ magpie plugin options model-map '{"mapping": {"fast": "deepseek/deepseek-chat"}}
<a href="/">Home</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a href="/docs/remote">Remote magpie</a>
<a href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+183
View File
@@ -0,0 +1,183 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Remote magpie · magpie docs</title>
<meta name="description" content="Use one magpie from several computers: share it on the network, add it on each other computer as a Remote magpie (app, TUI or CLI), and what comes over: models, routing groups, images, System One, prices and quotas.">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/remote">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/remote">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/remote">
<link rel="stylesheet" href="/docs.css">
<meta property="og:title" content="Remote magpie">
<meta property="og:description" content="One magpie&#x27;s providers, accounts and routing groups, on every computer you use.">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/remote">
<meta name="twitter:card" content="summary_large_image">
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>Docs</small></a>
<div class="links">
<a href="/">Home</a>
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a class="toc-only" href="/docs/remote">Remote magpie</a>
<a class="toc-only" href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="Language" title="Language" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/remote" hreflang="en" lang="en">English</a>
<a href="/docs/zh/remote" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/remote" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="magpie on Discord" title="Join us on Discord"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="magpie on GitHub" title="Source on GitHub"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">Download</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>Remote magpie</p>
<a href="#overview">Overview</a>
<a href="#share">1. Share the main magpie</a>
<a href="#add">2. Add it on the other computer</a>
<a href="#models">What you get</a>
<a href="#quotas">Quotas and usage</a>
<a href="#trouble">When it doesn’t work</a>
</aside>
<article>
<p class="eyebrow" id="overview">Docs · Sharing</p>
<h1>Remote magpie</h1>
<p class="lede">One magpie can serve several computers. Sign in and set up providers and routing groups once, on the computer that keeps them (your desktop, a server, a <a href="/docs/docker">NAS in Docker</a>), and on every other computer add that magpie as a provider of its own: a <b>Remote magpie</b>.</p>
<div class="table-wrap"><table>
<tr><th></th><th>The shared magpie</th><th>Each other computer’s magpie</th></tr>
<tr><td>Providers, subscriptions, keys</td><td>kept and signed in here</td><td>uses them through the Remote magpie</td></tr>
<tr><td>Routing groups</td><td>made here</td><td>picked as <code>office/group/…</code></td></tr>
<tr><td>Agents</td><td>its own</td><td>still wired by this computer’s magpie</td></tr>
<tr><td>Usage and quotas</td><td>counted and read here</td><td>shown here, named with the remote</td></tr>
</table></div>
<p>The computer you sit at still runs magpie: it wires that computer’s agents, picks their models and keeps their sessions. Only the models come from the other one.</p>
<h2 id="share"><a class="anchor" href="#share">1. Share the main magpie</a></h2>
<ol class="steps">
<li><b>Turn on sharing</b>On the computer that keeps your providers: <span class="ui">Settings</span> → <span class="ui">Share on local network</span> → <span class="ui">On</span>. magpie then listens on the local network and makes a gateway key named <span class="ui">Magpie</span>. The <span class="ui">Address</span> row below the switch shows where other computers reach it, such as <code>http://192.168.1.20:3425</code>.</li>
<li><b>Make a key for each computer</b><span class="ui">Gateway</span> → <span class="ui">Gateway keys</span>, or <code>magpie gateway-key add "Laptop"</code>, which prints its <code>sk-magpie-key-…</code>. Each key can have its own daily, weekly or monthly limit and its own models, and its calls are counted under its name.</li>
</ol>
<p>While sharing is off, a desktop magpie listens on its own computer only, and other computers can’t reach it. A magpie in Docker is reached through its published port instead, and needs the same switch turned on before it asks for keys; see <a href="/docs/docker#share">Docker</a>.</p>
<h2 id="add"><a class="anchor" href="#add">2. Add it on the other computer</a></h2>
<p>You need the address and a key from step 1. Any of these does it:</p>
<ul>
<li><b>The app:</b> on the <span class="ui">Providers</span> tab press <span class="ui">+ Add provider</span>, pick <span class="ui">Remote magpie</span>, then give its address and the key.</li>
<li><b>The TUI</b> (<code>magpie tui</code>): on the Providers page press <code>a</code>, pick Remote magpie, then type its address and key. On its row, <code>w</code> changes the address and <code>m</code> fetches its list again.</li>
<li><b>The CLI:</b></li>
</ul>
<div class="code">
<span class="lang">Shell</span>
<button class="copy" data-copy="ex-add">Copy</button>
<pre id="ex-add">magpie provider add remote-magpie sk-magpie-key-… url=http://192.168.1.20:3425 id=office
magpie models <span class="c"># office/… are the shared magpie's</span>
magpie provider refresh office <span class="c"># fetch its list again</span></pre>
</div>
<p><code>id=</code> names the provider here, and so begins its models’ ids (<code>office/…</code>). The address can be typed as <code>192.168.1.20:3425</code> (plain <code>http://</code> is assumed), with <code>/v1</code> after it, or as the root: magpie puts every API on it either way. Add one Remote magpie for each computer you share from, with a different id.</p>
<h2 id="models"><a class="anchor" href="#models">What you get</a></h2>
<ul>
<li><b>Its models</b>, as its own agents are shown them: <code>office/relay-a/claude-sonnet-5</code>, labelled <code>Claude Sonnet 5 · Relay A · office</code>. The ids stay ids; only the labels carry the names. Pick them for an agent here like any other model.</li>
<li><b>Its routing groups</b>, as <code>office/group/…</code>. The group decides on the shared magpie, with its accounts.</li>
<li><b>Every API.</b> A request goes on in the API the agent spoke (Anthropic Messages and token counting, Responses, Chat Completions). A model that the shared magpie’s provider serves on another API only is turned into that API once, never on both computers. Responses go over HTTP, SSE included, not WebSocket.</li>
<li><b>Images and video.</b> Its image and video models are found by themselves and served through its image generation and edit, and video, APIs.</li>
<li><b>System One.</b> Its decision models (Jev, Clef, and models with names of your own) are set up at its <code>/v1/systemone</code> and appear as decision models, not chat models. Refresh the provider’s list to find new ones. A bare <code>office</code> asks the first decision model listed.</li>
<li><b>Embeddings and rerank</b> go to its matching APIs. They stay in agents’ lists as they are on the remote; being listed doesn’t make them able to hold a conversation.</li>
<li><b>Prices.</b> Each model costs here what the shared magpie counts it at (a price set there by hand, else its provider’s list price), so the two computers count the same. A price you set here comes first.</li>
</ul>
<h2 id="quotas"><a class="anchor" href="#quotas">Quotas and usage</a></h2>
<p>The Usage page, the menu bar and <code>magpie quota</code> show the shared magpie’s subscription cards, named with it (<code>Codex · office</code>, id <code>office/codex</code>), as that magpie last read them: only the computer with the sign-ins asks the vendors. A card’s refresh here has it read that card once more, at most once every 30 seconds. A Codex reset or a WorkBuddy check-in is pressed on that computer, from its own app, TUI or CLI.</p>
<p>The shared magpie counts this computer’s requests under the name of the gateway key it sends, with the account that answered.</p>
<h2 id="trouble"><a class="anchor" href="#trouble">When it doesn’t work</a></h2>
<div class="table-wrap"><table>
<tr><th>You see</th><th>What to do</th></tr>
<tr><td>“magpie isn’t shared on the local network”, or “remote magpie isn’t shared”</td><td>turn on <span class="ui">Share on local network</span> on that computer</td></tr>
<tr><td>“remote magpie didn’t take this key” (401)</td><td>use one of its enabled gateway keys: <span class="ui">Gateway</span> → <span class="ui">Gateway keys</span> there</td></tr>
<tr><td>403 for a model</td><td>that key may use only some models: <code>magpie gateway-key models &lt;id&gt;</code> on that computer shows or changes them. A bare <code>office</code> asks System One’s first decision model, whatever the key allows; use the full <code>office/provider/model</code> id</td></tr>
<tr><td>“couldn’t reach the remote magpie”</td><td>check the address, that magpie is running there with sharing on, and that its firewall lets the port in</td></tr>
<tr><td>no System One models, or “doesn’t share its quotas”</td><td>update magpie on that computer, then refresh the list here</td></tr>
</table></div>
<div class="callout"><b>Away from home</b>, reach the shared magpie over a VPN such as Tailscale or WireGuard, with its address there. Don’t open its port to the internet.</div>
<p style="margin-top:48px">Questions or a setup worth sharing? Ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a>. The <a href="https://github.com/yetone/magpie/blob/main/docs/reference.md">reference</a> has the details.</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/">Home</a>
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a href="/docs/remote">Remote magpie</a>
<a href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "Copied"; setTimeout(() => (b.textContent = "Copy"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/start">Get started</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a class="toc-only" href="/docs/remote">Remote magpie</a>
<a class="toc-only" href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie-releases/releases">Releases</a>
@@ -284,6 +286,8 @@ IP-CIDR6,::1/128,DIRECT,no-resolve</pre>
<a href="/">Home</a>
<a href="/docs/intent">Intent routing</a>
<a href="/docs/plugins">Plugins</a>
<a href="/docs/remote">Remote magpie</a>
<a href="/docs/docker">Docker</a>
<a href="/docs/import">Add to magpie</a>
<a href="/docs/integrate">Integrate</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+236
View File
@@ -0,0 +1,236 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Docker · magpie 文档</title>
<meta name="description" content="在服务器或 NAS 上用 Docker 运行 magpie:ghcr.io/yetone/magpie 镜像的端口、数据卷和环境变量,Web 界面,登录订阅,用网关密钥共享网关,以及 Compose 示例。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/docker">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/docker">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/docker">
<link rel="stylesheet" href="/docs.css">
<meta property="og:title" content="在 Docker 里运行 magpie">
<meta property="og:description" content="在服务器或 NAS 上运行 magpie 的网关,在浏览器里管理它。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/zh/docker">
<meta name="twitter:card" content="summary_large_image">
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/zh/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>文档</small></a>
<div class="links">
<a href="/zh/">首页</a>
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a class="toc-only" href="/docs/zh/remote">远程 magpie</a>
<a class="toc-only" href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="语言" title="语言" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/docker" hreflang="en" lang="en">English</a>
<a href="/docs/zh/docker" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/docker" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="magpie on Discord" title="Join us on Discord"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="magpie on GitHub" title="Source on GitHub"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">下载</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>Docker</p>
<a href="#overview">概览</a>
<a href="#run">运行</a>
<a href="#web">Web 界面</a>
<a href="#signin">登录订阅</a>
<a href="#volume">保存了什么</a>
<a href="#env">环境变量</a>
<a href="#share">给其他机器共享</a>
<a href="#compose">在 NAS 上用 Docker Compose</a>
<a href="#ops">健康检查、终端与更新</a>
</aside>
<article>
<p class="eyebrow" id="overview">文档 · 服务器</p>
<h1>在 Docker 里运行 magpie</h1>
<p class="lede">在没有桌面的服务器或 NAS 上运行 magpie:它的网关为其他电脑上的 Agent 提供模型,供应商的添加和订阅登录都在浏览器页面里完成。</p>
<div class="table-wrap"><table>
<tr><td><b>镜像</b></td><td><code>ghcr.io/yetone/magpie</code>,支持 <code>linux/amd64</code> 和 <code>linux/arm64</code></td></tr>
<tr><td><b>标签</b></td><td><code>latest</code>(最新正式版)、<code>0.1.1150</code>(某个版本)、<code>0.1</code>、<code>edge</code>(<code>main</code> 上的每次改动)</td></tr>
<tr><td><b>端口</b></td><td><code>3425</code> 是 Agent 调用的网关;<code>3430</code> 是容器运行 <code>magpie web</code> 时的 Web 界面</td></tr>
<tr><td><b>数据卷</b></td><td><code>/config</code>:供应商、密钥、登录、插件和用量</td></tr>
<tr><td><b>用户</b></td><td>nonroot(uid 65532)</td></tr>
</table></div>
<p>镜像里是 magpie 的纯终端版本,基于 distroless,并带了 bash 和 busybox,方便在容器里开终端。不指定命令时运行 <code>magpie serve</code>(只有网关)。容器里找不到需要配置的 Agent,所以这里的 magpie 是一个网关:用它的 Agent 运行在别的机器上。</p>
<h2 id="run"><a class="anchor" href="#run">运行</a></h2>
<p>带 Web 界面运行,给页面一个重启后不变的 key,两个端口都只发布在宿主机的回环地址上:</p>
<div class="code">
<span class="lang">Shell</span>
<button class="copy" data-copy="ex-run">复制</button>
<pre id="ex-run">docker run -d --name magpie --restart unless-stopped \
-p 127.0.0.1:3425:3425 -p 127.0.0.1:3430:3430 \
-e MAGPIE_WEB_KEY=$(openssl rand -hex 16) \
-v magpie-config:/config \
ghcr.io/yetone/magpie:latest web --addr 0.0.0.0:3430 --no-open
docker logs magpie</pre>
</div>
<p>日志里给出带 key 的页面地址:</p>
<div class="code">
<span class="lang">输出</span>
<pre>● magpie web on http://127.0.0.1:3430/?k=0f3c9a1e…
on the network http://172.17.0.2:3430/?k=0f3c9a1e…
these are the container's own addresses: other machines use the host's, and MAGPIE_PUBLIC_URL=http://&lt;host&gt;:&lt;port&gt; puts it here
! anyone with the link can change magpie and see its keys, and the network carries it unencrypted
the link carries MAGPIE_WEB_KEY · gateway http://127.0.0.1:3425 · Ctrl-C to stop</pre>
</div>
<div class="callout"><b>端口先留在 127.0.0.1 上。</b>在<a href="#share">打开共享</a>之前,Docker 里的网关对任何能访问到它的人、任何 key(包括 <code>Bearer magpie</code>)都会应答。<code>-p 3425:3425</code> 会把它发布到宿主机的所有网卡上,绕过宿主机防火墙。等共享打开、有了网关密钥之后再往外发布。</div>
<p>不加 <code>web --addr 0.0.0.0:3430 --no-open</code> 时容器只跑网关,需要在容器终端里配置(<code>docker exec -it magpie magpie provider add …</code>)。也可以把一个目录绑定挂载到 <code>/config</code> 来代替命名卷,前提是 uid 65532 能写它:<code>sudo chown -R 65532:65532 /volume1/docker/magpie/config</code>。</p>
<h2 id="web"><a class="anchor" href="#web">Web 界面</a></h2>
<p>打开日志里的链接。链接里的 key 会换成一个 cookie,并从地址栏里去掉;不带 key 打开会被拒绝(401)。设置了 <code>MAGPIE_WEB_KEY</code>(16 个以上的字母、数字或 <code>- . _ ~</code>;<code>openssl rand -hex 16</code> 可以生成一个)时,重启后 key 不变,浏览器保持登录 400 天。不设置时每次启动都会生成新 key,cookie 只在本次浏览器会话里有效。</p>
<p>这个页面处于<b>网关模式</b>:只有 <span class="ui">供应商</span>、<span class="ui">网关</span>、<span class="ui">路由</span>、<span class="ui">用量</span>、<span class="ui">插件</span>和 <span class="ui">设置</span>,没有 Agent、会话和资源库,因为容器里没有 Agent。<span class="ui">设置</span> → <span class="ui">常规</span> → <span class="ui">网关模式</span> 可以关掉它。</p>
<p>NAS 或通过 SSH 访问的服务器上,用隧道打开页面,不要发布 3430:<code>ssh -L 3430:127.0.0.1:3430 you@nas</code>,然后在自己电脑上打开日志里的链接。</p>
<div class="callout"><b>拿到链接的人都能修改 magpie、看到它的密钥。</b>页面本身没有 HTTPS。让 3430 只在回环地址或 VPN 上,或者放在带 TLS 的反向代理后面。</div>
<h2 id="signin"><a class="anchor" href="#signin">登录订阅</a></h2>
<p>在 <span class="ui">供应商</span> 里添加 API key,和桌面版一样。订阅登录(ChatGPT、Claude……)会在你的浏览器里打开厂商页面,完成后厂商把浏览器跳回 <code>localhost</code>,ChatGPT 是 <code>http://localhost:1455/auth/callback?code=…</code>。那是你自己的电脑,不是容器,所以页面打不开。把地址栏里的完整地址复制下来,粘贴到登录的 <span class="ui">回调 URL</span> 一栏。</p>
<p>在终端里也可以:</p>
<div class="code">
<span class="lang">Shell</span>
<button class="copy" data-copy="ex-signin">复制</button>
<pre id="ex-signin">docker exec -it magpie magpie accounts add codex</pre>
</div>
<p>打开它打印的链接并登录,再把浏览器最后停在的地址粘贴回去。Web 界面也能从文件导入登录。</p>
<h2 id="volume"><a class="anchor" href="#volume">保存了什么</a></h2>
<p>magpie 写的所有东西都在 <code>/config</code> 下,所以重启、或者在同一个数据卷上新建容器,供应商、密钥、登录和插件都还在。</p>
<div class="table-wrap"><table>
<tr><th>路径</th><th>内容</th></tr>
<tr><td><code>/config/magpie</code></td><td>magpie 自己的文件:<code>settings.json</code>、供应商、网关密钥、路由组</td></tr>
<tr><td><code>/config/home</code></td><td>容器的 <code>HOME</code>:登录保存在对应 Agent 保存的位置(<code>~/.codex</code>、<code>~/.claude</code>……)</td></tr>
<tr><td><code>/config/cache</code></td><td>模型目录,以及插件运行用的 Bun(第一次用插件时下载)</td></tr>
<tr><td><code>/config/data</code>、<code>/config/state</code></td><td>magpie 保存的其他内容</td></tr>
</table></div>
<p>旧镜像创建的数据卷照样能用:magpie 启动时会补上缺的目录。只有用旧镜像做的登录(当时存在数据卷之外)需要重新登录。</p>
<h2 id="env"><a class="anchor" href="#env">环境变量</a></h2>
<div class="table-wrap"><table>
<tr><th>变量</th><th>作用</th></tr>
<tr><td><code>MAGPIE_ADDR</code></td><td>网关监听的地址。镜像里设为 <code>0.0.0.0:3425</code>,发布的端口才能访问到它。</td></tr>
<tr><td><code>MAGPIE_PUBLIC_URL</code></td><td>其他机器访问网关用的地址,例如 <code>http://192.168.1.20:3425</code>(宿主机或 NAS 的地址,加发布的端口),或反向代理的 base URL。容器里 magpie 只看得到 Docker 自己的 <code>172.17.x</code> 地址;设置后,它显示和打印的就是该用的地址。</td></tr>
<tr><td><code>MAGPIE_WEB_KEY</code></td><td>Web 界面的 key,重启后不变(16 个字符以上)</td></tr>
<tr><td><code>HOME</code>、<code>XDG_CONFIG_HOME</code>、<code>XDG_CACHE_HOME</code>、<code>XDG_DATA_HOME</code>、<code>XDG_STATE_HOME</code></td><td>镜像已设为上面 <code>/config</code> 下的目录,不要改</td></tr>
</table></div>
<h2 id="share"><a class="anchor" href="#share">给其他机器共享</a></h2>
<ol class="steps">
<li><b>打开共享</b>在 Web 界面里:<span class="ui">设置</span> → <span class="ui">局域网共享</span> → <span class="ui">开启</span>。同时会生成一个名为 <span class="ui">Magpie</span> 的网关密钥。此后容器外的每个请求都必须带一个启用的网关密钥,不带的返回 401。不用界面的话,在 <code>/config/magpie/settings.json</code> 里写 <code>"lan": true</code>。</li>
<li><b>给每个客户端一个密钥</b><span class="ui">网关</span> → <span class="ui">网关密钥</span>,或在终端里 <code>docker exec magpie magpie gateway-key add "Laptop"</code>,它会打印新的 <code>sk-magpie-key-…</code>。每个密钥可以有自己的每日、每周或每月上限和可用模型(<code>magpie gateway-key limit</code>、<code>magpie gateway-key models</code>)。</li>
<li><b>发布端口</b>用 <code>-p 3425:3425</code>(或绑定到 NAS 的局域网或 VPN 地址,<code>-p 192.168.1.20:3425:3425</code>)并加上 <code>-e MAGPIE_PUBLIC_URL=http://192.168.1.20:3425</code> 重新创建容器。</li>
</ol>
<p>在其他电脑上,把 Agent 指向这个网关,用其中一个密钥作为 API key:OpenAI 客户端用 <code>http://192.168.1.20:3425/v1</code>,Anthropic 或 Gemini 客户端用 <code>http://192.168.1.20:3425</code>。模型 id 是 <code>provider/model</code> 或路由组的名字,<code>GET /v1/models</code> 会列出它们。如果那台电脑自己也运行 magpie,就把容器添加为<a href="/docs/zh/remote">远程 magpie</a>,由 magpie 替你配置 Agent。</p>
<div class="callout"><b>跨互联网访问时,优先用 VPN</b>(如 Tailscale 或 WireGuard),不要直接开放 3425。容器前面的反向代理或隧道也算网络:先打开共享,这样它的客户端才必须带网关密钥。</div>
<h2 id="compose"><a class="anchor" href="#compose">在 NAS 上用 Docker Compose</a></h2>
<div class="code">
<span class="lang">compose.yaml</span>
<button class="copy" data-copy="ex-compose">复制</button>
<pre id="ex-compose">services:
magpie:
image: ghcr.io/yetone/magpie:latest
restart: unless-stopped
ports:
<span class="c"># 打开共享并有了网关密钥之前,只发布在回环地址上</span>
- "127.0.0.1:3425:3425"
- "127.0.0.1:3430:3430"
environment:
MAGPIE_PUBLIC_URL: http://&lt;nas-address&gt;:3425
MAGPIE_WEB_KEY: &lt;random-key&gt;
volumes:
- ./config:/config
command: [web, --addr, 0.0.0.0:3430, --no-open]</pre>
</div>
<p>然后:<code>sudo chown -R 65532:65532 ./config</code>,<code>docker compose up -d</code>,通过 SSH 隧道打开 <code>http://127.0.0.1:3430/?k=&lt;random-key&gt;</code>,添加供应商,打开 <span class="ui">局域网共享</span>,给每台机器生成一个网关密钥。再把网关那一行改成 <code>"3425:3425"</code>(或 NAS 的局域网、VPN 地址),重新 <code>docker compose up -d</code>。</p>
<h2 id="ops"><a class="anchor" href="#ops">健康检查、终端与更新</a></h2>
<ul>
<li><b>健康检查。</b>镜像带 <code>HEALTHCHECK</code>:网关能应答时 <code>magpie healthcheck</code> 返回 0,<code>serve</code> 和 <code>web</code> 都一样,所以 <code>docker ps</code> 会显示 healthy,Compose 可以用 <code>depends_on: condition: service_healthy</code> 等它。</li>
<li><b>终端。</b><code>docker exec -it magpie bash</code> 或 NAS 面板里的终端会打开一个 shell,<code>magpie</code> 在 PATH 里:<code>magpie providers</code>、<code>magpie models</code>、<code>magpie usage</code>、<code>magpie quota</code> 以及其他 <a href="https://github.com/yetone/magpie/blob/main/docs/reference.md">CLI 命令</a>。</li>
<li><b>更新。</b>拉取新镜像,在同一个数据卷上重新创建容器:<code>docker pull ghcr.io/yetone/magpie:latest</code>,然后 <code>docker rm -f magpie</code> 再执行同样的 <code>docker run</code>;或 <code>docker compose pull &amp;&amp; docker compose up -d</code>。</li>
<li><b>自己构建。</b>在<a href="https://github.com/yetone/magpie">仓库</a>的检出目录里 <code>docker build -t magpie .</code> 得到同样的镜像。</li>
</ul>
<p style="margin-top:48px">遇到问题,或者有值得分享的配置?来 <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> 聊。细节见<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#docker">参考文档</a>(英文)。</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/zh/">首页</a>
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a href="/docs/zh/remote">远程 magpie</a>
<a href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "已复制"; setTimeout(() => (b.textContent = "复制"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a class="toc-only" href="/docs/zh/remote">远程 magpie</a>
<a class="toc-only" href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
@@ -255,6 +257,8 @@ href = <span class="s">"https://usemagpie.ai/import#"</span> + urlencode({
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a href="/docs/zh/remote">远程 magpie</a>
<a href="/docs/zh/docker">Docker</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
+4
View File
@@ -45,6 +45,8 @@
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a class="toc-only" href="/docs/zh/remote">远程 magpie</a>
<a class="toc-only" href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
@@ -147,6 +149,8 @@ curl -s http://127.0.0.1:3425/v1/models -H "Authorization: Bearer magpie-acme"</
<a href="/zh/">首页</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a href="/docs/zh/remote">远程 magpie</a>
<a href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a class="toc-only" href="/docs/zh/remote">远程 magpie</a>
<a class="toc-only" href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
@@ -316,6 +318,8 @@ The number of its kind (0 for none):</pre>
<a href="/zh/">首页</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a href="/docs/zh/remote">远程 magpie</a>
<a href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a class="toc-only" href="/docs/zh/remote">远程 magpie</a>
<a class="toc-only" href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
@@ -709,6 +711,8 @@ magpie plugin options model-map '{"mapping": {"fast": "deepseek/deepseek-chat"}}
<a href="/zh/">首页</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a href="/docs/zh/remote">远程 magpie</a>
<a href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
+183
View File
@@ -0,0 +1,183 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>远程 magpie · magpie 文档</title>
<meta name="description" content="在多台电脑上用同一个 magpie:在网络上共享它,在其他电脑上把它添加为远程 magpie(应用、TUI 或 CLI),以及能用到什么:模型、路由组、图像、System One、价格和额度。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
(() => {
let mode = "system";
try { mode = localStorage.getItem("theme") || "system"; } catch {}
const q = matchMedia("(prefers-color-scheme: dark)");
const apply = () => {
const t = mode === "system" ? (q.matches ? "dark" : "light") : mode;
document.documentElement.dataset.theme = t;
document.querySelector('meta[name="theme-color"]').content = t === "dark" ? "#0b0b0c" : "#fafafa";
document.querySelectorAll("button.theme").forEach((b) => { b.dataset.mode = mode; b.title = "Theme: " + mode; });
};
q.addEventListener("change", () => mode === "system" && apply());
window.setTheme = (m) => { mode = m; try { m === "system" ? localStorage.removeItem("theme") : localStorage.setItem("theme", m); } catch {} apply(); };
window.themeMode = () => mode;
apply();
})();
</script>
<script>try{if(/Linux/.test(navigator.userAgent)&&!/Android/.test(navigator.userAgent)||localStorage.getItem("omarchy")||/[?&]omarchy=/.test(location.search))document.write('<script src="/omarchy.js"><\/script>')}catch(e){}</script>
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="/img/icon-256.png">
<link rel="alternate" hreflang="en" href="https://usemagpie.ai/docs/remote">
<link rel="alternate" hreflang="zh" href="https://usemagpie.ai/docs/zh/remote">
<link rel="alternate" hreflang="ja" href="https://usemagpie.ai/docs/ja/remote">
<link rel="stylesheet" href="/docs.css">
<meta property="og:title" content="远程 magpie">
<meta property="og:description" content="一个 magpie 的供应商、账号和路由组,用在你的每台电脑上。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/zh/remote">
<meta name="twitter:card" content="summary_large_image">
</head>
<body>
<nav><div class="wrap">
<a class="brand" href="/zh/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie <small>文档</small></a>
<div class="links">
<a href="/zh/">首页</a>
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a class="toc-only" href="/docs/zh/remote">远程 magpie</a>
<a class="toc-only" href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
</div>
<div class="langs">
<button class="icon-btn lang" type="button" aria-label="语言" title="语言" aria-haspopup="true" aria-expanded="false" aria-controls="langs"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6.25"/><path d="M1.75 8h12.5M8 1.75c1.7 1.75 2.55 3.83 2.55 6.25S9.7 12.5 8 14.25M8 1.75C6.3 3.5 5.45 5.58 5.45 8S6.3 12.5 8 14.25"/></svg></button>
<div class="lang-menu" id="langs" hidden>
<a href="/docs/remote" hreflang="en" lang="en">English</a>
<a href="/docs/zh/remote" hreflang="zh" lang="zh">中文</a>
<a href="/docs/ja/remote" hreflang="ja" lang="ja">日本語</a>
</div>
</div>
<a class="icon-btn" href="https://discord.gg/vGSnD3ZKQF" aria-label="magpie on Discord" title="Join us on Discord"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a class="icon-btn" href="https://github.com/yetone/magpie" aria-label="magpie on GitHub" title="Source on GitHub"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></a>
<button class="icon-btn theme" type="button" aria-label="Theme" title="Theme: system"><svg class="i-system" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.75" y="2.75" width="12.5" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11.25V14"/></svg><svg class="i-light" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3 3l1 1M12 12l1 1M3 13l1-1M12 4l1-1"/></svg><svg class="i-dark" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"><path d="M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z"/></svg></button>
<a class="btn small" href="/#get">下载</a>
</div></nav>
<main class="wrap doc">
<aside class="toc">
<p>远程 magpie</p>
<a href="#overview">概览</a>
<a href="#share">1. 共享主 magpie</a>
<a href="#add">2. 在其他电脑上添加</a>
<a href="#models">能用到什么</a>
<a href="#quotas">额度与用量</a>
<a href="#trouble">出问题时</a>
</aside>
<article>
<p class="eyebrow" id="overview">文档 · 共享</p>
<h1>远程 magpie</h1>
<p class="lede">一个 magpie 可以服务多台电脑。在保存供应商的那台电脑上(你的台式机、一台服务器、<a href="/docs/zh/docker">Docker 里的 NAS</a>)登录、配置一次供应商和路由组,然后在其他每台电脑上把这个 magpie 添加为一个供应商:<b>远程 magpie</b>(Remote magpie)。</p>
<div class="table-wrap"><table>
<tr><th></th><th>共享的 magpie</th><th>其他电脑上的 magpie</th></tr>
<tr><td>供应商、订阅、密钥</td><td>保存并登录在这里</td><td>通过远程 magpie 使用</td></tr>
<tr><td>路由组</td><td>在这里创建</td><td>以 <code>office/group/…</code> 选用</td></tr>
<tr><td>Agent</td><td>它自己的</td><td>仍由本机的 magpie 配置</td></tr>
<tr><td>用量与额度</td><td>在这里统计和读取</td><td>在这里显示,带上远程的名字</td></tr>
</table></div>
<p>你面前的电脑仍然运行 magpie:它配置本机的 Agent、为它们选模型、保存它们的会话。只有模型来自另一台。</p>
<h2 id="share"><a class="anchor" href="#share">1. 共享主 magpie</a></h2>
<ol class="steps">
<li><b>打开共享</b>在保存供应商的电脑上:<span class="ui">设置</span> → <span class="ui">局域网共享</span> → <span class="ui">开启</span>。magpie 随即在局域网上监听,并生成一个名为 <span class="ui">Magpie</span> 的网关密钥。开关下方的 <span class="ui">地址</span> 一行显示其他电脑访问它的地址,例如 <code>http://192.168.1.20:3425</code>。</li>
<li><b>给每台电脑一个密钥</b><span class="ui">网关</span> → <span class="ui">网关密钥</span>,或 <code>magpie gateway-key add "Laptop"</code>,它会打印 <code>sk-magpie-key-…</code>。每个密钥可以有自己的每日、每周或每月上限和可用模型,它的调用按它的名字统计。</li>
</ol>
<p>共享关闭时,桌面版 magpie 只在本机监听,其他电脑访问不到。Docker 里的 magpie 则通过发布的端口访问,同样要打开这个开关才会要求密钥;见 <a href="/docs/zh/docker#share">Docker</a>。</p>
<h2 id="add"><a class="anchor" href="#add">2. 在其他电脑上添加</a></h2>
<p>需要第 1 步里的地址和一个密钥。以下任一方式都可以:</p>
<ul>
<li><b>应用:</b>在 <span class="ui">供应商</span> 页按 <span class="ui">+ 添加供应商</span>,选 <span class="ui">Remote magpie</span>,填入地址和密钥。</li>
<li><b>TUI</b>(<code>magpie tui</code>):在 Providers 页按 <code>a</code>,选 Remote magpie,输入地址和密钥。在它那一行,<code>w</code> 修改地址,<code>m</code> 重新获取列表。</li>
<li><b>CLI:</b></li>
</ul>
<div class="code">
<span class="lang">Shell</span>
<button class="copy" data-copy="ex-add">复制</button>
<pre id="ex-add">magpie provider add remote-magpie sk-magpie-key-… url=http://192.168.1.20:3425 id=office
magpie models <span class="c"># office/… 是共享 magpie 的模型</span>
magpie provider refresh office <span class="c"># 重新获取列表</span></pre>
</div>
<p><code>id=</code> 是这个供应商在本机的名字,也是它的模型 id 的开头(<code>office/…</code>)。地址可以写成 <code>192.168.1.20:3425</code>(默认 <code>http://</code>),后面带 <code>/v1</code>,或者写根地址:magpie 都会把各个 API 接到上面。每台共享出来的电脑添加一个远程 magpie,用不同的 id。</p>
<h2 id="models"><a class="anchor" href="#models">能用到什么</a></h2>
<ul>
<li><b>它的模型</b>,和它自己的 Agent 看到的一样:<code>office/relay-a/claude-sonnet-5</code>,标签是 <code>Claude Sonnet 5 · Relay A · office</code>。id 不变,名字只出现在标签里。在本机像其他模型一样为 Agent 选用。</li>
<li><b>它的路由组</b>,以 <code>office/group/…</code> 出现。路由在共享的 magpie 上用它的账号决定。</li>
<li><b>所有 API。</b>请求按 Agent 使用的 API 原样转发(Anthropic Messages 和 token 计数、Responses、Chat Completions)。共享 magpie 的供应商只用另一种 API 提供的模型,只转换一次,不会在两台电脑上各转一次。Responses 走 HTTP(包括 SSE),不走 WebSocket。</li>
<li><b>图像和视频。</b>它的图像和视频模型会被自动识别,经由它的图像生成、编辑和视频 API 提供。</li>
<li><b>System One。</b>它的决策模型(Jev、Clef,以及你自己命名的模型)接到它的 <code>/v1/systemone</code>,作为决策模型而不是对话模型出现。刷新供应商列表可以发现新的。只写 <code>office</code> 时使用列表里的第一个决策模型。</li>
<li><b>Embeddings 和 rerank</b> 发往它对应的 API。它们在 Agent 列表里保持远程上的样子;出现在列表里并不代表能用来对话。</li>
<li><b>价格。</b>每个模型在本机按共享 magpie 的计价(那边手动设的价格,否则是供应商的标价),两台电脑算出来一样。在本机设的价格优先。</li>
</ul>
<h2 id="quotas"><a class="anchor" href="#quotas">额度与用量</a></h2>
<p>用量页、菜单栏和 <code>magpie quota</code> 会显示共享 magpie 的订阅卡片,带上它的名字(<code>Codex · office</code>,id <code>office/codex</code>),内容是那边最近一次读取的结果:只有保存登录的电脑去问厂商。在本机刷新卡片会让那边再读一次,最多每 30 秒一次。Codex 重置或 WorkBuddy 签到要在那台电脑上,用它自己的应用、TUI 或 CLI 来做。</p>
<p>共享的 magpie 把本机的请求记在本机所用网关密钥的名字下,并记下应答的账号。</p>
<h2 id="trouble"><a class="anchor" href="#trouble">出问题时</a></h2>
<div class="table-wrap"><table>
<tr><th>看到的提示</th><th>怎么做</th></tr>
<tr><td>“magpie isn’t shared on the local network” 或 “remote magpie isn’t shared”</td><td>在那台电脑上打开 <span class="ui">局域网共享</span></td></tr>
<tr><td>“remote magpie didn’t take this key”(401)</td><td>用它的一个已启用的网关密钥:那边的 <span class="ui">网关</span> → <span class="ui">网关密钥</span></td></tr>
<tr><td>某个模型 403</td><td>这个密钥可能只能用部分模型:在那台电脑上用 <code>magpie gateway-key models &lt;id&gt;</code> 查看或修改。只写 <code>office</code> 会请求 System One 的第一个决策模型,不管密钥允许什么;请用完整的 <code>office/provider/model</code> id</td></tr>
<tr><td>“couldn’t reach the remote magpie”</td><td>检查地址、那边的 magpie 是否在运行并打开了共享、防火墙是否放行该端口</td></tr>
<tr><td>没有 System One 模型,或 “doesn’t share its quotas”</td><td>更新那台电脑上的 magpie,再在本机刷新列表</td></tr>
</table></div>
<div class="callout"><b>不在家时</b>,通过 Tailscale 或 WireGuard 等 VPN、用它在 VPN 里的地址访问共享的 magpie。不要把它的端口开放到互联网。</div>
<p style="margin-top:48px">遇到问题,或者有值得分享的配置?来 <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> 聊。细节见<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md">参考文档</a>(英文)。</p>
</article>
</main>
<footer><div class="wrap">
<span>© 2026 magpie · MIT</span>
<div class="links">
<a href="/zh/">首页</a>
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a href="/docs/zh/remote">远程 magpie</a>
<a href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie">GitHub</a>
<a href="https://discord.gg/vGSnD3ZKQF">Discord</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
</div>
</div></footer>
<script>
(() => {
const next = { system: "light", light: "dark", dark: "system" };
document.querySelectorAll("button.theme").forEach((b) => {
b.dataset.mode = themeMode();
b.title = "Theme: " + themeMode();
b.addEventListener("click", () => setTheme(next[themeMode()]));
});
document.querySelectorAll(".copy").forEach((b) => b.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(document.getElementById(b.dataset.copy).textContent);
b.textContent = "已复制"; setTimeout(() => (b.textContent = "复制"), 1400);
} catch {}
}));
})();
</script>
<script src="/docs.js"></script>
</body>
</html>
+4
View File
@@ -46,6 +46,8 @@
<a href="/docs/zh/start">快速上手</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a class="toc-only" href="/docs/zh/remote">远程 magpie</a>
<a class="toc-only" href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie-releases/releases">版本发布</a>
@@ -284,6 +286,8 @@ IP-CIDR6,::1/128,DIRECT,no-resolve</pre>
<a href="/zh/">首页</a>
<a href="/docs/zh/intent">意图路由</a>
<a href="/docs/zh/plugins">插件开发</a>
<a href="/docs/zh/remote">远程 magpie</a>
<a href="/docs/zh/docker">Docker</a>
<a href="/docs/zh/import">Add to magpie</a>
<a href="/docs/zh/integrate">接入应用</a>
<a href="https://github.com/yetone/magpie">GitHub</a>