Cosmos DevKit
Cosmos Code, the Cosmos coding agent for the terminal, VS Code, and desktop, built on ADK V2
Updated 2026-11-03
Verified 2026-11-03
Cosmos Code (cosmos-code) brings Cosmos agents into developer workflows. It is EY's fork of OpenCode: a signed-in user drives Cosmos-registered agents from the terminal or from the Cosmos Workbench VS Code extension, with ADK running the agent and the developer's machine running the tools.
Shipping Surfaces
| Surface | Description |
|---|---|
| Cosmos Code CLI and TUI | The cosmoscode binary |
| Cosmos Workbench VS Code extension | ey-cosmos.cosmos-workbench, which embeds a compiled cosmoscode binary (repository cosmos-workbench) |
| Cosmos Workbench desktop app | Electron app that also embeds cosmoscode (repository cosmos-workbench) |
ADK fixes ship as an ADK service deployment, not in the extension or desktop app.
How It Works With Cosmos
- ADK runtime — when the selected model uses the
cosmosprovider with the Cosmos SDK or WebSocket transport, turns run through ADK V2 instead of the local model loop. ADK owns the transcript, context window, and compaction; the client sends only the latest user turn. The context gauge uses the token threshold ADK reports in each usage frame. - Client-side tools — local tools (read, write, edit, search, shell, and similar) are registered with the ADK V2 router. When the agent calls one, the request comes back over the WebSocket and the tool runs on the developer's machine against real paths, without a sandbox. ADK server-side document tools are excluded.
- Login — browser PKCE login against the User Service with the public OAuth client
cosmos-devkit-publicand the callbackhttp://127.0.0.1:19876/callback. Tokens are stored in the runtime'sauth.jsonand refreshed automatically before ADK calls. Each organization appears as acosmos-<orgId>provider. - Identity and branding — the client does not send an ADK
app_name; ADK fills in the selected agent's name. The host surface is reported assource_channelfor observability. Configuration lives in~/.config/cosmos-code/(cosmos-code.jsonorcosmos-code.jsonc) and per project in.cosmos-code/.
There is no REST conversation fallback: execution always uses ADK V2.
Workspace-Scoped Runtime
Managed Workbench runtimes set COSMOS_REQUIRE_WORKSPACE_CONTEXT=1. Clients then send x-cosmos-workspace on discovery and activation requests, and add x-cosmos-context-revision on catalog, session, prompt, and other execution requests. CLI and TUI clients that send neither keep the unscoped behavior.
| Endpoint | Purpose |
|---|---|
GET /cosmos/capabilities | Runtime capabilities and runtimeInstanceId |
GET /cosmos/workspace | Current binding; status ready, unbound, or auth-required |
POST /cosmos/workspace | Bind an organization and project, optionally resuming a session |
GET /cosmos/organizations | Organizations available to the user |
GET /cosmos/projects | Projects in an organization, with search and cursor pagination |
Domain failures return HTTP 409 with {code, message}; codes are auth-required, access-denied, not-found, network-error, service-unavailable, busy, context-conflict, missing-context, and unsupported.
API Overview
Cosmos Code has no Cosmos service API of its own. It calls the User Service for login, Configurator for organizations, projects, and agents, and the ADK V2 WebSocket (/api/v1/adk/converse/v2) for execution. The workspace endpoints above are served by the local runtime. See the ADK Converse API.
Development
- Install Bun 1.3.14 or later.
- Clone
cosmos-sdk-typescriptas a sibling;@cosmos/sdkresolves through a local file link. - Run
bun installat the repository root. - Run tests and
bun typecheckfrom package directories such aspackages/opencode, not from the root.
Changelog
See the DevKit changelog for verified changes.