jcode

module
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT

README ยถ

jcode

Think it. Code it.

The AI coding agent that lives in your terminal.

Describe tasks in plain language. jcode 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


 โ—† Found it โ€” the goroutine in handleConnection() is never joined.
   I'll patch it now.

   โš™ Tool  edit   path=server.go

   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚  - go handle(conn)                                  โ”‚
   โ”‚  + wg.Add(1)                                        โ”‚
   โ”‚  + go func() { defer wg.Done(); handle(conn) }()   โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
      โœ“ Edit applied

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 > _
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Agent โ”‚ Model: openai / gpt-4o โ”‚ Approve: Ask โ”‚ [โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 2% โ”‚ MCP: 2/5

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

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.

 You โ€บ Create a team and spawn a backend developer

   โš™ Tool  team_create   team_name=dev-team
      โœ“ Done

   โš™ Tool  team_spawn   name=backend  prompt="Senior Go backend developer"
      โœ“ Done

 You โ€บ Send backend a task

   โš™ Tool  team_send_message   to=backend  message="Add pagination to /users"
      โœ“ Message sent to @backend

Switch between agent views with Shift+โ†‘/โ†“ and see live status in the team panel:

  โ•ญ Team: dev-team (2) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
  โ”‚  โ— Main (leader)                               โ”‚
  โ”‚  โ—‹ โŸณ @architect 1m32s [3 tools]               โ”‚
  โ”‚  โ—‹ โ—‡ @backend   0m45s                          โ”‚
  โ”‚                                                 โ”‚
  โ”‚  shift+โ†‘/โ†“: switch agent | esc: back to leader โ”‚
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
  • Persistent mailbox โ€” session-scoped, file-based message passing between teammates
  • Per-agent approval โ€” mutating tool calls surface an approval dialog tagged with the teammate's name and color
  • Independent conversations โ€” each agent has its own full chat history, tool calls, and markdown-rendered output
  • Agent types โ€” explore (read-only), general (full tools), coordinator (can spawn sub-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                             โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
๐Ÿ“‹ Plan Mode

Press Ctrl+P to enter Plan Mode. The agent explores your codebase read-only and presents a structured plan before touching any file. Review, approve or reject with feedback โ€” then let it execute step by step.

  Plan โ”‚ Model: openai / gpt-4o โ”‚ Approve: Ask โ”‚ [โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 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" }
  }
}
  Agent โ”‚ Model: openai / gpt-4o โ”‚ Approve: Ask โ”‚ [โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 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.00,
    "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.

๐Ÿงญ 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
Ctrl+A Toggle approval mode (Ask โ†” Auto)
Ctrl+P Toggle Plan โ†” Agent mode
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.).
pkg/weixin
Package weixin implements the WeChat iLink Bot API client.
Package weixin implements the WeChat iLink Bot API client.
tui
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