VS Code
This guide covers installing the Cosine VSCode extension and the Cosine CLI, how they work together, and common troubleshooting steps.
Overview
The VS Code extension is a companion to the Cosine CLI. The CLI must be installed and available.
The extension auto-discovers the CLI, streams “Cosine Changes” into VS Code, and provides inline actions to open files and diffs.
What it does
Shares lightweight editor context (active file and selection) so Genie can respond more precisely.
Adds a “✦ Cosine Changes” tree in the Explorer to track files with live previews or SCM changes; click items to open diffs or previews.
Launches a “Cosine” terminal and runs the CLI for you (configurable).
Streams in code changes for quicker validation and diff viewing
Requirements
Cosine CLI installed and on PATH (
cos --version)VS Code 1.105.0 or later
Install
1) Install the VS Code extension
From VS Code: open Extensions (Ctrl/Cmd+Shift+X), search for “Cosine”, and install.
2) Install the Cosine CLI
cos --versionQuick start
Install the CLI and verify
cos --version.Install the VS Code extension.
Open a project in VS Code and reload the window.
The extension will start a “Cosine” terminal and run
cos(if auto-start is enabled).Use the “✦ Cosine Changes” view in the Explorer to preview live updates; open diffs when coding streams complete.

How to use it
Sign in: if the terminal shows “You are not logged in”, run
cos loginand complete auth in your browser.Start the CLI: it auto-starts by default; otherwise run “Cosine: Start CLI”. Use “Cosine: Focus CLI Terminal” to bring it to front.
Provide context: open a file or select a block of code. The extension shares the active file/selection with Genie.
Ask Genie: type your request in the CLI prompt (e.g., “refactor this function”, “add tests for X”, “fix lint errors”). Watch live previews stream in the “Cosine Changes” view.
Review diffs: when a stream ends, a native diff opens (configurable via settings). Use inline actions to open Working, Live, or Diff for each item.
Apply/commit: the CLI writes changes to your repo. Review them in Git and commit as usual. The extension is visual-only for previews/diffs.

Troubleshooting
CLI not found:
Check
cos --version. If not found, install the CLI or add its install directory to your PATH.In VS Code, set “Cosine: CLI Path” (e.g.,
/usr/local/bin/cos).
Bridge not connected:
Check status bar. Run “Cosine: Start VS Code Bridge”.
Verify the CLI is running in the “Cosine” terminal.
Uninstall
Extension: uninstall from VS Code Extensions.
CLI: remove the
cosbinary from its install location (e.g.,/usr/local/bin/cosor your user bin dir).
FAQ
Do I need the CLI for the extension to work?
Yes. The extension is a companion to the CLI and depends on it.
How do I update the CLI?
Re-run the install script or install a newer release. Then verify with
cos --version.
Where do I see changes?
Use the “✦ Cosine Changes” view to preview and open diffs as Genie streams updates.
Last updated
Was this helpful?