jcode:极致性能的编码智能体运行框架
英文标题:🔥 1jehuang/jcode
jcode 是一款为性能与资源效率而生的编码 Agent 运行时。基准测试显示,关闭本地嵌入时单会话内存仅 27.8 MB,启动至首帧仅 14 ms,分别比 Claude Code 节省 13 倍内存、快 245 倍。多会话内存增量低至约 9.9 MB,并内置语义记忆、多 Agent 协作(Swarm)以及覆盖 Claude、OpenAI 等十余种提供商的 OAuth 登录。对开发者而言,jcode 意味着能以极低成本运行大量并发 Agent 工作流,极大提升交互响应与规模化效率。
381.8 KB
201.8 KB
496.8 KB
34.8 KB
中文
macOS & Linux
curl -fsSL https://jcode.sh/install | bash
Windows 11 (PowerShell 5.1+)
irm https://jcode.sh/install.ps1 | iex
需要 Homebrew、源码构建、提供程序设置,或者想要一个 Agent 来帮你设置?跳转到详细安装指南。
性能与资源效率
jcode 旨在大幅提升性能并尽可能降低资源占用。每一项指标都被优化到了极致,这对扩展多会话工作流至关重要。下面我们采样几项指标来展示差异:内存使用和启动速度。
1 个活跃会话 | 工具 | PSS | 对比
---|---|---
jcode (关闭本地嵌入) | 27.8 MB | 基准
jcode | 167.1 MB | 6.0 倍额外内存
pi | 144.4 MB | 5.2 倍额外内存
Codex CLI | 140.0 MB | 5.0 倍额外内存
OpenCode | 371.5 MB | 13.4 倍额外内存
GitHub Copilot CLI | 333.3 MB | 12.0 倍额外内存
Cursor Agent | 214.9 MB | 7.7 倍额外内存
Claude Code | 386.6 MB | 13.9 倍额外内存
Antigravity CLI | 243.7 MB | 8.8 倍额外内存
10 个活跃会话 | 工具 | PSS | 对比
---|---|---
jcode (关闭本地嵌入) | 117.0 MB | 基准
jcode | 260.8 MB | 2.2 倍额外内存
pi | 833.0 MB | 7.1 倍额外内存
Codex CLI | 334.8 MB | 2.9 倍额外内存
OpenCode | 3237.2 MB | 27.7 倍额外内存
GitHub Copilot CLI | 1756.5 MB | 15.0 倍额外内存
Cursor Agent | 1632.4 MB | 14.0 倍额外内存
Claude Code | 2300.6 MB | 19.7 倍额外内存
Antigravity CLI | 1021.2 MB | 8.7 倍额外内存
工具 | 首次帧渲染时间 | 范围 | 对比
---|---|---
jcode | 14.0 ms | 10.1–19.3 ms | 基准
Antigravity CLI | 383.5 ms | 363.1–415.4 ms | 慢 27.4 倍
pi | 590.7 ms | 369.6–934.8 ms | 慢 42.2 倍
Codex CLI | 882.8 ms | 742.3–1640.9 ms | 慢 63.1 倍
OpenCode | 1035.9 ms | 922.5–1104.4 ms | 慢 74.0 倍
GitHub Copilot CLI | 1518.6 ms | 1357.4–1826.8 ms | 慢 108.5 倍
Cursor Agent | 1949.7 ms | 1711.0–2104.8 ms | 慢 139.3 倍
Claude Code | 3436.9 ms | 2032.7–8927.2 ms | 慢 245.5 倍
数据来自在同一台 Linux 机器上进行的 10 次交互式 PTY 启动。
(时间指探针文本出现在渲染屏幕上的时刻;Antigravity 使用其内部输入就绪日志标记,因为登录界面会抑制探针回显。)
工具 | 首次输入就绪时间 | 范围 | 对比
---|---|---
jcode | 48.7 ms | 30.3–62.7 ms | 基准
Antigravity CLI | 383.7 ms | 363.4–415.7 ms | 慢 7.9 倍
pi | 596.4 ms | 373.9–955.2 ms | 慢 12.2 倍
Codex CLI | 905.8 ms | 760.1–1675.7 ms | 慢 18.6 倍
OpenCode | 1047.9 ms | 931.1–1116.9 ms | 慢 21.5 倍
GitHub Copilot CLI | 1583.4 ms | 1422.8–1880.0 ms | 慢 32.5 倍
Cursor Agent | 1978.7 ms | 1727.3–2130.0 ms | 慢 40.6 倍
Claude Code | 3512.8 ms | 2137.4–9002.0 ms | 慢 72.2 倍
数据来自在同一台 Linux 机器上进行的 10 次交互式 PTY 启动。本次运行中 Antigravity CLI 未经身份验证;其登录屏幕正常渲染并发出内部 CLI ready for user input 标记,但未回显输入的探针。
多客户端 / 内存扩展
| 工具 | 每新增会话的额外 PSS | 对比 |
|---|---|---|
| jcode (关闭本地嵌入) | 约 9.9 MB | 基准 |
| jcode | 约 10.4 MB | 1.1 倍额外内存 |
| pi | 约 76.5 MB | 7.7 倍额外内存 |
| Codex CLI | 约 21.6 MB | 2.2 倍额外内存 |
| OpenCode | 约 318.4 MB | 32.2 倍额外内存 |
| GitHub Copilot CLI | 约 158.1 MB | 16.0 倍额外内存 |
| Cursor Agent | 约 157.5 MB | 15.9 倍额外内存 |
| Claude Code | 约 212.7 MB | 21.5 倍额外内存 |
| Antigravity CLI | 约 86.4 MB | 8.7 倍额外内存 |
本次修正内存重新测试涉及的版本:
jcode v0.9.1888-dev (be386f2)pi 0.62.0codex-cli 0.120.0opencode 1.0.203- 单会话重新测试使用
GitHub Copilot CLI 1.0.24,10 会话重新测试使用GitHub Copilot CLI 1.0.27 Cursor Agent 2026.04.08-a41fba1Claude Code 2.1.86 (Claude Code)Antigravity CLI 1.0.0
jcode 性能演示
记忆系统
Jcode 将每次对话轮次/响应嵌入为语义向量。每一轮都会查询记忆图谱,通过余弦相似度检查高效找到相关记忆条目。嵌入命中的结果会被注入对话,或者可选择使用记忆侧代理来验证记忆是否相关,并可能在注入对话前进行更多信息检索工作。这形成了一种人类般的记忆系统,使 Agent 能够自动回忆与对话相关的信息,无需主动调用记忆工具或消耗大量 token。
回忆记忆的前提是必须先提取并存储记忆。每隔一段时间(基于语义漂移、上次提取后的 K 轮、会话结束等),记忆将通过记忆侧代理提取并存入记忆图谱。
该框架还提供了显式记忆工具,使 Agent 能够主动搜索或存储记忆,而不依赖被动后台进程。此外,它还提供针对过往会话的传统 RAG 搜索。
记忆会通过环境模式定期进行自动整合,包括重组、检查时效性和冲突等。
jcode 记忆演示
用户界面:侧边面板、图表、信息小部件、渲染、滚动与对齐
侧边面板是显示辅助信息的地方。告诉你的 jcode Agent 将文件加载到侧边面板并实时查看其更新,或让 Agent 直接写入侧边面板,也可将其用作差异查看器。侧边面板(以及聊天界面)能够内联渲染 mermaid 图表。 
为此,我开发了一个新的 mermaid 渲染库,渲染速度快了 1800 倍,无需浏览器或 TypeScript 依赖。详见 https://github.com/1jehuang/mermaid-rs-renderer
为了在不占用可用于响应的屏幕空间的情况下显示重要信息,我开发了信息小部件。信息小部件只会在屏幕的负空间区域展示信息,并在空间不足时自动让开。
Jcode 可以以超过一千帧每秒的速度渲染。你的显示器可能达不到这个刷新率,但这意味着你不会遇到恼人的闪烁问题。
jcode 的自定义回滚实现使其能完成远超原生回滚的功能。然而,受限于终端层面,自定义回滚无法做到平滑的部分行滚动。为解决这一问题,我开发了自己的终端 Handterm https://github.com/1jehuang/handterm,它实现了原生滚动 API,且恰好非常高效。这项工作仍在进行中。在普通终端上,滚动也已经实现得很好。
Jcode 默认左对齐。你可以通过 Alt+C 快捷键、/alignment 命令或在配置中切换到居中模式。
协作与 Swarm
在同一个代码仓库中生成两个或更多 Agent,它们将被服务器自动管理,以实现原生协作。当 Agent A 编辑了 Agent B 已读取的文件(代码在其脚下发生变化),服务器会通知 Agent B。Agent B 可以在无关时忽略,也可以查看差异以确保不会冲突。每个 Agent 都具备消息传递能力,可以向单个 Agent 发送私信,向服务器托管的所有其他 Agent 广播,或仅向同一仓库中的 Agent 广播。这使你能够在同一仓库中创建多个会话,并自动解决所有冲突。
jcode swarm 演示
Agent 还能够自主生成自己的 Swarm。它们拥有一个 Swarm 工具,允许自行生成队友以并行完成任务。这样做会将主代理转变为协调者,生成的代理则成为工作者。Agent 组、它们的消息通道、完成状态等都会被自动管理。这可以无界面或有界面运行。
模型访问与身份认证
jcode 支持基于订阅的 OAuth 流程和众多提供商集成,因此你可以使用已付费的模型,并在需要时回退到直接的 API 提供商。
支持的内置登录流程
- Claude (
jcode login --provider claude) - OpenAI / ChatGPT / Codex (
jcode login --provider openai) - Google Gemini (
jcode login --provider gemini) - GitHub Copilot (
jcode login --provider copilot) - Azure OpenAI (
jcode login --provider azure) - 阿里云 Coding Plan (
jcode login --provider alibaba-coding-plan) - Fireworks (
jcode login --provider fireworks) - MiniMax (
jcode login --provider minimax) - LM Studio (
jcode login --provider lmstudio) - Ollama (
jcode login --provider ollama) - 自定义 OpenAI 兼容端点 (
jcode login --provider openai-compatible)
对于自定义 OpenAI 兼容端点,jcode 现在会提示输入 API 基础地址,并支持本地 localhost 服务器而无需 API 密钥。
自托管端点和 MCP 的配置文件设置
如果你更倾向于通过编辑文件而非使用登录界面进行配置,jcode 同时支持自定义 OpenAI 兼容端点配置和 MCP 配置文件。
OpenAI 兼容的提供商
许多托管服务遵循标准 OpenAI /v1/chat/completions API 接口。jcode 通过一个共享的 OpenAI 兼容提供商与它们通信,因此你几乎可以使用任何此类端点而无需等待专门的集成。
有两种设置方式:
-
内置命名配置文件 — jcode 内置了针对多个流行 OpenAI 兼容服务的现成配置文件。通过 ID 登录,jcode 会自动填写基础 URL 和密钥环境变量:
jcode login --provider <profile-id> # 例如: jcode login --provider openrouter jcode login --provider deepseek jcode login --provider opencode # OpenCode Zen jcode login --provider moonshotai
内置的 OpenAI 兼容配置文件 ID 包括:openrouter、deepseek、zai、kimi、moonshotai、opencode (OpenCode Zen)、opencode-go、302ai、baseten、cortecs、huggingface、nebius、scaleway、stackit 和 firmware。每个配置文件仅设置端点和密钥变量;你仍需通过 /model(或 --model)选择模型。运行 jcode login 时不带任何提供商参数可以查看交互式列表。
- 任何其他端点 — 使用
jcode login --provider openai-compatible或下文描述的脚本化jcode provider add命令,将 jcode 指向任意 OpenAI 兼容 API(托管或本地)。
针对这些端点的有用环境变量覆盖:
JCODE_STREAM_IDLE_TIMEOUT_SECS— 为在发出 token 前静默思考的慢速推理模型提高流式空闲超时(默认 180 秒)。也可以作为[provider] stream_idle_timeout_secs在config.toml中设置。- 在
[[providers.<name>.models]]条目中指定 Per-modelcontext_window(别名context_limit)— 当端点没有可用的/v1/models响应时,用于设置上下文窗口,避免 jcode 回退到通用的 200k 默认值。 extra_body— 将非标准顶级字段注入每个 chat/completions 请求体,适用于需要这些字段的后端。详见下文的额外请求体字段。
有关自托管、本地运行时和确切配置的详细信息...
English / 原文
# macOS & Linux
curl -fsSL https://jcode.sh/install | bash
# Windows 11 (PowerShell 5.1+)
irm https://jcode.sh/install.ps1 | iex
Need Homebrew, source builds, provider setup, or want an agent to set it up for you? Jump to detailed installation.
Performance & Resource Efficiency
jcode is built to be as performant and resource efficient as possible. Every metric is optimized to the bone, which is important for scaling multi-session workflows. Here we sample a few metrics to show the difference: RAM usage and boot up.
1 active session | Tool | PSS | Comparison
---|---|---
jcode (local embedding off) | 27.8 MB | baseline
jcode | 167.1 MB | 6.0× more RAM
pi | 144.4 MB | 5.2× more RAM
Codex CLI | 140.0 MB | 5.0× more RAM
OpenCode | 371.5 MB | 13.4× more RAM
GitHub Copilot CLI | 333.3 MB | 12.0× more RAM
Cursor Agent | 214.9 MB | 7.7× more RAM
Claude Code | 386.6 MB | 13.9× more RAM
Antigravity CLI | 243.7 MB | 8.8× more RAM
| 10 active sessions | Tool | PSS | Comparison
---|---|---
jcode (local embedding off) | 117.0 MB | baseline
jcode | 260.8 MB | 2.2× more RAM
pi | 833.0 MB | 7.1× more RAM
Codex CLI | 334.8 MB | 2.9× more RAM
OpenCode | 3237.2 MB | 27.7× more RAM
GitHub Copilot CLI | 1756.5 MB | 15.0× more RAM
Cursor Agent | 1632.4 MB | 14.0× more RAM
Claude Code | 2300.6 MB | 19.7× more RAM
Antigravity CLI | 1021.2 MB | 8.7× more RAM
| Tool | Time to first frame | Range | Comparison |
|---|---|---|---|
| jcode | 14.0 ms | 10.1–19.3 ms | baseline |
| Antigravity CLI | 383.5 ms | 363.1–415.4 ms | 27.4× slower |
| pi | 590.7 ms | 369.6–934.8 ms | 42.2× slower |
| Codex CLI | 882.8 ms | 742.3–1640.9 ms | 63.1× slower |
| OpenCode | 1035.9 ms | 922.5–1104.4 ms | 74.0× slower |
| GitHub Copilot CLI | 1518.6 ms | 1357.4–1826.8 ms | 108.5× slower |
| Cursor Agent | 1949.7 ms | 1711.0–2104.8 ms | 139.3× slower |
| Claude Code | 3436.9 ms | 2032.7–8927.2 ms | 245.5× slower |
Measured on this Linux machine across 10 interactive PTY launches.
(time until typed probe text appears on the rendered screen; Antigravity uses its internal input-ready log marker because the sign-in screen suppresses probe echo.)
| Tool | Time to first input | Range | Comparison |
|---|---|---|---|
| jcode | 48.7 ms | 30.3–62.7 ms | baseline |
| Antigravity CLI | 383.7 ms | 363.4–415.7 ms | 7.9× slower |
| pi | 596.4 ms | 373.9–955.2 ms | 12.2× slower |
| Codex CLI | 905.8 ms | 760.1–1675.7 ms | 18.6× slower |
| OpenCode | 1047.9 ms | 931.1–1116.9 ms | 21.5× slower |
| GitHub Copilot CLI | 1583.4 ms | 1422.8–1880.0 ms | 32.5× slower |
| Cursor Agent | 1978.7 ms | 1727.3–2130.0 ms | 40.6× slower |
| Claude Code | 3512.8 ms | 2137.4–9002.0 ms | 72.2× slower |
Measured on this Linux machine across 10 interactive PTY launches. Antigravity CLI was unauthenticated for this run; its sign-in screen rendered normally and emitted an internal CLI ready for user input marker, but did not echo the typed probe.
Additional clients / memory scaling
| Tool | Extra PSS per added session | Comparison |
|---|---|---|
| jcode (local embedding off) | ~9.9 MB | baseline |
| jcode | ~10.4 MB | 1.1× more RAM |
| pi | ~76.5 MB | 7.7× more RAM |
| Codex CLI | ~21.6 MB | 2.2× more RAM |
| OpenCode | ~318.4 MB | 32.2× more RAM |
| GitHub Copilot CLI | ~158.1 MB | 16.0× more RAM |
| Cursor Agent | ~157.5 MB | 15.9× more RAM |
| Claude Code | ~212.7 MB | 21.5× more RAM |
| Antigravity CLI | ~86.4 MB | 8.7× more RAM |
versions tested for this corrected memory rerun:
jcode v0.9.1888-dev (be386f2)pi 0.62.0codex-cli 0.120.0opencode 1.0.203GitHub Copilot CLI 1.0.24for the 1-session rerun,GitHub Copilot CLI 1.0.27for the 10-session rerunCursor Agent 2026.04.08-a41fba1Claude Code 2.1.86 (Claude Code)Antigravity CLI 1.0.0
jcode performance demonstration
Jcode embeds each turn/response as a semantic vector. Every turn does queries a graph of memories to efficiently find related memory entries via a cosine similarity check. The embedding hits are fed into the conversation, or optionally uses a memory sideagent which verifies the memories are relevant, and potentially does more work for information retreival before injecting into the conversation. This results in a human like memory system which allows the agent to automatically recall relevant information to the conversation without actively calling memory tools or being a token burner. ot To have memories which are retrieved, they must also be extracted and stored. Every so often (semantic drift, K turns since last extraction, session end, etc), memories are extracted via a memory sideagent, and put into the memory graph.
The harness also provides explicit memory tools to allow the agent to actively search or store the memory without relying on a passive background process. The harness also provides session search for traditional RAG on previous sessions.
Memories are automatically consolidated every so often via the ambient mode. This reorganizes, checks for staleness and conflicts, etc
jcode memory demonstration
UI: Side panels, Diagrams, Info Widgets, rendering, scrolling, alignment
The side panel is a place for auxiliary information. Tell your jcode agent to load a file into the side panel and see it update in real time, or tell your agent to write directly to the side panel, or use it as a diff viewer. The side panel (and chat) is able to render mermaid diagrams inline. 
To make this possible, I created a new mermaid rendering library to render diagrams 1800x faster. It has no browser or Typescript dependency. See https://github.com/1jehuang/mermaid-rs-renderer
To show you important information without taking space away from the screen that could be used for responses, I developed info widgets. Info widgets will only ever take up the negative space on the screen to show you information, and will get out of the way if there isn't any.
Jcode can render at over a thousand fps. Your monitor will not have the refresh rate to show you, but this means you will not have silly flicker problems.
The custom scrollback implementation of jcode allows it to do much more than a native scrollback. However, it is a terminal-level limitation that I cannot have smooth, partial line scrolling with a custom scrollback. To fix this, I made my own terminal. Handterm https://github.com/1jehuang/handterm implements a native scroll api, and also happens to be very effiecent. This is a work in progress. Scrolling is still well implemented for normal terminals.
Jcode is left-aligned by default. You can switch to centered mode with the Alt+C hotkey, with the /alignment command, or in the config.
Spawn two or more agents in the same repo, and they will automatically be managed by the server to allow native collaboration. When agent A edits a file that agent B has read (code shifting under its feet), the server notifies agent B. Agent B can ignore it if it is not relevant, or it can check the diff to make sure that it doesn't conflict. Each agent has messaging abilities, capable of DMing just one agent, broadcasting to all other agents hosted by the server, or just agents working in that repo. This allows you to spawn multiple sessions in the same repo, and have all conflicts automatically resolved.
jcode swarm demonstration
Agents are also able to spawn their own swarms autonomously. They have a swarm tool which allows them to spawn in their own teamates to accomplish tasks in parallel. Doing so turns the main agent into a coordinator and the spawned agents into workers. Groups of agents, their messaging channels, their completion statuses, etc are all automatically managed. This can be done headlessly or headed.
jcode works with subscription-backed OAuth flows and many provider integrations, so you can use the models you already pay for and still fall back to direct API providers when needed.
Supported built-in login flows
- Claude (
jcode login --provider claude) - OpenAI / ChatGPT / Codex (
jcode login --provider openai) - Google Gemini (
jcode login --provider gemini) - GitHub Copilot (
jcode login --provider copilot) - Azure OpenAI (
jcode login --provider azure) - Alibaba Cloud Coding Plan (
jcode login --provider alibaba-coding-plan) - Fireworks (
jcode login --provider fireworks) - MiniMax (
jcode login --provider minimax) - LM Studio (
jcode login --provider lmstudio) - Ollama (
jcode login --provider ollama) - Custom OpenAI-compatible endpoint (
jcode login --provider openai-compatible)
For custom OpenAI-compatible endpoints, jcode now prompts for the API base and supports local localhost servers without requiring an API key.
Config-file setup for self-hosted endpoints and MCP
If you prefer to configure things by editing files instead of using the login UI, jcode supports both a custom OpenAI-compatible endpoint config and MCP config files.
OpenAI-compatible providers
Many hosted services speak the standard OpenAI /v1/chat/completions API. jcode talks to them through one shared OpenAI-compatible provider, so you can use almost any such endpoint without waiting for a dedicated integration.
There are two ways to set one up:
-
Built-in named profiles — jcode ships ready-made profiles for several popular OpenAI-compatible services. Log in by id and jcode fills in the base URL and key environment variable for you:
jcode login --provider <profile-id> # for example: jcode login --provider openrouter jcode login --provider deepseek jcode login --provider opencode # OpenCode Zen jcode login --provider moonshotai
Built-in OpenAI-compatible profile ids include: openrouter, deepseek, zai, kimi, moonshotai, opencode (OpenCode Zen), opencode-go, 302ai, baseten, cortecs, huggingface, nebius, scaleway, stackit, and firmware. Each profile only sets the endpoint and key variable; you still pick the model with /model (or --model). Run jcode login with no provider to see the interactive list.
- Any other endpoint — point jcode at an arbitrary OpenAI-compatible API (hosted or local) with
jcode login --provider openai-compatibleor the scriptablejcode provider addcommand described below.
Useful environment overrides for these endpoints:
JCODE_STREAM_IDLE_TIMEOUT_SECS— raise the streaming idle timeout (default 180s) for slow reasoning models that think silently before emitting tokens. Also settable as[provider] stream_idle_timeout_secsinconfig.toml.- Per-model
context_window(aliascontext_limit) in a[[providers.<name>.models]]entry — set the context window when the endpoint has no usable/v1/modelsresponse, so jcode does not fall back to the generic 200k default. extra_body— inject non-standard top-level fields into every chat/completions request body for backends that require them. See Extra request-body fields below.
For details on self-hosting, local runtimes, and the exact config file shape, see below.
Self-hosted OpenAI-compatible endpoints, including vLLM
For agents and scripts, the preferred path is the one-shot provider profile command. It writes a named profile to ~/.jcode/config.toml, stores secrets in jcode's private app config directory when requested, and prints exact run/validation commands:
# Secret-safe setup for a hosted OpenAI-compatible API.
printf '%s' "$MY_API_KEY" | jcode provider add my-api \
--base-url https://llm.example.com/v1 \
--model my-model-id \
--api-key-stdin \
--set-default \
--json
# Smoke test the profile.
jcode --provider-profile my-api auth-test --prompt 'Reply exactly JCODE_PROVIDER_SETUP_OK'
# Use it directly.
jcode --provider-profile my-api run 'hello'
For local servers that do not require auth:
jcode provider add local-vllm \
--base-url http://localhost:8000/v1 \
--model Qwen/Qwen3-Coder-30B-A3B-Instruct \
--no-api-key \
--set-default
Built-in local profiles are available for the common desktop/local runtimes:
# Ollama: start the local server and install a model first.
ollama pull llama3.2
jcode login --provider ollama
jcode --provider ollama --model llama3.2 run 'hello'
# LM Studio: start the Local Server, load a chat model, then use the exact
# model identifier shown by LM Studio or by curl http://localhost:1234/v1/models.
jcode login --provider lmstudio
jcode --provider lmstudio --model '<model-id>' run 'hello'
Ollama and LM Studio both expose OpenAI-compatible /v1/models and /v1/chat/completions endpoints. jcode uses streaming chat completions, function/tool calling, and OpenAI-style image content for vision-capable local models. If a local server requires a token, enter it during jcode login or create a named profile with --api-key-stdin.
Useful flags:
--api-key-env NAME: reference an existing environment variable instead of storing a key.--api-key-stdin: read and store a key without putting it in shell history.--context-window TOKENS: persist the model context window for model selection and routing.--overwrite: replace an existing profile of the same name.--model-catalog: use the endpoint's/modelsresponse in addition to configured models.
The generated profile can also be edited manually in ~/.jcode/config.toml:
[provider]
default_provider = "my-api"
default_model = "my-model-id"
[providers.my-api]
type = "openai-compatible"
base_url = "https://llm.example.com/v1"
api_key_env = "JCODE_PROVIDER_MY_API_API_KEY"
env_file = "provider-my-api.env"
default_model = "my-model-id"
[[providers.my-api.models]]
id = "my-model-id"
context_window = 128000
Extra request-body fields (extra_body)
Some OpenAI-compatible backends require non-standard top-level request fields. For example, NVIDIA NIM DeepSeek-V4 reasoning models (deepseek-ai/deepseek-v4-flash, deepseek-ai/deepseek-v4-pro) only enable thinking when the request includes chat_template_kwargs; without it they reply without reasoning (or, for some deployments, hang). jcode lets you inject arbitrary top-level fields two ways.
-
Per named profile, via
extra_bodyinconfig.toml(a TOML table merged verbatim into the JSON body):[providers.my-nim] type = "openai-compatible" base_url = "https://integrate.api.nvidia.com/v1" api_key_env = "NVIDIA_API_KEY" default_model = "deepseek-ai/deepseek-v4-flash" [providers.my-nim.extra_body.chat_template_kwargs] thinking = true reasoning_effort = "high" -
For built-in profiles (e.g.
nvidia-nim) or any endpoint, via theJCODE_OPENAI_EXTRA_BODYenvironment variable (a JSON object string). It can live in the provider's env file (~/.config/jcode/nvidia-nim.env) next to the API key:JCODE_OPENAI_EXTRA_BODY={"chat_template_kwargs":{"thinking":true,"reasoning_effort":"high"}}
Keys from extra_body are merged last and override any jcode-generated body field with the same name (JCODE_OPENAI_EXTRA_BODY wins over the config extra_body on key collisions). Invalid values are logged and ignored rather than failing the request.
The custom OpenAI-compatible provider reads overrides from environment variables or from an env file in jcode's app config directory. On Linux this is usually ~/.config/jcode/, so the default file is usually:
~/.config/jcode/openai-compatible.env
Example for a local or LAN vLLM server:
JCODE_OPENAI_COMPAT_API_BASE=http://192.168.1.50:8000/v1
JCODE_OPENAI_COMPAT_DEFAULT_MODEL=Qwen/Qwen3-Coder-30B-A3B-Instruct
# Optional if your server expects auth
OPENAI_COMPAT_API_KEY=your-token-here
Notes:
jcode login --provider openai-compatiblecan create or update this for you.- Plain
http://is accepted forlocalhostand private LAN IPs. Public remote HTTP is still rejected. - HTTPS endpoints work as usual.
MCP config is separate from config.toml.
Primary config files:
~/.jcode/mcp.jsonfor global MCP servers.jcode/mcp.jsonfor project-local MCP servers
Claude Code compatibility:
~/.claude.json(Claude Code's user config): top-levelmcpServers, plus per-project servers underprojects.<abs_path>.mcpServersfor the current directory.mcp.jsonat the repo root (Claude Code's project config).claude/mcp.json(legacy fallback)
Both the canonical mcpServers key and jcode's historical servers key are accepted. jcode currently supports stdio (command-based) servers only; HTTP/SSE entries ("type": "http"/"sse") are recognized and skipped with a log line.
Example MCP config:
{
"mcpServers": {
"filesystem": {
"command": "/path/to/mcp-server",
"args": ["--root", "/workspace"],
"env": {},
"shared": true
}
}
}
On first run, jcode also tries to import MCP servers from ~/.claude.json (falling back to the legacy ~/.claude/mcp.json) and ~/.codex/config.toml if ~/.jcode/mcp.json does not exist yet.
For headless or SSH sessions, OAuth-style providers support jcode login --provider <provider> --no-browser (alias: --headless) so jcode prints the auth URL/QR and falls back to manual code or callback paste instead of trying to launch a local browser.
For more scriptable remote flows, claude, openai, gemini, and antigravity also support a two-step pattern:
# Step 1: print a resumable auth URL
jcode login --provider openai --print-auth-url --json
# Step 2: complete later with the callback URL or auth code
jcode login --provider openai --callback-url 'http://localhost:1455/auth/callback?...'
jcode login --provider gemini --auth-code '...'
Additional scriptable cases:
# Copilot device flow: print URL + user code, then complete later
jcode login --provider copilot --print-auth-url --json
jcode login --provider copilot --complete
# Gmail/Google OAuth after credentials are already configured
jcode login --provider google --print-auth-url --google-access-tier readonly
jcode login --provider google --callback-url 'http://127.0.0.1:8456?...'
Pending scriptable login state is stored under ~/.jcode/pending-login/, automatically expires, and stale entries are cleaned up when new scriptable logins start or resume.
For the built-in OpenAI login flow, jcode opens a local callback on http://localhost:1455/auth/callback by default.
The above image is the first page of provider logins
- Native / first-party style providers:
claude,openai,copilot,gemini,azure,alibaba-coding-plan - Aggregator / compatibility providers:
openrouter,openai-compatible - Additional provider integrations:
opencode,opencode-go,zai/kimi,302ai,baseten,cortecs,deepseek,firmware,huggingface,moonshotai,nebius,scaleway,stackit,groq,mistral,perplexity,togetherai,deepinfra,fireworks,minimax,xai,lmstudio,ollama,chutes,cerebras,cursor,antigravity,google
Jcode also supports easy multi-account switching. Ran out of tokens on your first ChatGPT Pro subscription? /account and quickly switch to your second.
Customizability / Self-Dev
Jcode is inventing a new form of customizability. One that doesn't limit you to what a plugin or extension can do. Tell your jcode agent to enter self dev mode, and it will start modifying its own source code. Jcode is optimized to iterate on itself. There is significant infrastructure around self developement, which allows it to edit, build, and test its own source code, then reload its own binary and continue work in your (potentially many) sessions, fully automatically.
It is reccomended that you use a frontier model for this. The jcode codebase is not a simple one, and weaker models can make subtle, breaking changes. GPT 5.5 or the latest available frontier model works well.
The devil is in the details. There are many undocumented optimizations and niceties that jcode implements. Some examples:
Anthropic's Claude cache goes cold after 5 minutes. If you initiate Claude after these 5 minutes, you have a cache miss, potentially costing you lots of tokens. The ui warns you when the cache went cold, and notfies you if there was an unexpected cache miss.
jcode comes with instructions on how to set up Firefox Agent Bridge. Ask you agent to set it up, and then you will have browser automation in jcode as well.
Agent grep is a grep tool I made for the jcode agent. It adds file strucuture information (ie the list of functions, their displacement, etc) to the grep return, so that the agent can infer more of what the file doesn without actually reading the file. It also implements a harness-level integration that adaptively truncates returns based on what the agent has already seen. This saves on context a lot.
Inputs are by default interleaved with the working agent. It sends the input as soon as it safely can without breaking the KV cache. Submit with shift enter instead, and it will send a queue send, and wait for the agent to fully finish its turn before sending.
Resume sessions from different harnesses. Claude code broke on you? Resume the session from jcode and continue where you left off. Session resume is supported for codex, claude code, opencode, and pi.
image of /Resume for codex sessions
Skills are not all loaded on startup. The conversation is embedded as a semantic vector, and will automatically inject a skill if there is an embedding hit similar to memories. The agent has a skill tool for you to manually activate a skill at anytime. You may also activate via slash commands.
iOS Application / Native OpenClaw
A native iOS application version of jcode is coming soon. This will allow you to work with jcode on your personal machine's environment from your phone, via Tailscale. Openclaw like features will be bundled with this iOS application.
Agents dont like to commit in dirty git state with active changes. Git was clearly not built for multi-agent workflows, and git worktrees is not a good solution. Given this, I believe that is an opporunity for a new git like primitive to be born.
Build speed improvements: An incremental debug cargo build with cache enabled takes about 1 minute on my machine. The goal is 5-20 seconds. Refactors and crates seams should be able to make this happen.
# Launch the TUI
jcode
# Run a single command non-interactively
jcode run "say hello"
# Resume a previous session by memorable name
jcode --resume fox
# Run as a persistent background server, then attach more clients
jcode serve
jcode connect
# Send voice input from your configured STT command
jcode dictate
jcode supports interactive TUI use, non-interactive runs, persistent server/client workflows, and hotkey-friendly dictation without requiring a bundled speech-to-text stack.
jcode workflow demonstration
jcode includes a first-class built-in browser tool for browser control inside agent sessions.
Current built-in backend:
- Firefox via Firefox Agent Bridge
Current built-in tool actions include:
statussetupopensnapshotget_contentinteractablesclicktypefill_formselectwaitscreenshotevalscrolluploadpress
Quick setup:
jcode browser status
jcode browser setup
Once setup is complete, the model can use the built-in browser tool directly. The UI also summarizes browser tool calls compactly, for example opening a URL, clicking a selector, or typing into a field without echoing sensitive typed text.
Notes:
- the provider/tool architecture is in place for additional backends
- Firefox is the wired built-in backend today
- Chrome bridge / remote debugging style providers can be added on top of the same browser tool later
If you want another agent to set up jcode for you, give it this prompt:
Set up jcode on this machine for me.
1. Detect the operating system, available package managers, and shell environment, then install jcode using the best matching command below instead of referring me somewhere else:
- macOS with Homebrew available:
brew tap 1jehuang/jcode
brew install jcode
- macOS or Linux via install script:
curl -fsSL https://jcode.sh/install | bash
- Windows PowerShell:
irm https://jcode.sh/install.ps1 | iex
- From source if the above paths are not appropriate:
git clone https://github.com/1jehuang/jcode.git
cd jcode
cargo build --release
scripts/install_release.sh
- For local self-dev / refactor work on Linux x86_64, prefer:
scripts/dev_cargo.sh build --release -p jcode --bin jcode
scripts/dev_cargo.sh --print-setup
scripts/install_release.sh
2. Verify that `jcode` is on my `PATH`.
3. Launch `jcode` once in a new terminal window/session to confirm it starts successfully.
4. Before attempting any interactive login flow, assess which providers are already available non-interactively and prefer those first. Check existing local credentials, config files, CLI sessions, and environment variables such as:
- Claude: `~/.jcode/auth.json`, `~/.claude/.credentials.json`, `~/.local/share/opencode/auth.json`, `ANTHROPIC_API_KEY`
- OpenAI: `~/.jcode/openai-auth.json`, `~/.codex/auth.json`, `OPENAI_API_KEY`
- Gemini: `~/.jcode/gemini_oauth.json`, `~/.gemini/oauth_creds.json`
- GitHub Copilot: existing auth under `~/.config/github-copilot/`
- Azure OpenAI: `~/.config/jcode/azure-openai.env`, `AZURE_OPENAI_*`, or an existing `az login`
- OpenRouter: `OPENROUTER_API_KEY`
- Fireworks: `~/.config/jcode/fireworks.env`, `FIREWORKS_API_KEY`
- MiniMax: `~/.config/jcode/minimax.env`, `MINIMAX_API_KEY`
- NVIDIA NIM: `~/.config/jcode/nvidia-nim.env`, `NVIDIA_API_KEY`
- Alibaba Cloud Coding Plan: existing jcode config/env if present
5. Prefer whichever provider is already configured and verify it with `jcode auth-test --all-configured` or a provider-specific auth test when appropriate.
6. Only if no usable provider is already configured, guide me through the minimal manual step needed:
- Claude: `jcode login --provider claude`
- GitHub Copilot: `jcode login --provider copilot`
- OpenAI: `jcode login --provider openai`
- Gemini: `jcode login --provider gemini`
- Azure OpenAI: `jcode login --provider azure`
- Fireworks: `jcode login --provider fireworks`
- MiniMax: `jcode login --provider minimax`
- NVIDIA NIM: `jcode login --provider nvidia-nim`
- Alibaba Cloud Coding Plan: `jcode login --provider alibaba-coding-plan`
- OpenRouter: help me set `OPENROUTER_API_KEY`
- Anthropic direct API: help me set `ANTHROPIC_API_KEY`
7. After setup, run a simple smoke test with `jcode run "say hello"` and confirm it works.
8. If I want browser automation, also check `jcode browser status`. If browser automation is not ready, run `jcode browser setup`, verify the built-in `browser` tool works, and explain any remaining manual step.
9. Explain any manual step that still needs me, especially browser OAuth, device login, API key entry, or browser extension approval.
This is intended to be a copy-paste bootstrap prompt for jcode itself or any other coding agent.
# macOS & Linux
curl -fsSL https://jcode.sh/install | bash
On Termux, install the glibc runtime and patchelf first so the installer can patch the downloaded Linux binary to Termux's glibc dynamic linker and create a launcher that avoids Termux's LD_PRELOAD shim:
pkg install glibc patchelf
curl -fsSL https://jcode.sh/install | bash
# Windows 11 x64 or ARM64 (PowerShell 5.1+)
irm https://jcode.sh/install.ps1 | iex
The Windows installer selects the correct architecture and verifies the download against the release's SHA256SUMS. Alacritty and the optional global launch hotkey require explicit consent and are not installed by default. See Windows support, security, Defender, and SmartScreen notes.
If a release does not contain a matching Windows asset, the installer stops instead of unexpectedly starting a long compilation. An explicit source build is available with -BuildFromSource and requires Git, Rust, and Visual Studio 2022 Build Tools with the Desktop development with C++ workload.
brew tap 1jehuang/jcode
brew install jcode
From Source (all platforms)
git clone https://github.com/1jehuang/jcode.git
cd jcode
cargo build --release
For local self-dev / refactor work on Linux x86_64, prefer:
scripts/dev_cargo.sh build --release -p jcode --bin jcode
scripts/dev_cargo.sh --print-setup
That wrapper automatically uses sccache when available, prefers a fast working local linker setup (clang + lld) instead of assuming every machine's mold configuration is valid, and can print the active linker/cache setup via --print-setup so slow-path builds are easier to diagnose.
Then symlink to your PATH:
scripts/install_release.sh
Removes installed binaries and the launcher but keeps your config, auth, and sessions so a clean reinstall picks up where you left off:
curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/uninstall.sh | bash -s -- --yes
For a full wipe of everything including config, auth, sessions, logs, and memory (useful for recovering from a broken install):
curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/uninstall.sh | bash -s -- --purge --yes
Add --dry-run to preview what would be removed without deleting anything.
| Platform | Status |
|---|---|
| Linux x86_64 / aarch64 | Fully supported |
| macOS Apple Silicon & Intel | Supported |
| Windows x86_64 | Supported (native + WSL2) |
| Termux aarch64 / x86_64 | Supported with pkg install glibc patchelf |