[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81746":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":35,"discoverSource":36},81746,"ocgo","emanuelcasco\u002Focgo","emanuelcasco","OCGO Provides an Ollama-style CLI for running Claude Code through an OpenCode Go subscription via a local Anthropic-compatible proxy.","",null,"Go",43,10,1,0,2,9,15,6,3.12,"MIT License",false,"main",true,[26,27,28,29,30,31],"ai","ai-agents","ollama","ollama-interface","opencode","opencode-go","2026-06-12 02:04:19","# ocgo\n\n`ocgo` is a small Go CLI that lets [Claude Code](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code) and [Codex CLI](https:\u002F\u002Fdevelopers.openai.com\u002Fcodex\u002Fcli\u002F) run against an OpenCode Go subscription. It starts a local compatibility proxy, translates Claude Code's Anthropic Messages API requests when needed, exposes OpenAI-compatible endpoints for Codex, and launches tools with the right configuration.\n\n```bash\n# 1. Setup your OpenCode API key\nocgo setup\n\n# 2. Start coding!\nocgo launch claude --model kimi-k2.6\nocgo launch codex --model kimi-k2.6\n```\n\nUse your OpenCode Go subscription from Claude Code or Codex CLI in one command — no manual proxy setup required.\n\n## Features\n\n- Save and reuse your OpenCode Go API key.\n- List known OpenCode Go model IDs.\n- Run Claude Code through OpenCode Go with one command.\n- Run Codex CLI through OpenCode Go with one command.\n- Start, stop, and inspect a local proxy server.\n- Exposes Anthropic-compatible and OpenAI-compatible local API layers.\n- Supports streaming text responses and basic tool-call translation.\n\n## Requirements\n\n- Go 1.22 or newer.\n- A valid OpenCode Go API key.\n- Claude Code or Codex CLI installed and available.\n\n## Installation\n\nInstall with Homebrew:\n\n```bash\nbrew install emanuelcasco\u002Ftap\u002Focgo\n```\n\nOr tap the repository first:\n\n```bash\nbrew tap emanuelcasco\u002Ftap\nbrew install ocgo\n```\n\nBuild from source:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Femanuelcasco\u002Focgo.git\ncd ocgo\nmake install\n```\n\n## Configuration\n\nRun setup and paste your OpenCode Go API key when prompted:\n\n```bash\nocgo setup\n```\n\nOr pass the key directly:\n\n```bash\nocgo setup --api-key sk-opencode-your-key\n```\n\nConfiguration is saved to:\n\n```text\n~\u002F.config\u002Focgo\u002Fconfig.json\n```\n\nYou can also provide the key at runtime with an environment variable:\n\n```bash\nexport OCGO_API_KEY=sk-opencode-your-key\n```\n\nBy default, the local proxy listens on `127.0.0.1:3456`.\n\n## Usage\n\n### List available models\n\n```bash\nocgo list\n```\n\nAliases are also available:\n\n```bash\nocgo ls\nocgo models\n```\n\n### Launch Claude Code\n\nStart Claude Code through the local proxy:\n\n```bash\nocgo launch claude\n```\n\nUse a specific OpenCode Go model:\n\n```bash\nocgo launch claude --model kimi-k2.6\n```\n\nPass arguments through to Claude Code after `--`:\n\n```bash\nocgo launch claude --model kimi-k2.6 -- -p \"How does this repository work?\"\n```\n\nAllow Claude Code to skip permission prompts:\n\n```bash\nocgo launch claude --yes\n```\n\nWhen `ocgo launch claude` starts Claude Code, it sets:\n\n```bash\nANTHROPIC_BASE_URL=http:\u002F\u002F127.0.0.1:3456\nANTHROPIC_AUTH_TOKEN=unused\n```\n\nWhen `--model` is provided, it also sets:\n\n```bash\nANTHROPIC_MODEL=\u003Cmodel>\nANTHROPIC_SMALL_FAST_MODEL=\u003Cmodel>\n```\n\nIf Claude Code requests a Claude model name or does not provide a model, `ocgo` defaults the upstream OpenCode Go model to `kimi-k2.6`.\n\n### Launch Codex CLI\n\nStart Codex CLI through the local proxy:\n\n```bash\nocgo launch codex\n```\n\nUse a specific OpenCode Go model:\n\n```bash\nocgo launch codex --model kimi-k2.6\n```\n\nPass arguments through to Codex after `--`:\n\n```bash\nocgo launch codex --model kimi-k2.6 -- --sandbox workspace-write\n```\n\nConfigure Codex without launching it:\n\n```bash\nocgo launch codex --config\n```\n\nWhen `ocgo launch codex` runs, it writes or updates this profile in `~\u002F.codex\u002Fconfig.toml`:\n\n```toml\n[profiles.ocgo-launch]\nopenai_base_url = \"http:\u002F\u002F127.0.0.1:3456\u002Fv1\u002F\"\nforced_login_method = \"api\"\nmodel_provider = \"ocgo-launch\"\nmodel_catalog_json = \"\u002FUsers\u002Fyou\u002F.codex\u002Focgo-models.json\"\n\n[model_providers.ocgo-launch]\nname = \"OpenCode Go\"\nbase_url = \"http:\u002F\u002F127.0.0.1:3456\u002Fv1\u002F\"\nwire_api = \"responses\"\n```\n\nIt then launches:\n\n```bash\ncodex --profile ocgo-launch -m \u003Cmodel>\n```\n\nThe Codex process receives `OPENAI_API_KEY=ocgo`; the local proxy injects your real OpenCode Go API key upstream. `ocgo` also writes `~\u002F.codex\u002Focgo-models.json` so Codex has metadata for OpenCode Go model IDs such as `deepseek-v4-pro`.\n\n## Proxy commands\n\nRun the proxy in the foreground:\n\n```bash\nocgo serve\n```\n\nRun it in the background:\n\n```bash\nocgo serve --background\n# or\nocgo serve -b\n```\n\nCheck whether the proxy is running:\n\n```bash\nocgo status\n```\n\nStop the background proxy:\n\n```bash\nocgo stop\n```\n\nProxy runtime files are stored in:\n\n```text\n~\u002F.config\u002Focgo\u002Focgo.pid\n~\u002F.config\u002Focgo\u002Focgo.log\n```\n\n## Development\n\n### Set up a local development environment\n\nClone the repository and enter the project directory:\n\n```bash\ngit clone \u003Crepository-url>\ncd ocgo-cc\n```\n\nInstall Go 1.22 or newer, then download dependencies:\n\n```bash\ngo mod download\n```\n\nBuild the binary:\n\n```bash\nmake build\n```\n\nThe binary is written to:\n\n```text\nbin\u002Focgo\n```\n\nOptionally install it to `~\u002Fgo\u002Fbin`:\n\n```bash\nmake install\n```\n\nMake sure the install location is in your `PATH`:\n\n```bash\nexport PATH=\"$HOME\u002Fgo\u002Fbin:$PATH\"\n```\n\nConfigure an OpenCode Go API key for local testing:\n\n```bash\nbin\u002Focgo setup\n# or, if installed:\nocgo setup\n```\n\nRun the CLI without building:\n\n```bash\nmake run\n```\n\nRun tests:\n\n```bash\nmake test\n```\n\nRemove built binaries:\n\n```bash\nmake clean\n```\n\n## Release\n\nThis project includes a plain Bash release script, no GoReleaser required. It uses the GitHub CLI to create the GitHub release and update a Homebrew tap formula.\n\nRequirements:\n\n```bash\nbrew install gh\ngh auth login\n```\n\nRelease a new version:\n\n```bash\nmake release TAG=v0.1.0\n```\n\nBy default, releases are published to `emanuelcasco\u002Focgo` and the Homebrew formula is pushed to `emanuelcasco\u002Fhomebrew-tap`. You can override those with `GITHUB_REPOSITORY=owner\u002Frepo` and `HOMEBREW_TAP_REPO=owner\u002Fhomebrew-tap`.\n\nThe script builds macOS\u002FLinux `amd64` and `arm64` archives, uploads them to GitHub Releases, and commits `Formula\u002Focgo.rb` to the tap repo.\n\n## How it works\n\n`ocgo` exposes a local compatibility API used by Claude Code and Codex CLI:\n\n- `GET \u002Fhealth`\n- `POST \u002Fv1\u002Fmessages`\n- `POST \u002Fv1\u002Fmessages\u002Fcount_tokens`\n- `POST \u002Fv1\u002Fchat\u002Fcompletions`\n- `POST \u002Fv1\u002Fresponses`\n\nRequests sent to `\u002Fv1\u002Fmessages` are converted from Anthropic Messages format into OpenAI-compatible chat completion requests.\n\nRequests sent to `\u002Fv1\u002Fchat\u002Fcompletions` are passed through as OpenAI-compatible chat completion requests while `ocgo` injects the configured OpenCode Go API key.\n\nRequests sent to `\u002Fv1\u002Fresponses` use a lightweight OpenAI Responses API adapter for Codex CLI. The adapter converts common Responses input, tool definitions, and streaming text events to and from chat completions.\n\nAll upstream requests are forwarded to:\n\n```text\nhttps:\u002F\u002Fopencode.ai\u002Fzen\u002Fgo\u002Fv1\u002Fchat\u002Fcompletions\n```\n\nClaude Code responses are converted back into Anthropic-compatible responses. Codex responses are returned in OpenAI-compatible Chat Completions or Responses API shapes depending on the requested endpoint.\n\n## Limitations\n\n`ocgo` is intentionally lightweight. Token counting currently returns `0`, and Anthropic\u002FOpenAI compatibility is focused on the request and response shapes needed by Claude Code and Codex CLI rather than full API parity. The `\u002Fv1\u002Fresponses` adapter is minimal and targets text\u002Ftool workflows used by Codex; it is not a complete OpenAI Responses API implementation.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","`ocgo` 是一个用 Go 语言编写的命令行工具，通过本地兼容代理让 Claude Code 和 Codex CLI 通过 OpenCode Go 订阅运行。其核心功能包括一键设置和使用 OpenCode Go API 密钥、列出已知模型 ID、通过单个命令运行 Claude Code 或 Codex CLI，并提供 Anthropic 兼容和 OpenAI 兼容的本地 API 层。此外，该工具支持文本流响应和基本工具调用翻译。适用于需要利用 OpenCode Go 订阅进行代码生成或 AI 辅助编程的场景，无需手动配置代理服务器，简化了开发流程。","2026-06-11 04:06:14","CREATED_QUERY"]