Sourcegraph Cody CLI: safety, end of life and how to run it
Where Sourcegraph Cody and its CLI stand (end of life set for January 31, 2027), what the CLI can touch, how it authenticates and steps to run it safely.
- Made by
- Sourcegraph
- Runs in
- Terminal (cody chat), VS Code extension, JetBrains extension, Visual Studio extension (experimental), Sourcegraph web app
- Platforms
- macOS, Linux, Windows
- Licence
- Not stated
No public advisories found
None turned up in vendor advisories, NVD or its repo when this page was checked on December 2, 2026.
On this page
What Sourcegraph Cody CLI is
The Cody CLI is an npm package named @sourcegraph/cody that gives you the cody command. Its documented use is cody chat: you send a message, optionally add local files with --context-file or remote repositories with --context-repo, or pipe text in on standard input, and get an answer from a model that Sourcegraph is configured to serve. It is a chat and context tool, and the pages I read describe no step where it runs shell commands or edits files for you. It signs in to a Sourcegraph instance, so today it is only useful to Cody Enterprise customers. Sourcegraph's own agent for individual developers was Amp, which has since become a separate company.
Install Sourcegraph Cody CLI
CLI with npm (Node.js 20 or newer):
npm install -g @sourcegraph/codyCLI with pnpm:
pnpm install -g @sourcegraph/codyCLI with yarn:
yarn global add @sourcegraph/codySourcegraph Cody CLI news and advisories
Releases and announcements, with public security advisories on the same line.
Sourcegraph announced that Cody reaches end of life on January 31, 2027, and pointed customers toward Deep Search, its MCP integration and its other APIs. It said these are not one-for-one replacements.
Sourcegraph blogThe public Cody code repository was archived and made read-only, with its last open commit noted in the project README.
Cody public snapshot repositoryCody Free and Cody Pro were discontinued, and Cody was removed from the Enterprise Starter plan.
Sourcegraph blogSourcegraph stopped new Cody Free and Pro sign-ups, said Cody Enterprise was unaffected at that point, and recommended Amp to former Free and Pro users.
Sourcegraph blog
How Sourcegraph Cody CLI keeps itself in bounds
Out of the box, chat with context you supply; the CLI docs describe no command-run or file-edit permission prompts.
| Mode | How to turn it on | Asks you | What it allows |
|---|---|---|---|
cody chat | cody chat -m 'question', or --stdin, or a trailing - | Never | Sends your message to the model and prints the reply. The docs describe no tool use, so there is nothing for it to ask about. |
Local file context | cody chat --context-file path -m 'question' | Never | Reads the file you name and sends its contents to the Sourcegraph instance as context. |
Remote repository context | cody chat --context-repo host/org/repo -m 'question' | Never | Adds context from a repository that your Sourcegraph instance has indexed. |
Piped input | git diff | cody chat --stdin -m 'summarize' | Never | Sends whatever the previous command printed, so secrets in that output go along with it. |
- The documented CLI is a chat client. The risk is mostly what you send: each --context-file, piped diff or repository reference goes to your Sourcegraph instance and the model provider your admin configured.
- Sign-in uses a Sourcegraph access token. cody auth login stores it in your operating system's secure storage, and the docs advise against exporting the token variables in a shell startup script because every command would then see it.
- Which models answer, and where your text is sent, is decided by the Sourcegraph administrator through model configuration, not by the CLI.
- I found no public security advisory for the Cody CLI, and the public code repository was archived in August 2025, so a flaw found now may not get a public fix before the January 31, 2027 end of life.
- cody auth login saves the access token in the system secure storage (Keychain on macOS, Credential Manager on Windows, secret-tool on Linux). For sign-in without storing anything, set SRC_ENDPOINT and SRC_ACCESS_TOKEN instead.
Security incidents and advisories
No public security advisories for Sourcegraph Cody CLI turned up when this page was checked on December 2, 2026. That isn't proof there are none, so keep an eye on its release notes.
How to run Sourcegraph Cody CLI safely
- Plan the move off Cody now. End of life is January 31, 2027, and Sourcegraph asks customers to contact their account team about the transition.
- Authenticate with cody auth login so the token goes into your operating system's secure storage, or pass SRC_ENDPOINT and SRC_ACCESS_TOKEN for a single command. Do not export them in a shell startup file.
- Use a Sourcegraph access token with the narrowest rights your admin allows, and revoke it under Account Settings when you stop using the CLI.
- Check what you pipe in. Run git diff or file output through a quick read before sending it with --stdin, and keep .env files and key files out of --context-file.
- Ask your Sourcegraph administrator which model providers are configured in modelConfiguration, since that decides where your code text ends up.
- Run cody chat only on repositories you are allowed to share with your Sourcegraph instance, and treat model answers as suggestions to review before you copy them.
- Do not rely on the archived public repository for fixes. Check Sourcegraph's own release notes for the version you use.
- If you want an agent that edits files and runs commands, use a different tool and read its permission settings, because the Cody CLI is documented as chat only.
Where Excellent fits
| What Excellent does | With Sourcegraph Cody CLI |
|---|---|
Reads its session logs (free scan) | Yes |
Its key finder reads its key files | Yes |
Live check before risky actions (Pro) | No |
Excellent's sandbox | Claude Code and Codex only |
Rule sharing | Claude Code and Codex only |
Excellent reads Sourcegraph Cody CLI's session logs on your Mac. The free scan shows what it did: your email in request commands or form inputs, keys sitting in logs, secrets files read, history overwritten, checks skipped. Each finding says which agent and where.
Excellent's sandbox and rule sharing are for Claude Code and Codex only. The check reads what a command says, so it isn't a wall around your Mac.
Questions
Is Sourcegraph Cody discontinued?
Partly. Cody Free and Pro ended on July 23, 2025, and on November 9, 2026 Sourcegraph announced that Cody, including its Enterprise offering, reaches end of life on January 31, 2027.
Can I still install the Cody CLI?
The Sourcegraph docs still show npm install -g @sourcegraph/cody and the cody chat command. You need a Sourcegraph instance and an access token, which in practice means a Cody Enterprise account.
Does the Cody CLI run commands or edit my files?
Not in anything I read. The documented command is cody chat, which sends your message and any context you attach and prints an answer. I found no permission modes because there is no documented tool use.
What replaces Cody?
Sourcegraph names Deep Search and its MCP integrations for code understanding, and said Amp was the path for former Free and Pro users. Amp has since become an independent company, and Sourcegraph says none of these is a full one-for-one replacement.
Where does the CLI store my token?
cody auth login saves it in your operating system's secure storage: the security tool on macOS, CredentialManager on Windows and secret-tool on Linux. You can skip storage by using environment variables.
Sources
Checked December 2, 2026. Sourcegraph Cody CLI changes often, so its own docs win where they differ from this page.
- Sourcegraph: Sunsetting Sourcegraph Cody
- Sourcegraph: Changes to Cody Free, Pro, and Enterprise Starter plans
- Sourcegraph docs: Install Cody CLI
- Sourcegraph docs: Cody clients
- Sourcegraph docs: Cody Enterprise model configuration
- Sourcegraph self-hosted 7.0 changelog
- Cody public snapshot repository (archived)
- Cody public snapshot: cli README
