Gradient Code is a local-first coding assistant that lets you use DigitalOcean Gradient-hosted models through an application-owned tool runtime instead of a proprietary built-in tool stack.
It is designed to feel closer to a real coding agent than a plain chat wrapper:
- a terminal app you can launch with
gradient_code - an Electron desktop app with a conversational UI
- shared runtime logic across CLI and desktop
- repo inspection, code editing, review, planning, research, and command execution
- approval flows, diff previews, retries, timeouts, and resumable sessions
Gradient Code sits between:
- a model hosted on DigitalOcean Gradient
- your local workspace
- a set of application-managed tools
That means the model does not depend on OpenAI-only built-in tools. Instead, the app:
- sends the model a system prompt plus tool schemas
- receives tool calls from the model
- executes those tools locally
- returns tool results to the model
- repeats until the task is complete
This makes it possible to use models such as kimi-k2.5, glm-5, minimax-m2.5, Claude-family models, OpenAI-family models, and other Gradient-supported models through the same coding workflow.
- ask questions about a codebase
- review changes for bugs and missing tests
- make phased implementation plans
- inspect files and symbols
- edit code with patches or file writes
- run shell commands with approval
- use AST-aware JS/TS code intelligence tools
- do approval-gated web research
- resume previous sessions in the same workspace
- work from either the terminal or the desktop app
Both the CLI and desktop app use the same core runtime for:
- provider requests
- tool execution
- approvals
- retries and timeouts
- session persistence
- prompt presets
The Electron app includes:
- workspace picker
- model selector
- session history
- inline activity summaries inside the conversation
- command log and debug console
- approval modal for sensitive actions
- collapsible run details
- resumable conversations
- session deletion from the UI
The terminal interface supports:
- single-prompt runs
- resumable sessions
- saved workspace defaults
- tool activity output
- prompt presets
- configurable timeouts and retries
- installation as a global
gradient_codecommand
The toolset is broader than simple file read/write:
- workspace orientation
get_cwdinspect_pathlist_fileslist_tree
- file reading and search
read_fileread_many_filessearch_text
- JS/TS code intelligence
find_symbolfind_referenceslist_exportslist_importsast_edit
- editing
replace_in_filewrite_filecreate_fileapply_patch
- git-aware review and planning
git_statusgit_changed_filesgit_changed_file_summariesgit_diffgit_recent_commitsestimate_test_impact
- web research
web_searchfetch_url
- shell and long-running commands
run_commandstart_command_sessionread_process_outputsend_process_inputclose_command_session
Gradient Code includes:
- provider retry/backoff
- provider and tool timeouts
- tool schema validation
- model-aware endpoint fallback between
/v1/chat/completionsand/v1/responses - workspace-scoped file writes
- diff previews before edits
- approval gating for sensitive actions
- command-session persistence
- blocking for a small set of destructive shell commands
packages/shared- shared types and contracts
packages/core- agent loop, prompts, config, sessions, approvals
packages/provider-gradient- DigitalOcean Gradient provider adapter
packages/tools- local tools, git tools, web tools, command tools, code intelligence
packages/cli- terminal entrypoint
packages/desktop- Electron desktop shell
bin/gradient_code.js- CLI launcher for the global
gradient_codecommand
- CLI launcher for the global
The provider layer is built to work with different model families:
- native
/v1/chat/completionssupport - native
/v1/responsessupport - model-specific endpoint preferences
- model alias normalization
- model capability profiles for streaming, tool prompting, and endpoint selection
- Node.js
- npm
- a DigitalOcean Gradient
MODEL_ACCESS_KEY
npm installCopy env.example to .env:
cp env.example .envThen set:
MODEL_ACCESS_KEY- optionally
GRADIENT_BASE_URL - optionally
GRADIENT_MODEL
Current example values are in env.example.
Build the workspace and launch the Electron shell:
npm run build
npm run desktopInside the app you can:
- pick a workspace from Finder
- choose a model from the dropdown
- select a mode like
Ask,Review,Plan,Implement, orResearch - chat with the repo
- approve or deny sensitive actions
- reopen saved sessions
Run the TypeScript CLI directly:
npm run dev -- "summarize this repository"Example with a model and workspace:
npm run dev -- --model kimi-k2.5 --cwd /path/to/repo "tell me about this workspace"Build and run the packaged CLI entrypoint:
npm run build
npm start -- "review the current changes for bugs and missing tests"If you want a standalone terminal command:
npm run build
npm linkThen use:
gradient_code "summarize this repository"
gradient_code --cwd /path/to/repo "tell me about this workspace"
gradient_code --preset review "review the current changes for bugs and missing tests"
gradient_code --preset plan "make a phased implementation plan for adding auth"
gradient_code --preset implement "fix the failing test and explain the change"Base usage:
gradient_code [--model MODEL] [--cwd PATH] [--approve-all] [--no-store] [--no-preview-writes] [--session ID] [--resume-last] [--max-turns N] "your prompt"Supported CLI options:
--model MODEL- choose the model
--cwd PATH- choose the workspace
--preset default|review|plan|implement|research- set the task mode
--approve-all- skip per-action approvals
--no-store- disable app-level response storage for the run
--no-preview-writes- disable diff previews in edit approvals
--max-turns N- cap the agent loop
--session ID- resume a specific saved session
--resume-last- resume the most recent session in the workspace
--save-config- save current settings into
gradient-code.config.json
- save current settings into
--print-config- print resolved runtime config
--provider-timeout-ms N- set provider timeout
--tool-timeout-ms N- set tool timeout
--retry-count N- set provider retry count
gradient_code "tell me about this workspace"gradient_code --preset review "review the current changes for bugs and missing tests"gradient_code --preset plan "make a phased implementation plan for multiplayer support"gradient_code --preset implement "add a logout button and wire up the handler"gradient_code --retry-count 3 --provider-timeout-ms 90000 --tool-timeout-ms 60000 "run the tests and fix the first failure"gradient_code --model kimi-k2.5 --preset review --save-config "hello"gradient_code --print-configThe app supports five high-level modes:
Ask- general repository exploration and explanation
Review- bugs, regressions, risks, and missing tests
Plan- phased implementation planning
Implement- inspect, edit, and validate changes
Research- external comparison and source gathering
These modes map to prompt presets in the shared runtime and are available in both CLI and desktop workflows.
Per-workspace session state is saved under:
.gradient-code/sessions/
Conversation transcripts are also written under:
.gradient-code/
Workspace defaults are stored in:
gradient-code.config.json
Config fields currently supported:
{
"model": "kimi-k2.5",
"baseUrl": "https://inference.do-ai.run/v1",
"storeResponses": true,
"previewEdits": true,
"approveAll": false,
"maxTurns": 12,
"providerTimeoutMs": 60000,
"toolTimeoutMs": 45000,
"retryCount": 2,
"preset": "default",
"includeProjectNotes": true,
"projectNotesPath": ".gradient-code/project-notes.md"
}If enabled, project notes are loaded from:
.gradient-code/project-notes.md
You can use this file for durable context such as:
- architecture notes
- conventions
- known issues
- preferred commands
- project-specific constraints
Sensitive actions are approval-gated unless you explicitly allow them.
This includes actions such as:
- file edits
- shell commands
- long-running command sessions
- web research
Important guardrails:
- writes are scoped to the selected workspace
- edit tools can show diffs before approval
- destructive shell patterns are blocked by policy
- non-git folders are treated as informational, not as hard failures
Useful scripts:
npm run typecheck
npm run build
npm run dev -- "hello"
npm run desktop- the desktop app and CLI share the same backend runtime
- JS/TS codebases get the strongest code-intelligence support because AST-aware tools currently use the TypeScript compiler API
- some models are better suited to coding than others; the provider layer applies model-specific capability hints automatically
- web research tools are approval-gated and intended for cases where external information is actually needed
Gradient Code is an attempt to make a reusable, provider-flexible coding agent shell:
- not locked to one proprietary app runtime
- not dependent on one model vendor
- able to run the same agent loop from terminal or GUI
- able to own its own tool stack, approvals, and safety model
If you want a Codex-like or Claude Code-like workflow on top of DigitalOcean Gradient-hosted models, that is the core goal of this repo.
