jcode

module
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2026 License: MIT

README ยถ

[JCODE]

Think it. Code it.

jcode Overview

The AI coding agent that lives in your terminal.

Describe tasks in plain language. [J]CODE reads your codebase, writes surgical edits, runs commands, and shows every step โ€” no black boxes.

Works locally and on remote servers over SSH. Supports any OpenAI-compatible model.

๐Ÿ“– Documentation ยท Install ยท Features ยท Configuration ยท Changelog


jcode TUI

Why jcode?

Transparent by design Every tool call is visible. Approve or reject edits before they happen.
Plan before you act Plan Mode explores read-only and presents a structured plan for your review.
Parallel teams Spawn multiple AI teammates that work simultaneously on different tasks.
SSH anywhere All tools work seamlessly on remote machines โ€” same experience, zero friction.
Bring your own model Any OpenAI-compatible API. Switch models mid-session with one keystroke.

Install

curl -fsSL https://raw.githubusercontent.com/cnjack/jcode/main/script/install.sh | sh

From Source

Requires Go 1.22+ and Node.js + pnpm.

git clone https://github.com/cnjack/jcode.git
cd jcode
make install

Update

jcode update

Windows users: Windows locks the running .exe and prevents any file operation on it (including rename). jcode update will download the new version to <current-path>.new instead. Follow the printed instructions to exit jcode and manually replace the binary (e.g. move /Y "jcode.exe.new" "jcode.exe").

First launch creates ~/.jcode/config.json with a setup wizard. Run jcode doctor to verify model & MCP connectivity.

Features

Core Agent Loop

Describe a task in plain English. The agent reads your codebase, writes surgical edits, runs commands, and reports every step โ€” no black boxes.

Capability How it works
File operations Read, edit (string-level diffs), and write files with inline before/after display
Shell execution Run any command; output shown in a bordered box. Safe commands (ls, git status, โ€ฆ) auto-approved
Regex search grep tool with ripgrep fallback โ€” search across entire codebases in seconds
Todo tracking Live ๐Ÿ“‹ Todo (2/5) bar above the input area; agent updates progress automatically
Ask user Agent can prompt you with questions and choices mid-task when it needs clarification

๐Ÿค Agent Teams

Spawn multiple AI teammates that work in parallel, each with independent tools, conversation history, and environment. The lead agent coordinates; teammates idle until they receive an explicit message.

jcode Agent Teams

๐ŸŒ SSH โ€” work on any machine

Type /ssh user@host and every tool runs transparently on the remote host. No agents, no tunnels, no extra setup.

 You โ€บ /ssh deploy@10.0.1.5:/var/www/app

   โœ“ SSH  Connected ยท linux/amd64

 You โ€บ why is nginx restarting?

   โš™ Tool  execute  [deploy@10.0.1.5]  docker logs app-nginx-1 --tail 20

   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚  nginx: [emerg] bind() to 0.0.0.0:80 failed        โ”‚
   โ”‚  (98: Address already in use)                       โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

 โ—† Port 80 is already taken. Let me find what's holding it.

Save connections as named aliases and jump between hosts with /ssh:

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€ /ssh โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  > ๐Ÿ”— prod        deploy@10.0.1.5:/var/www/app  โ”‚
  โ”‚    ๐Ÿ”— staging      ci@10.0.1.8:/srv/staging      โ”‚
  โ”‚    โž• Connect New SSH                             โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“‹ Modes โ€” Ask for approval ยท Plan ยท Full access

Press Shift+Tab to cycle the session mode:

  • Ask for approval (default) โ€” full tools, but you approve each non-trivial tool call.
  • Plan โ€” the agent explores your codebase read-only and presents a structured plan before touching any file. Review, approve or reject with feedback โ€” then it executes step by step.
  • Full access โ€” full tools, every call auto-approved, end-to-end with no interruptions.
  Plan โ”‚ Model: openai / gpt-4o โ”‚ [โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 12%

๐Ÿ”Œ MCP Integration

Connect any MCP-compatible server โ€” stdio, HTTP, or SSE โ€” and its tools merge with the built-ins. Auto-reconnect with exponential backoff. Status shown live in the status bar.

{
  "mcp_servers": {
    "github": { "type": "stdio", "command": "gh-mcp" },
    "db": { "type": "http", "url": "http://localhost:3001/mcp" }
  }
}
  Ask for approval โ”‚ Model: openai / gpt-4o โ”‚ [โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 2% โ”‚ MCP: 2/5

๐Ÿ’ฐ Token Usage & Budget Control

Real-time context window tracking with a color-coded progress bar in the status bar:

Progress Color Meaning
[โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 45% ๐ŸŸข Green Comfortable โ€” plenty of context left
[โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘] 78% ๐ŸŸ  Orange Approaching limit โ€” consider compacting
[โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘] 92% ๐Ÿ”ด Red Near limit โ€” auto-compaction may trigger

Set cost guardrails in config.json:

{
  "budget": {
    "max_cost_per_session": 5.0,
    "warning_threshold": 0.8
  }
}

The agent receives in-context warnings when nearing limits and stops if the budget is exceeded. Model pricing is auto-fetched from models.dev.

๐Ÿง  Context Management

  • Auto-compaction โ€” when the context window fills up, older conversation is summarized while preserving the most recent messages
  • Manual compaction โ€” type /compact anytime to free up context
  • Smart prompt caching โ€” reduces redundant prompt computation across turns
  • AGENTS.md support โ€” global (~/.jcode/AGENTS.md), project-level, and local (.local.md, git-ignored) agent instructions with @include directives

๐Ÿ›  Skills

Domain-specific skills loaded on demand. Built-in skills include PR review and security review. Add your own skill packs to ~/.jcode/skills/ or <project>/.jcode/skills/.

Skills register as slash commands โ€” type /review-pr or /security-review to activate.

โšก Subagents & Background Tasks

  • Subagents โ€” delegate subtasks to independent child agents (explore, general, or coordinator type) with up to 3 levels of nesting
  • Background commands โ€” long-running builds/tests run async; check with /bg or the check_background tool
  • Status tracking โ€” Bg: 3 running shown in status bar; task IDs for programmatic access

๐Ÿ“ผ Session Resume

Every conversation is recorded as JSONL. Resume any past session:

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Resume Session โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  > 2026-03-12  gpt-4o      fix nginx crash       โ”‚
  โ”‚    2026-03-11  gpt-4o      refactor auth module  โ”‚
  โ”‚    2026-03-10  claude-3.5  add pagination logic  โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
jcode sessions          # list sessions
jcode --resume <UUID>   # pick up where you left off

๐ŸŒ Web Interface

Start a browser-based UI with jcode web. Chat interface, file browser, built-in terminal, and full agent control โ€” all accessible from http://localhost:8080.

jcode Web UI

๐Ÿ–ฅ Desktop App

A native desktop app (built with Tauri) wraps the same web UI in a real OS window with native integration: OS notifications, a menu-bar tray, close-to-tray, single-instance focus, window-state memory, and a native folder picker. The Go backend runs as an embedded sidecar โ€” no separate server to start.

make desktop-dev     # run the app in development
make desktop-build   # build a distributable bundle (.app/.dmg/.msi)

See the Desktop App guide for the architecture and details.

๐Ÿงญ Context Awareness

At startup the agent automatically detects:

  • Git branch, dirty status, last commit
  • Project type (Go, Python, JS, Rust, Java, โ€ฆ)
  • Directory structure
  • SSH environment labels
  • Available skills

No manual configuration needed โ€” the agent adapts to your project.

Keyboard Shortcuts

Key Action
Enter Submit prompt / select option
Ctrl+C Press once to warn, twice to exit
Shift+Tab Cycle mode (Ask for approval โ†’ Plan โ†’ Full access)
Ctrl+L Model picker
Ctrl+T Toggle team panel
Shift+โ†‘/โ†“ Switch between teammates
Esc Return to leader view
/ Start slash command

Slash Commands

Command Action
/model Switch model mid-session
/setting Open settings menu
/ssh Connect to SSH host
/resume Resume a previous session
/compact Compact conversation context
/bg Check background tasks
/<skill> Activate a loaded skill

Configuration

Config lives at ~/.jcode/config.json. Key sections:

Section What it controls
providers API keys and base URLs for each model provider
model / small_model Active model and lightweight model for summaries
fallback_model Fallback when primary model fails
ssh_aliases Named SSH connections
mcp_servers MCP server definitions (stdio / HTTP / SSE)
budget Token and cost limits per session
compaction Auto-compaction threshold, recent message count
prompt Memory size, cache, async env timeout
subagent Parallel limit, nesting depth
team Max teammates, mailbox poll interval
telemetry Optional Langfuse tracing
jcode doctor    # verify model + MCP connectivity
jcode version   # show version, commit, build time
jcode update    # update to latest version

Documentation

๐Ÿ“– Full documentation is available at cnjack.github.io/jcode

Changelog

See CHANGELOG.md for release notes and version history.

License

MIT

Directories ยถ

Path Synopsis
cmd
jcode command
internal
channel
Package channel provides an abstraction for external messaging channels (e.g.
Package channel provides an abstraction for external messaging channels (e.g.
channel/ble
Package ble provides a channel.Notifier that sends short status messages to a JCODE-* BLE IoT device using the Nordic UART Service (NUS).
Package ble provides a channel.Notifier that sends short status messages to a JCODE-* BLE IoT device using the Nordic UART Service (NUS).
handler
Package handler defines the AgentEventHandler interface that decouples the agent runner from any specific UI implementation (TUI, ACP, Web, etc.).
Package handler defines the AgentEventHandler interface that decouples the agent runner from any specific UI implementation (TUI, ACP, Web, etc.).
mode
Package mode defines the unified, user-facing session mode that the three frontends (TUI, Web, ACP) all present through a single selector.
Package mode defines the unified, user-facing session mode that the three frontends (TUI, Web, ACP) all present through a single selector.
pkg/weixin
Package weixin implements the WeChat iLink Bot API client.
Package weixin implements the WeChat iLink Bot API client.
remote
Package remote provides UI-agnostic helpers for connecting to and inspecting remote execution targets (currently SSH).
Package remote provides UI-agnostic helpers for connecting to and inspecting remote execution targets (currently SSH).
theme
Package theme is the single source of truth for jcode's built-in color themes.
Package theme is the single source of truth for jcode's built-in color themes.
theme/gen command
Command gen emits the web theme artifacts from the single source of truth in package theme.
Command gen emits the web theme artifacts from the single source of truth in package theme.
tui
usage
Package usage records and aggregates token-usage statistics across all jcode surfaces (TUI, web, ACP).
Package usage records and aggregates token-usage statistics across all jcode surfaces (TUI, web, ACP).
web
Package web implements the jcode web server and API.
Package web implements the jcode web server and API.
poc command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL