{"_id":"@anyforge/control","_rev":"8-ccb2f489d75a8bf37ba0ba66a21d57ca","name":"@anyforge/control","dist-tags":{"beta":"0.1.0-beta.0","latest":"0.3.0"},"versions":{"0.1.0-beta.0":{"name":"@anyforge/control","version":"0.1.0-beta.0","license":"Apache-2.0","_id":"@anyforge/control@0.1.0-beta.0","maintainers":[{"name":"erpoot","email":"edwin@pootonline.com"}],"homepage":"https://anyforge.ai","bugs":{"url":"https://github.com/pootonline/sovereign-engineering/issues"},"bin":{"anyforge":"dist/cli.js"},"dist":{"shasum":"3ecd286c45a87bdd70c71df71c4d5e5ee89fc6c9","tarball":"https://registry.npmjs.org/@anyforge/control/-/control-0.1.0-beta.0.tgz","fileCount":10,"integrity":"sha512-ClZEM169zy/c/ts9zZv6fIvXrv5edTXS3bY2rWLjzTAM+Wg1Lq3ZyWEmDcRGK+CQl5PBc+8UVHH9CUtIEX7nmg==","signatures":[{"sig":"MEYCIQCOSGCNOkU818iOMcMrceG5Z97s12inuBB4HGJ4YE4h3wIhALYsNakD7Gl74mk8APnJreEFDHcRvQ2fdX2Tj8a1WlYf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27472},"main":"dist/cli.js","type":"module","engines":{"node":">=18"},"gitHead":"063508b20ab8f01051719a8846c2de9002956595","scripts":{"dev":"tsx src/cli.ts","build":"tsc && chmod +x dist/cli.js","publish:beta":"npm publish --access public --tag beta","prepublishOnly":"npm run build","publish:stable":"npm publish --access public"},"_npmUser":{"name":"erpoot","email":"edwin@pootonline.com"},"repository":{"url":"git+https://github.com/pootonline/sovereign-engineering.git","type":"git","directory":"packages/control/cli"},"_npmVersion":"11.12.1","description":"AnyForge Control CLI — governed LLM proxy for Claude Code, Cursor, Cline, and any agent that talks to OpenAI- or Anthropic-shape APIs.","directories":{},"_nodeVersion":"25.9.0","dependencies":{"open":"^10.0.0","kleur":"^4.1.5","prompts":"^2.4.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.3","@types/node":"^20.11.0","@types/prompts":"^2.4.9"},"_npmOperationalInternal":{"tmp":"tmp/control_0.1.0-beta.0_1777666887103_0.12166912962954379","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@anyforge/control","version":"0.1.0","license":"Apache-2.0","_id":"@anyforge/control@0.1.0","maintainers":[{"name":"erpoot","email":"edwin@pootonline.com"}],"homepage":"https://anyforge.ai","bugs":{"url":"https://github.com/pootonline/sovereign-engineering/issues"},"bin":{"control":"dist/cli.js","anyforge":"dist/cli.js"},"dist":{"shasum":"aec1064ec5a62ec6a1e56bd061f31bc3f1a5fd19","tarball":"https://registry.npmjs.org/@anyforge/control/-/control-0.1.0.tgz","fileCount":10,"integrity":"sha512-K88txAR8cdm0rjus1j5/jBquv4nVwYD+wRIAIMt4dptNwcbytZ8eFk0V7rdvXpQhkFG78b8wfzJKJ+1FmHVDUQ==","signatures":[{"sig":"MEYCIQCoOOqw/lSUBUMmAeHRssJuKAqXjQ3f8U/C0UvYHS9JmwIhANA0wxiP6PEFMKrrM4Cet36bZieiKQ/TrBO19/bHraE+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27495},"main":"dist/cli.js","type":"module","engines":{"node":">=18"},"gitHead":"a8e968a00224441a14702660b90ccdaf4580a134","scripts":{"dev":"tsx src/cli.ts","build":"tsc && chmod +x dist/cli.js","publish:beta":"npm publish --access public --tag beta","prepublishOnly":"npm run build","publish:stable":"npm publish --access public"},"_npmUser":{"name":"erpoot","email":"edwin@pootonline.com"},"repository":{"url":"git+https://github.com/pootonline/sovereign-engineering.git","type":"git","directory":"packages/control/cli"},"_npmVersion":"11.12.1","description":"AnyForge Control CLI — governed LLM proxy for Claude Code, Cursor, Cline, and any agent that talks to OpenAI- or Anthropic-shape APIs.","directories":{},"_nodeVersion":"25.9.0","dependencies":{"open":"^10.0.0","kleur":"^4.1.5","prompts":"^2.4.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.3","@types/node":"^20.11.0","@types/prompts":"^2.4.9"},"_npmOperationalInternal":{"tmp":"tmp/control_0.1.0_1777667317059_0.6136886553999117","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@anyforge/control","version":"0.2.0","license":"Apache-2.0","_id":"@anyforge/control@0.2.0","maintainers":[{"name":"erpoot","email":"edwin@pootonline.com"}],"homepage":"https://anyforge.ai","bugs":{"url":"https://github.com/pootonline/sovereign-engineering/issues"},"bin":{"control":"dist/cli.js","anyforge":"dist/cli.js"},"dist":{"shasum":"eb9058c9b39a303b997136709b5b18eda2a2e22e","tarball":"https://registry.npmjs.org/@anyforge/control/-/control-0.2.0.tgz","fileCount":10,"integrity":"sha512-BKsGzFRThsAgm8+x3+4otEfCWyfVgg8S7ff+7XKkqed5FFwV+cutAP2hVB8+zBDNmy8F05RHyjxFsZIsn9L2fA==","signatures":[{"sig":"MEUCIF0vWBYfxqunr6mj5z5fMRTd9lYmaxou16eCD5LZ4TcMAiEA5QdZqs8jZItyWVg3FNlYjEm3lgD8IGV7hLFNGNj1GHo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32952},"main":"dist/cli.js","type":"module","engines":{"node":">=18"},"gitHead":"87475af60251a99afce6c6c26aaf6aed4fc83572","scripts":{"dev":"tsx src/cli.ts","build":"tsc && chmod +x dist/cli.js","publish:beta":"npm publish --access public --tag beta","prepublishOnly":"npm run build","publish:stable":"npm publish --access public"},"_npmUser":{"name":"erpoot","email":"edwin@pootonline.com"},"repository":{"url":"git+https://github.com/pootonline/sovereign-engineering.git","type":"git","directory":"packages/control/cli"},"_npmVersion":"11.12.1","description":"AnyForge Control CLI — governed LLM proxy for Claude Code, Cursor, Cline, and any agent that talks to OpenAI- or Anthropic-shape APIs.","directories":{},"_nodeVersion":"25.9.0","dependencies":{"open":"^10.0.0","kleur":"^4.1.5","prompts":"^2.4.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.3","@types/node":"^20.11.0","@types/prompts":"^2.4.9"},"_npmOperationalInternal":{"tmp":"tmp/control_0.2.0_1777819083174_0.9325506455525945","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@anyforge/control","version":"0.2.1","license":"Apache-2.0","_id":"@anyforge/control@0.2.1","maintainers":[{"name":"erpoot","email":"edwin@pootonline.com"}],"homepage":"https://anyforge.ai","bugs":{"url":"https://github.com/pootonline/sovereign-engineering/issues"},"bin":{"control":"dist/cli.js","anyforge":"dist/cli.js"},"dist":{"shasum":"402941f36920e0876ef2a9927452a459f8498f73","tarball":"https://registry.npmjs.org/@anyforge/control/-/control-0.2.1.tgz","fileCount":10,"integrity":"sha512-5bYR981oJuX09SvtM17eYI5eTAMKD6ifzG5JH/w4wfreLALJQrGG19541P6BcsCmlq+H3V++P3ibQZpM9lDdtg==","signatures":[{"sig":"MEUCICjhBRNjmPyeefFp0Z8AUs/pr//Gi4lZYoKJGJQftVVYAiEAq6I2vw3eLEgdP6rR4/8MDSPytbjYaYvPKrudYCkAcP0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33977},"main":"dist/cli.js","type":"module","engines":{"node":">=18"},"gitHead":"87475af60251a99afce6c6c26aaf6aed4fc83572","scripts":{"dev":"tsx src/cli.ts","build":"tsc && chmod +x dist/cli.js","publish:beta":"npm publish --access public --tag beta","prepublishOnly":"npm run build","publish:stable":"npm publish --access public"},"_npmUser":{"name":"erpoot","email":"edwin@pootonline.com"},"repository":{"url":"git+https://github.com/pootonline/sovereign-engineering.git","type":"git","directory":"packages/control/cli"},"_npmVersion":"11.12.1","description":"AnyForge Control CLI — governed LLM proxy for Claude Code, Cursor, Cline, and any agent that talks to OpenAI- or Anthropic-shape APIs.","directories":{},"_nodeVersion":"25.9.0","dependencies":{"open":"^10.0.0","kleur":"^4.1.5","prompts":"^2.4.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.3","@types/node":"^20.11.0","@types/prompts":"^2.4.9"},"_npmOperationalInternal":{"tmp":"tmp/control_0.2.1_1777819596436_0.47342100918101204","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@anyforge/control","version":"0.2.2","license":"Apache-2.0","_id":"@anyforge/control@0.2.2","maintainers":[{"name":"erpoot","email":"edwin@pootonline.com"}],"homepage":"https://anyforge.ai","bugs":{"url":"https://github.com/pootonline/sovereign-engineering/issues"},"bin":{"control":"dist/cli.js","anyforge":"dist/cli.js"},"dist":{"shasum":"8387481eea25405a688a549db132c55460cb1f08","tarball":"https://registry.npmjs.org/@anyforge/control/-/control-0.2.2.tgz","fileCount":10,"integrity":"sha512-cjeANuyD39SRHg4pFRNTglrHizc3dVh6+gCIHiBD1d3VmZmovNfnbetPFoMegPUHIK+7cgtpzKMZFVoqBnrt1g==","signatures":[{"sig":"MEYCIQDToagnQ4ydrRXu8gXdi5Tnr9a0aazyQHTEfc0icy87gQIhALsG244jV3Nzeal7BIh4LYQA89Krfow6wsJ188NvpoOi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35747},"main":"dist/cli.js","type":"module","engines":{"node":">=18"},"gitHead":"77de61f2b3fa368f1094576249857d65cb1b952c","scripts":{"dev":"tsx src/cli.ts","build":"tsc && chmod +x dist/cli.js","publish:beta":"npm publish --access public --tag beta","prepublishOnly":"npm run build","publish:stable":"npm publish --access public"},"_npmUser":{"name":"erpoot","email":"edwin@pootonline.com"},"repository":{"url":"git+https://github.com/pootonline/sovereign-engineering.git","type":"git","directory":"packages/control/cli"},"_npmVersion":"11.12.1","description":"AnyForge Control CLI — governed LLM proxy for Claude Code, Cursor, Cline, and any agent that talks to OpenAI- or Anthropic-shape APIs.","directories":{},"_nodeVersion":"25.9.0","dependencies":{"open":"^10.0.0","kleur":"^4.1.5","prompts":"^2.4.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.3","@types/node":"^20.11.0","@types/prompts":"^2.4.9"},"_npmOperationalInternal":{"tmp":"tmp/control_0.2.2_1777821471998_0.034128637308981746","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@anyforge/control","version":"0.2.3","license":"Apache-2.0","_id":"@anyforge/control@0.2.3","maintainers":[{"name":"erpoot","email":"edwin@pootonline.com"}],"homepage":"https://anyforge.ai","bugs":{"url":"https://github.com/pootonline/sovereign-engineering/issues"},"bin":{"control":"dist/cli.js","anyforge":"dist/cli.js"},"dist":{"shasum":"a9496c693b8158b01a13df865a2ec55a2e28f0e9","tarball":"https://registry.npmjs.org/@anyforge/control/-/control-0.2.3.tgz","fileCount":10,"integrity":"sha512-ZcqGYRBq9CYaH55+iRxnNSwA77qhiMt3bm0Xcy1c5mmK6x01dL1LdPn9QyC85aooWu851SbiV5QXoacsezmu7w==","signatures":[{"sig":"MEUCIH+O/6gVOhbVmHuFIwMoQTxbYMuo9sWGOAXVEdts75oCAiEA28buROEep7dJrbZMGm/N9fCguCGTSXtDTSSLcoueD6E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37393},"main":"dist/cli.js","type":"module","engines":{"node":">=18"},"gitHead":"1145f9af3d8ae8bb1eccf6233db20a95ab2037d1","scripts":{"dev":"tsx src/cli.ts","build":"tsc && chmod +x dist/cli.js","publish:beta":"npm publish --access public --tag beta","prepublishOnly":"npm run build","publish:stable":"npm publish --access public"},"_npmUser":{"name":"erpoot","email":"edwin@pootonline.com"},"repository":{"url":"git+https://github.com/pootonline/sovereign-engineering.git","type":"git","directory":"packages/control/cli"},"_npmVersion":"10.8.2","description":"AnyForge Control CLI — governed LLM proxy for Claude Code, Cursor, Cline, and any agent that talks to OpenAI- or Anthropic-shape APIs.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"open":"^10.0.0","kleur":"^4.1.5","prompts":"^2.4.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.3","@types/node":"^20.11.0","@types/prompts":"^2.4.9"},"_npmOperationalInternal":{"tmp":"tmp/control_0.2.3_1777831652568_0.5439024515445066","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@anyforge/control","version":"0.2.4","license":"Apache-2.0","_id":"@anyforge/control@0.2.4","maintainers":[{"name":"erpoot","email":"edwin@pootonline.com"}],"homepage":"https://anyforge.ai","bugs":{"url":"https://github.com/pootonline/sovereign-engineering/issues"},"bin":{"control":"dist/cli.js","anyforge":"dist/cli.js"},"dist":{"shasum":"050d800d8d9f8a0cac93e407d78a8c056e1c681a","tarball":"https://registry.npmjs.org/@anyforge/control/-/control-0.2.4.tgz","fileCount":10,"integrity":"sha512-uS5gARXK2DDi1s2fofxols50NYeYAK6hWRvvvEd9kit9ppJirX8O9oyxeoxnu3J25JTEz0L+/39DatSwjD/lcQ==","signatures":[{"sig":"MEYCIQDMxLY36Yruc0E0ORrsx/osxbxThIGmNq+UiXcyq/EQAAIhALJO2fRKMSp9CHMBNRmvwSLFDspHztHj6tm6jnSkQlMf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56034},"main":"dist/cli.js","type":"module","engines":{"node":">=18"},"gitHead":"2639125404f63d237bfdf6fbf9f8ebf69333e98d","scripts":{"dev":"tsx src/cli.ts","build":"tsc && chmod +x dist/cli.js","publish:beta":"npm publish --access public --tag beta","prepublishOnly":"npm run build","publish:stable":"npm publish --access public"},"_npmUser":{"name":"erpoot","email":"edwin@pootonline.com"},"repository":{"url":"git+https://github.com/pootonline/sovereign-engineering.git","type":"git","directory":"packages/control/cli"},"_npmVersion":"10.8.2","description":"AnyForge Control CLI — governed LLM proxy for Claude Code, Cursor, Cline, and any agent that talks to OpenAI- or Anthropic-shape APIs.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"open":"^10.0.0","kleur":"^4.1.5","prompts":"^2.4.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","typescript":"^5.5.3","@types/node":"^20.11.0","@types/prompts":"^2.4.9"},"_npmOperationalInternal":{"tmp":"tmp/control_0.2.4_1781639277766_0.36035629648572276","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@anyforge/control","version":"0.3.0","description":"AnyForge Control CLI — governed LLM proxy for any agent, and a scriptable client for AnyForge approvals, crews, work items and workflows.","license":"Apache-2.0","homepage":"https://anyforge.ai","repository":{"type":"git","url":"git+https://github.com/pootonline/sovereign-engineering.git","directory":"packages/control/cli"},"publishConfig":{"access":"public"},"type":"module","main":"dist/cli.js","bin":{"anyforge":"dist/cli.js","control":"dist/cli.js"},"scripts":{"build":"esbuild src/cli.ts --bundle --minify --platform=node --format=esm --outfile=dist/cli.js --packages=external && chmod +x dist/cli.js","type-check":"tsc --noEmit","dev":"tsx src/cli.ts","prepublishOnly":"npm run build","publish:beta":"npm publish --access public --tag beta","publish:stable":"npm publish --access public"},"engines":{"node":">=22"},"dependencies":{"kleur":"^4.1.5","open":"^10.0.0","prompts":"^2.4.2"},"devDependencies":{"@types/node":"^22.20.0","@types/prompts":"^2.4.9","esbuild":"^0.25.0","tsx":"^4.7.0","typescript":"^7.0.2"},"_id":"@anyforge/control@0.3.0","gitHead":"025259f6abd67a0b02f7612587a74e5c1dc56e74","bugs":{"url":"https://github.com/pootonline/sovereign-engineering/issues"},"_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-L7KAlOxXZJgIe7lYMbC1mVoP+AnrOm3vsJxol4Y5fyfcSogXzmSYtd6zCCiM/2CpvDhPsLaRGXSLbvQlZhBwrQ==","shasum":"1f680c5d2497e42ec08f4710afc5a4ae4b3cb948","tarball":"https://registry.npmjs.org/@anyforge/control/-/control-0.3.0.tgz","fileCount":3,"unpackedSize":44754,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDHh/40KSNmW8+A7I8kz8bUjUy5Mojabej6dU08V+cVWgIhAMszH09S2cAEAc0V1v1f755NGuHEAaDaJkgRsdWqAEUe"}]},"_npmUser":{"name":"erpoot","email":"edwin@pootonline.com"},"directories":{},"maintainers":[{"name":"erpoot","email":"edwin@pootonline.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/control_0.3.0_1789602004386_0.1304602799244139"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-01T20:21:27.028Z","modified":"2026-09-16T23:40:04.691Z","0.1.0-beta.0":"2026-05-01T20:21:27.250Z","0.1.0":"2026-05-01T20:28:37.204Z","0.2.0":"2026-05-03T14:38:03.308Z","0.2.1":"2026-05-03T14:46:36.603Z","0.2.2":"2026-05-03T15:17:52.132Z","0.2.3":"2026-05-03T18:07:32.733Z","0.2.4":"2026-06-16T19:47:57.928Z","0.3.0":"2026-09-16T23:40:04.522Z"},"bugs":{"url":"https://github.com/pootonline/sovereign-engineering/issues"},"license":"Apache-2.0","homepage":"https://anyforge.ai","repository":{"type":"git","url":"git+https://github.com/pootonline/sovereign-engineering.git","directory":"packages/control/cli"},"description":"AnyForge Control CLI — governed LLM proxy for any agent, and a scriptable client for AnyForge approvals, crews, work items and workflows.","maintainers":[{"name":"erpoot","email":"edwin@pootonline.com"}],"readme":"# @anyforge/control\n\nTwo things in one binary:\n\n1. **A governed LLM proxy** for any agent — Claude Code, Cursor, Cline, Continue, or your own SDK. Route their calls through AnyForge for cost analytics, audit log, and policy enforcement.\n2. **A scriptable AnyForge client** — approvals, crews, work items and workflows from a shell, with no browser and no agent in the loop.\n\nThe second half is what makes AnyForge usable from CI. Every command speaks the same `/api/v1/control/*` API the MCP server does, but without needing a language model to drive it.\n\n## Install\n\n```bash\nnpx @anyforge/control init\n```\n\nThe CLI:\n\n1. Issues a one-time auth code, opens your browser to authorise it.\n2. Stores the resulting API key at `~/.anyforge/credentials` (chmod 600).\n3. Asks whether to install **globally** (`~/.claude/settings.json`) or **per-repo** (the per-repo option only appears when you run the command at the root of a git working tree).\n4. Patches the chosen target so Claude Code routes through `https://crew.anyforge.ai/v1/anthropic` and `…/v1/openai`. The actual API key is **inlined** into the patched config — no `${ANYFORGE_API_KEY}` indirection, no shell restart required.\n\nAfter that, your next LLM call shows up under `Control` on `/usage` within seconds.\n\n### Install scope\n\n| Choice | Files written | Effect |\n|---|---|---|\n| `global` | `~/.claude/settings.json` (+ optional shell-rc hints for Cursor / Cline if installed) | Every Claude Code session on this machine routes through AnyForge |\n| `repo` | `<repo>/.claude/settings.local.json` and `<repo>/.env` | Only Claude Code sessions inside this repo are routed; no global side effects |\n\nPick whichever suits the moment — the choices aren't mutually exclusive over time:\n\n- Want to add a second repo? Re-run `npx @anyforge/control init` from that repo's root and pick `repo` again.\n- Want to switch to a system-wide install later? Re-run from anywhere and pick `global`.\n- Want to undo a per-repo install? Run `anyforge logout` — it now reverts the patched configs (`~/.claude/settings.json`, `<repo>/.claude/settings.local.json`, the `# === AnyForge Control ===` block in `.env` / your shell rc) and restores any previously-shadowed login.\n\n> The `.env` written in per-repo mode contains a live `ANYFORGE_API_KEY`. The CLI warns if your repo's `.gitignore` doesn't already exclude `.env`. **Add it before committing.**\n\n### Claude Pro / Max subscription users\n\nThe inference proxy is **BYOK-only**: it routes Claude Code through your own Anthropic *API key* for metering and governance. It is **incompatible with a Claude Pro/Max (subscription) login** — the `ANTHROPIC_AUTH_TOKEN` it patches out-ranks (Claude Code auth precedence #2) and therefore disables the subscription login (#6), and the proxy has no upstream API key for a subscription user, so Claude Code falls back to \"please login\".\n\n`anyforge init` detects a subscription login and **skips patching**, steering you to the **AnyForge MCP server** instead — which keeps your subscription for inference and adds AnyForge control (HIL approvals, work items, crews) on top, with no auth conflict:\n\n```bash\nclaude mcp add anyforge --env ANYFORGE_API_KEY=<your key> -- npx -y @anyforge/mcp-server\n```\n\nIf you really want the metered BYOK proxy, re-run `anyforge init --force` (you'll need an Anthropic API key configured on your company; this disables your subscription in Claude Code until you `anyforge logout`).\n\n### Why `ANTHROPIC_AUTH_TOKEN`, not `ANTHROPIC_API_KEY`?\n\nClaude Code recognises both, but they behave differently. `ANTHROPIC_API_KEY` is sent as `X-Api-Key` and — when an OAuth Console login is also present — surfaces an \"Auth conflict: Using ANTHROPIC_API_KEY instead of Anthropic Console key\" warning, and can cascade into a \"selected model may not exist\" error. `ANTHROPIC_AUTH_TOKEN` is sent as `Authorization: Bearer …`, is documented for \"routing through an LLM gateway or proxy\", and matches the bearer-token shape AnyForge expects. We patch the token form, and on every install we explicitly delete any stale `ANTHROPIC_API_KEY` left behind by older versions. Note that it out-ranks a subscription login (see above) — which is exactly why `init` refuses to patch over a Pro/Max login by default.\n\n## Commands\n\n### Setup\n\n| | |\n|---|---|\n| `anyforge init` | Authorise this device and patch local agent configs |\n| `anyforge whoami` | Show the company, scopes and endpoint this key acts as (asks the server) |\n| `anyforge status` | Verify the proxy is reachable and your BYOK key is configured |\n| `anyforge logout` | Clear the local credential file **and revert patched configs** (does not revoke server-side) |\n| `anyforge apply-patch` | Apply a unified diff from a file or stdin via `git apply` |\n\n### Scriptable\n\n| | | Scope |\n|---|---|---|\n| `anyforge approvals` | List HIL approvals awaiting a decision | `read` |\n| `anyforge approve <id>` | Approve one (`--notes` is recorded in the audit trail) | `approve` |\n| `anyforge reject <id>` | Reject one | `approve` |\n| `anyforge crews` | List crews (`--active` for non-terminal only) | `read` |\n| `anyforge crew <id>` | Show one crew, its status and recent output | `read` |\n| `anyforge halt <id>` / `resume <id>` | Stop or restart a crew | `approve` |\n| `anyforge work` | List work items (`--status`, `--type`, `--priority`, `--search`, …) | `read` |\n| `anyforge workflows` | List operator workflows | `read` |\n| `anyforge run <id>` | Dispatch a run (`--input '{\"repo\":\"acme/web\"}'`) | `write` |\n| `anyforge ask <question>` | Ask the Oracle one question | `read` |\n\nEvery command takes `--json`, which prints the API payload verbatim:\n\n```bash\nanyforge approvals --json | jq 'length'\nanyforge crews --active --json | jq -r '.[].id' | xargs -n1 anyforge halt\n```\n\n### Exit codes\n\nCI gates on these, so they are a contract:\n\n| | |\n|---|---|\n| `0` | Success — an empty list included |\n| `1` | Network or unexpected failure (retryable) |\n| `2` | Usage error |\n| `3` | Not authenticated — run `init`, or set `ANYFORGE_API_TOKEN` |\n| `4` | The API refused; its error code prints to stderr |\n\nErrors and progress go to stderr, so a `--json` pipe stays parseable under a failure.\n\n### Unattended use\n\nSet `ANYFORGE_API_TOKEN` (and optionally `ANYFORGE_API_URL`) instead of running `init` — no browser, no credential file. Mint the key under **Settings → API keys** with the narrowest scope the job needs.\n\n## Endpoints\n\nThe CLI defaults to `https://crew.anyforge.ai`. Override per-invocation with `--endpoint`, or globally with the `ANYFORGE_ENDPOINT` environment variable.\n\nThe proxy exposes:\n\n- `POST /v1/anthropic/v1/messages` — drop-in for `https://api.anthropic.com/v1/messages`. Use `Authorization: Bearer sk_anyforge_…` instead of `x-api-key`. The `/v1` repeats because you set `ANTHROPIC_BASE_URL` to `https://crew.anyforge.ai/v1/anthropic` and the Anthropic SDK appends `/v1/messages` to it.\n- `POST /v1/openai/v1/chat/completions` — drop-in for `https://api.openai.com/v1/chat/completions`.\n\nBoth validate your AnyForge API key, look up your company's BYOK provider key, forward the request, and stream the response back unchanged. Token counts and cost are logged to your usage dashboard.\n\n## What you get\n\n- **Cost analytics** — per-call, per-company, per-model spend on `/usage`.\n- **Audit log** — hash-chained record of every prompt + response.\n- **BYOK** — your provider keys live in your AnyForge company; the CLI never holds raw provider keys on the local machine.\n- **One key, every agent** — the same `sk_anyforge_…` works for any agent that talks OpenAI- or Anthropic-shape APIs.\n\n## Coming soon\n\n- `anyforge proxy` — local proxy mode for OPA-enforced redaction before requests leave your network.\n- Intent-based routing (rules / regex / embeddings).\n- Portable memory injection.\n- Ollama support for local models.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}