JS Workbench VS Code Extension
Cosmos coding agents, right inside your editor. No tab-switching, no context loss.
The extension is self-contained: the JS Workbench runtime binary ships inside the
.vsix, so no separate runtime installation or download is required on first run. Explicit binary overrides still take precedence; system discovery is a fallback when no bundled runtime is available.
The embedded Cosmos Code owns the Cosmos SDK dependency and installs its pinned
archive from its own repository. Workbench's @opencode-ai/sdk is a different
HTTP client and is unchanged. Build and stage the tested Cosmos Code commit via
COSMOS_OPENCODE_ROOT; do not infer an SDK update from an existing binary's version.
What you get
- Chat beside your code — responsive layout that adapts to narrow and wide panels
- Cosmos projects and agents — sign in, select an organization and project, then use that project's deployed agents; no third-party provider keys
- Agent Manager — run the same prompt across multiple agents in parallel, compare results side by side
- Right-click actions — add context, explain selections, and improve code in-place
- Click-to-open — file paths in tool output open directly in your editor; edit-style results land in a focused diff view
- Session editor panel — keep chat sessions open alongside files
- Theme-aware — adapts to your VS Code light, dark, and high-contrast themes
Plus the branchable timeline, tool UIs, voice mode and Git workflows from the shared UI.
Workbench opens in the Secondary Side Bar (on the right in VS Code's default
layout), alongside Chat and Codex, leaving Explorer on the left. VS Code remembers
custom view placements; if an existing installation stays on the left, use its
view container's Move To > Secondary Side Bar menu once. Editor session tabs
remain available separately.
Commands
| Command |
Description |
JS Workbench: Focus Chat |
Focus the chat panel |
JS Workbench: New Session |
Start a new chat session |
JS Workbench: Change Project |
Select the project for the entire VS Code workspace (keeps the current organization) |
JS Workbench: Change Organization |
Select another organization, then a project, for the entire VS Code workspace |
JS Workbench: Open Sidebar |
Open the JS Workbench sidebar |
JS Workbench: Open Agent Manager |
Launch parallel multi-agent runs |
JS Workbench: Open Session in Editor |
Open current or new session in an editor tab |
JS Workbench: Settings |
Open extension settings |
JS Workbench: Restart API Connection |
Restart the runtime process |
JS Workbench: Show Runtime Status |
Debug info for development or bug reports |
Select code in the editor, right-click, and find the JS Workbench submenu:
| Action |
Description |
| Add to Context |
Attach selection to your next prompt |
| Explain |
Ask the agent to explain the selected code |
| Improve Code |
Ask the agent to improve the selection in-place |
Configuration
Setting ids use the cosmos. prefix. Upstream's openchamber. prefix was given up
because VS Code settings ids are global: with the OpenChamber extension also
installed, both extensions read and write the same keys, so pointing one at a
runtime binary silently repointed the other. Values saved under the old
openchamber.* ids are not migrated.
| Setting |
Default |
Description |
cosmos.apiUrl |
(empty) |
URL of an external JS Workbench runtime server. Leave empty to auto-start the bundled runtime. |
cosmos.opencodeBinary |
(empty) |
Absolute path to a runtime binary that replaces the bundled one. Requires window reload to apply. |
Set OPENCODE_BINARY to an executable path in the extension host environment
to override the runtime for a development session. COSMOS_OPENCODE_ROOT selects
the source checkout for packaging only; it does not select the running binary.
On activation, the extension creates ~/.config/cosmos-code/cosmos-code.jsonc
if missing (or uses XDG_CONFIG_HOME). When the recorded
provider.cosmos.options.workbenchConfigVersion is missing or differs from the
extension's config migration version (COSMOS_CONFIG_MIGRATION_VERSION), the
five Cosmos service URLs in the provider and existing organization entries are
updated to bundled defaults and the new version is recorded. Stored runtime auth
is cleared once per migration so the next sign-in uses the new environment.
The migration version changes when bundled URLs or migration behavior must
change, not on every extension release. Other settings are preserved. With a
matching version, custom URL edits remain untouched. Migration results appear in
Output > JS Workbench. Project overrides and external server configs
are not changed by this migration.
Requirements
- VS Code 1.106+
- A Cosmos account; sign in from the extension the first time you open it
Authentication
Cosmos sign-in is required. After browser login, select a project from the
sidebar or run JS Workbench: Change Project from the Command Palette. The
project always requires confirmation. The organization is not asked for: the
workspace keeps its current organization, otherwise JumpStart is used, otherwise
your only organization. If you belong to several organizations and none is named
JumpStart, you are asked once per workspace. Run JS Workbench: Change
Organization to pick another organization deliberately; the choice applies to
this VS Code workspace only. If a selection picker is already open, finish or
dismiss it first. The commands work before opening the sidebar and do not require
adding a folder to Workbench's project list.
The selection belongs to the VS Code workspace, including every folder,
worktree, sidebar, session editor, and Agent Manager in that window. Agents are
not loaded until the selected project is validated. Settings remains accessible
while chat is gated; Settings, the header, and the composer do not own competing
organization/project pickers. Other VS Code windows keep their own selections.
Workspace selection is stored in VS Code workspace state and revalidated for the
same signed-in account after reconnecting. It does not write Cosmos organization
or project selection into global provider settings or repository configuration.
Finish or explicitly stop active work before changing context. Manually choosing
a different project or Cosmos agent starts a separate local conversation; ADK
creates its remote session on the first send. Switching the local Build/Plan mode
does not change the Cosmos agent.
Opening existing Workbench history instead restores its original organization,
project, agent, and version and resumes the same local and ADK session IDs.
Unavailable or ambiguous historical context is read-only with an explicit error;
Workbench does not substitute today's project or silently replace a missing ADK
session. This does not import other conversations from ADK.
Sync agents refreshes the selected project across open panels. Authentication,
access, network, and empty-project states remain distinct. External runtime
servers must support the Cosmos workspace-context and strict-resume protocol;
incompatible servers are rejected rather than falling back to unscoped discovery.
Development
bun install
bun run vscode:dev
bun run vscode:dev starts watchers and opens an Extension Development Host.
Webview UI changes use Vite HMR.
Packaging (Vite requires Node >= 22.12):
# host platform only
bun run --cwd packages/vscode package
# every supported platform target
bun run --cwd packages/vscode package:all
Both commands stage the matching runtime binary into
packages/vscode/resources/opencode-cli/ and write the .vsix files to
packages/vscode/dist-vsix/. bun run --cwd packages/vscode verify:opencode-cli
re-checks a staged runtime against its sha256 manifest.
Install locally: code --install-extension packages/vscode/dist-vsix/cosmos-workbench-*.vsix
To publish to the VS Code Marketplace, see docs/PUBLISHING.md.
License
MIT. This extension is a fork of OpenChamber;
see LICENSE for the upstream copyright notice.