{"id":50752201,"url":"https://github.com/agentjido/jido_opencode","last_synced_at":"2026-06-11T02:05:02.279Z","repository":{"id":350554351,"uuid":"1162598432","full_name":"agentjido/jido_opencode","owner":"agentjido","description":"OpenCode CLI adapter for Jido.Harness (Z.AI-focused v1).","archived":false,"fork":false,"pushed_at":"2026-05-22T17:36:56.000Z","size":103,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-22T18:51:34.481Z","etag":null,"topics":["adapter","cli-agent","elixir","jido","jido-harness","opencode","zai"],"latest_commit_sha":null,"homepage":"https://github.com/agentjido/jido_opencode#readme","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agentjido.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-20T13:13:45.000Z","updated_at":"2026-05-22T17:37:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/agentjido/jido_opencode","commit_stats":null,"previous_names":["agentjido/jido_opencode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/agentjido/jido_opencode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentjido%2Fjido_opencode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentjido%2Fjido_opencode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentjido%2Fjido_opencode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentjido%2Fjido_opencode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agentjido","download_url":"https://codeload.github.com/agentjido/jido_opencode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentjido%2Fjido_opencode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34178824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adapter","cli-agent","elixir","jido","jido-harness","opencode","zai"],"created_at":"2026-06-11T02:04:59.866Z","updated_at":"2026-06-11T02:05:02.266Z","avatar_url":"https://github.com/agentjido.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jido.OpenCode\n\n[![Hex.pm](https://img.shields.io/hexpm/v/jido_opencode.svg)](https://hex.pm/packages/jido_opencode)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/jido_opencode/)\n[![CI](https://github.com/agentjido/jido_opencode/actions/workflows/ci.yml/badge.svg)](https://github.com/agentjido/jido_opencode/actions/workflows/ci.yml)\n[![License](https://img.shields.io/hexpm/l/jido_opencode.svg)](https://github.com/agentjido/jido_opencode/blob/main/LICENSE)\n[![Website](https://img.shields.io/badge/website-jido.run-0f172a.svg)](https://jido.run)\n[![Ecosystem](https://img.shields.io/badge/ecosystem-jido.run-0ea5e9.svg)](https://jido.run/ecosystem)\n[![Discord](https://img.shields.io/badge/discord-join-5865F2.svg?logo=discord\u0026logoColor=white)](https://jido.run/discord)\n\n`jido_opencode` is a `jido_harness` adapter for the OpenCode CLI.\n\nThis package maps OpenCode JSON output into normalized `Jido.Harness.Event` structs and publishes runtime contract metadata for harness execution flows.\n\n## Installation\n\nAdd dependencies:\n\n```elixir\n{:jido_harness, github: \"agentjido/jido_harness\", branch: \"main\", override: true}\n{:jido_opencode, github: \"agentjido/jido_opencode\", branch: \"main\"}\n```\n\nThis repo is currently aligned as part of the GitHub-based harness package set rather than a Hex release line.\n\nThen install deps:\n\n```bash\nmix deps.get\n```\n\n## Usage\n\nRun directly:\n\n```elixir\n{:ok, stream} = Jido.OpenCode.run(\"Return exactly: OK\", cwd: \"/repo\")\nevents = Enum.to_list(stream)\n```\n\nRun via harness:\n\n```elixir\nrequest = Jido.Harness.RunRequest.new!(%{prompt: \"Summarize changes\", cwd: \"/repo\"})\n{:ok, stream} = Jido.Harness.run(:opencode, request)\n```\n\n## Runtime Requirements (Z.AI v1)\n\n- Optional env: `ZAI_API_KEY` when using env-based Z.AI auth\n- Optional env:\n  - `ZAI_BASE_URL` (defaulted in runtime contract to `https://api.z.ai/api/anthropic`)\n  - `OPENCODE_MODEL` (defaulted to `zai-coding-plan/glm-4.5-air`)\n- CLI: `opencode` (install via `npm install -g opencode-ai`)\n\nHelpful tasks:\n\n```bash\nmix opencode.install\nmix opencode.compat\nmix opencode.smoke \"Return exactly: JIDO_OPENCODE_SMOKE_OK\"\n```\n\n## Capability Notes\n\nCurrent adapter behavior is intentionally conservative:\n\n- `streaming?` is `false` in v1 (`run/2` is buffered-first)\n- `cancellation?` is `false`\n- Scope is Z.AI-focused runtime contract support\n\n## License\n\nApache-2.0\n\n## Package Purpose\n\n`jido_opencode` is the OpenCode adapter package for `jido_harness`, currently scoped to Z.AI-compatible runtime/auth flows using the installed `zai-coding-plan/*` provider models.\n\n## Testing Paths\n\n- Unit/contract tests: `mix test`\n- Full quality gate: `mix quality`\n- Optional live checks: `mix opencode.install \u0026\u0026 mix opencode.compat \u0026\u0026 mix opencode.smoke \"hello\"`\n\n## Live Integration Test\n\n`jido_opencode` includes an opt-in live adapter test that runs the real OpenCode CLI through the harness adapter path:\n\n```bash\nmix test --include integration test/jido_opencode/integration/adapter_live_integration_test.exs\n```\n\nThe test auto-loads `.env` and is excluded from default `mix test` runs.\n\nEnvironment knobs:\n\n- `ZAI_API_KEY` when using env-based OpenCode auth\n- `ZAI_BASE_URL` and `OPENCODE_MODEL` for custom endpoint/model selection\n- `JIDO_OPENCODE_LIVE_PROMPT` to override the default prompt\n- `JIDO_OPENCODE_LIVE_CWD` to override the working directory\n- `JIDO_OPENCODE_LIVE_MODEL` to force a specific model\n- `JIDO_OPENCODE_LIVE_TIMEOUT_MS` to extend the per-run timeout\n- `JIDO_OPENCODE_REQUIRE_SUCCESS=1` to fail unless the terminal event is successful\n- `JIDO_OPENCODE_CLI_PATH` to target a non-default OpenCode CLI binary\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentjido%2Fjido_opencode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentjido%2Fjido_opencode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentjido%2Fjido_opencode/lists"}