### provider.status response example fields Source: https://github.com/1jehuang/jcode/blob/master/docs/BROWSER_PROVIDER_PROTOCOL.md Example fields for provider.status. Returns current availability and setup state including browser_detected, browser_running, setup_state, requires_manual_setup, recommended_browser, manual_steps, and diagnostics. ```json { "availability": "ready", "browser_detected": true, "browser_running": true, "setup_state": "complete", "requires_manual_setup": false, "recommended_browser": "firefox", "manual_steps": [], "diagnostics": [ { "level": "info", "code": "native_host_detected", "message": "Native host manifest found" } ] } ``` -------------------------------- ### Install and run the demo app Source: https://github.com/1jehuang/jcode/blob/master/sdk/typescript/examples/demo-app/README.md Install dependencies and start the app with a prompt. The SDK inherits existing jcode provider logins by default; the private instance has separate sessions and state, and client.close() removes it on exit. ```bash npm install npm start -- "Summarize this project" ``` -------------------------------- ### Panel tool JSON examples Source: https://github.com/1jehuang/jcode/blob/master/docs/PANELS.md Examples of the panel tool actions: spawn, update, focus, close, and list. Each example shows the required arguments for the action. ```json {"content":"# Results\n\nAnalysis complete.","title":"Results"} ``` ```json {"action":"spawn","file_path":"reports/analysis.PDF"} ``` ```json {"action":"update","panel_id":"panel-","content":"# Updated results"} ``` ```json {"action":"focus","panel_id":"panel-"} ``` ```json {"action":"close","panel_id":"panel-"} ``` ```json {"action":"list"} ``` -------------------------------- ### Start, inspect, and reset the mobile onboarding simulator Source: https://github.com/1jehuang/jcode/blob/master/docs/ONBOARDING_SANDBOX.md Use these commands to run the resettable headless mobile simulator with predefined onboarding scenarios. Start it in the background, then inspect its status, state, or logs, and reset it back to the scenario start. Supported scenarios are `onboarding`, `pairing_ready`, and `connected_chat`. ```bash scripts/onboarding_sandbox.sh mobile-start onboarding ``` ```bash scripts/onboarding_sandbox.sh mobile-status ``` ```bash scripts/onboarding_sandbox.sh mobile-state ``` ```bash scripts/onboarding_sandbox.sh mobile-log ``` ```bash scripts/onboarding_sandbox.sh mobile-reset ``` -------------------------------- ### provider.setup_guide Source: https://github.com/1jehuang/jcode/blob/master/docs/BROWSER_PROVIDER_PROTOCOL.md Returns browser-specific setup instructions, URLs, file paths, permissions, or troubleshooting steps. This is an optional setup-oriented method. ```APIDOC ## provider.setup_guide ### Description Returns browser-specific setup instructions, URLs, file paths, permissions, or troubleshooting steps. ### Method provider.setup_guide ### Endpoint provider.setup_guide ``` -------------------------------- ### provider.describe response example Source: https://github.com/1jehuang/jcode/blob/master/docs/BROWSER_PROVIDER_PROTOCOL.md Example response for provider.describe. Returns static and semi-static metadata including provider_id, capabilities with core_methods, optional_methods, features, and custom_methods. ```json { "provider_id": "firefox_agent_bridge", "provider_label": "Firefox Agent Bridge", "provider_version": "1.2.3", "protocol_version": "0.1", "browser_families": ["firefox"], "transport": "stdio-json", "certification_tier": "candidate", "capabilities": { "core_methods": [ "session.ensure", "session.close", "page.open", "page.snapshot", "page.click", "page.type", "page.wait", "page.screenshot" ], "optional_methods": [ "tab.list", "tab.activate", "page.eval" ], "features": [ "element_refs", "a11y_snapshot", "attach_existing_browser", "persistent_profile" ], "custom_methods": [ { "name": "firefox.install_extension", "stability": "experimental", "description": "Install or verify the Firefox extension" } ] } } ``` -------------------------------- ### Install jcode via curl Source: https://github.com/1jehuang/jcode/blob/master/README.md Installation command for macOS and Linux using the official script. Downloads and runs the installer from jcode.sh. ```bash # macOS & Linux curl -fsSL https://jcode.sh/install | bash ``` -------------------------------- ### Install jcode on Windows via PowerShell Source: https://github.com/1jehuang/jcode/blob/master/docs/WINDOWS.md Downloads and runs the official installer from jcode.sh. Detects x64 or ARM64, downloads the matching release asset, verifies SHA-256, and installs to %LOCALAPPDATA%\jcode. Requires PowerShell 5.1 or later. ```powershell irm https://jcode.sh/install.ps1 | iex ``` -------------------------------- ### Launch sandbox after seeding Source: https://github.com/1jehuang/jcode/blob/master/docs/ONBOARDING_SANDBOX.md Starts the sandbox jcode instance after seeding real logins, allowing onboarding to detect and import them. ```bash scripts/onboarding_sandbox.sh jcode ``` -------------------------------- ### Complete internal catalog entry JSON for sponsor onboarding Source: https://github.com/1jehuang/jcode/blob/master/docs/SPONSORED_DISCOVERY_SPONSOR_ONBOARDING.md Use this JSON structure when creating a catalog entry for a sponsor tool. It includes all fields needed for both API phases, including client-visible fields like name, blurb, url, setup, and MCP provenance fields. The setup field must not contain secrets and is returned only after the agent selects the tool. ```json { "name": "example-tool", "category": "databases", "blurb": "Managed PostgreSQL with branching and connection pooling", "url": "https://example.com/product", "setup": "Run `npx -y example-tool-mcp@1.2.3`, then connect the resulting MCP server.", "mcp": { "command": "npx", "args": ["-y", "example-tool-mcp@1.2.3"] }, "active": true } ``` -------------------------------- ### Promote and reload installed server version with jcode server commands Source: https://github.com/1jehuang/jcode/blob/master/docs/BROWSER_FAST_AGENT.md Run these commands only after validation, explicit activation authorization, installation of the immutable tested version, and an agreed idle window. Promotion selects the daemon binary but does not replace the running process; reload applies the selection. Recheck `server:info` and session availability afterward. Do not use `server stop --force`, kill signals, or an automatic self-dev reload while user work is running. ```bash jcode server promote --json jcode server reload --json ``` -------------------------------- ### Start the jcode API bridge Source: https://github.com/1jehuang/jcode/blob/master/sdk/typescript/README.md Start the bridge for the user's global jcode installation, which exposes the API socket and translates onto the internal daemon socket. ```bash jcode api-bridge ``` -------------------------------- ### GET /v1/discovery Source: https://github.com/1jehuang/jcode/blob/master/docs/SPONSORED_DISCOVERY_SPONSOR_ONBOARDING.md Retrieves eligible tools for browse or select actions based on query parameters. The endpoint supports two phases: browse (returns a list of tools) and select (returns a single tool with setup instructions). ```APIDOC ## [GET] /v1/discovery ### Description Retrieves eligible tools for browse or select actions based on query parameters. The endpoint supports two phases: browse (returns a list of tools) and select (returns a single tool with setup instructions). ### Method GET ### Endpoint https://api.jcode.sh/v1/discovery ### Parameters #### Query Parameters - **category** (string) - Required - Required category slug. - **q** (string) - Required - Required capability summary, 20-500 characters. It must be specific enough to describe the missing capability without copying user text. - **reason** (string) - Required - Required rationale, 40-2,000 characters. Browse explains why the capability is needed. Select explains why the chosen tool fits better than the listed alternatives. - **tool** (string) - Optional - Canonical name chosen from a previous browse response. Its presence selects the second phase. ### Response #### Success Response (200) - **tools** (array) - List of eligible tools (browse) or a single tool object (select). ### Request Example ``` GET https://api.jcode.sh/v1/discovery?category=example&q=Managed%20PostgreSQL%20with%20branching&reason=Need%20a%20managed%20database%20with%20branching%20capabilities ``` #### Response Example (Browse) ```json { "tools": [ { "name": "example-tool", "blurb": "Managed PostgreSQL with branching and connection pooling", "url": "https://example.com/product" } ] } ``` #### Response Example (Select) ```json { "tool": { "name": "example-tool", "blurb": "Managed PostgreSQL with branching and connection pooling", "url": "https://example.com/product", "setup": "Run `npx -y example-tool-mcp@1.2.3`, then connect the resulting MCP server.", "mcp": { "command": "npx", "args": ["-y", "example-tool-mcp@1.2.3"] } } } ``` ``` -------------------------------- ### Install jcode on Windows via PowerShell Source: https://github.com/1jehuang/jcode/blob/master/packaging/crates-io-placeholder/README.md Install the real jcode agent on Windows using the official PowerShell install script. The command downloads and executes the script with iex. ```powershell irm https://jcode.sh/install.ps1 | iex # Windows ``` -------------------------------- ### Install jcode with Alacritty and global hotkey Source: https://github.com/1jehuang/jcode/blob/master/docs/WINDOWS.md Explicitly requests optional Alacritty installation and global launch hotkey configuration. These are no longer installed automatically. ```powershell $script = [scriptblock]::Create((irm https://jcode.sh/install.ps1)) & $script -ConfigureAlacritty -ConfigureHotkey ``` -------------------------------- ### Run end-to-end acceptance suite Source: https://github.com/1jehuang/jcode/blob/master/docs/SPONSOR_IMPLEMENTATION.md Executes the full acceptance suite for the mock sponsor service, verifying attribution, immutability, and security constraints. ```bash python scripts/test_mock_sponsor_service.py ``` -------------------------------- ### Example JSON output shape Source: https://github.com/1jehuang/jcode/blob/master/docs/WRAPPERS.md Shows the shape of the JSON output from run --json or the final done event, including session_id, provider, model, text, and usage details. ```json { "session_id": "session_...", "provider": "OpenAI", "model": "gpt-5.4", "text": "OK", "usage": { "input_tokens": 123, "output_tokens": 7, "cache_read_input_tokens": 0, "cache_creation_input_tokens": null } } ``` -------------------------------- ### Install wrangler Source: https://github.com/1jehuang/jcode/blob/master/telemetry-worker/README.md Run npm install to install wrangler and dependencies. ```bash npm install ``` -------------------------------- ### JcodeClient.launch(options) Source: https://github.com/1jehuang/jcode/blob/master/sdk/typescript/README.md Starts a private instance and connects to it. ```APIDOC ## JcodeClient.launch(options) ### Description Start a private instance and connect to it. ### Method launch ### Parameters - `options` (object) - Required - Launch options. ``` -------------------------------- ### Verbose model list summary Source: https://github.com/1jehuang/jcode/blob/master/docs/WRAPPERS.md Provides a verbose human-readable summary of available models. ```bash jcode --quiet model list --verbose ``` -------------------------------- ### Install the SDK via npm Source: https://github.com/1jehuang/jcode/blob/master/sdk/typescript/README.md Install the @1jehuang/jcode-sdk package from the npm registry. ```bash npm install @1jehuang/jcode-sdk ``` -------------------------------- ### Rate limit headers example Source: https://github.com/1jehuang/jcode/blob/master/docs/AMBIENT_MODE.md Shows the response headers used to discover rate limits, including request and token limits and remaining counts. ```text x-ratelimit-limit-requests: 50 x-ratelimit-remaining-requests: 42 x-ratelimit-limit-tokens: 100000 x-ratelimit-remaining-tokens: 85000 x-ratelimit-reset-requests: 2026-02-08T15:00:00Z ``` -------------------------------- ### Verify jcode installation Source: https://github.com/1jehuang/jcode/blob/master/docs/WINDOWS.md Checks the installed version, command location, and SHA-256 hash. Compare the hash with SHA256SUMS on the matching GitHub release. ```powershell jcode --version Get-Command jcode Get-FileHash (Get-Command jcode).Source -Algorithm SHA256 ``` -------------------------------- ### Launch AgentCard Discovery Demo Source: https://github.com/1jehuang/jcode/blob/master/docs/AGENTCARD_DISCOVERY_DEMO.md Run the demo script to start the AgentCard discovery demo. On the configured demo machine, Alt+0 launches the same script. ```bash scripts/launch_agentcard_discovery_demo.sh ``` -------------------------------- ### Run one prompt and return JSON Source: https://github.com/1jehuang/jcode/blob/master/docs/WRAPPERS.md Executes a single prompt and returns the result as JSON. ```bash jcode --quiet run --json "Reply with exactly OK" ``` -------------------------------- ### Browse response JSON Source: https://github.com/1jehuang/jcode/blob/master/docs/SPONSORED_DISCOVERY_SPONSOR_ONBOARDING.md Returns eligible tools without setup instructions or MCP launch data. Return an empty tools array when no entry is eligible. Every response must expose its request ID. ```json { "tools": [ { "name": "example-tool", "blurb": "Managed PostgreSQL with branching and connection pooling", "url": "https://example.com/product" } ] } ``` -------------------------------- ### Recommended workflow for reusable auth fixtures Source: https://github.com/1jehuang/jcode/blob/master/docs/ONBOARDING_SANDBOX.md One-time setup to create a realistic logged-in state, then a fast repeat loop for testing. Fixtures are stored locally in .tmp/auth-fixtures and may contain real tokens, so do not commit or share them. ```bash # One-time setup for a realistic logged-in state scripts/onboarding_sandbox.sh reset scripts/onboarding_sandbox.sh login openai scripts/onboarding_sandbox.sh auth-status scripts/onboarding_sandbox.sh fixture-save normal-openai # Fast repeat loop after that scripts/onboarding_sandbox.sh fixture-load normal-openai scripts/onboarding_sandbox.sh auth-status scripts/onboarding_sandbox.sh jcode auth-test --provider openai ``` -------------------------------- ### Launch dedicated remote daemon and attach with jcode cloud ephemeral Source: https://github.com/1jehuang/jcode/blob/master/docs/cloud-ephemeral.md Starts the candidate binary as a dedicated daemon with a specific model and socket, then attaches to it with the remote binary and server socket. Replace MODEL with the intended provider-supported model. The dedicated socket prevents the bootstrap daemon from silently serving a different Jcode binary/configuration. Starting model work can consume provider credit. ```sh jcode cloud ephemeral exec "$ID" -- bash -lc \ 'nohup "$HOME/bench/jcode" --no-update --no-selfdev --provider jcode --model MODEL --socket /run/user/1000/bench.sock serve > "$HOME/bench/server.log" 2>&1 < /dev/null &' jcode cloud ephemeral attach "$ID" \ --remote-binary /home/ec2-user/bench/jcode \ --server-socket /run/user/1000/bench.sock \ --workdir /home/ec2-user/bench/tasks-src/tasks/json-unescape ``` -------------------------------- ### Install jcode from source Source: https://github.com/1jehuang/jcode/blob/master/docs/WINDOWS.md Allows a source build when no prebuilt Windows asset matches. Requires Git, Rust, and Visual Studio 2022 Build Tools with the Desktop development with C++ workload. ```powershell $script = [scriptblock]::Create((irm https://jcode.sh/install.ps1)) & $script -BuildFromSource ``` -------------------------------- ### Generate pairing code Source: https://github.com/1jehuang/jcode/blob/master/scripts/remote/README.md Generate a pairing code valid for 5 minutes. ```sh jcode pair ``` -------------------------------- ### Enable experimental flag and login with muse-subscription provider Source: https://github.com/1jehuang/jcode/blob/master/docs/MUSE_NATIVE_AUTH.md Sets the experimental environment variable and runs the login command with the muse-subscription provider. Use the built branch binary from the repository root, not an older globally installed Jcode. ```sh export JCODE_EXPERIMENTAL_MUSE_SUBSCRIPTION=1 ./target/debug/jcode login --provider muse-subscription ``` -------------------------------- ### POST /cloud/wake Source: https://github.com/1jehuang/jcode/blob/master/docs/JCODE_CLOUD_AWS.md Changes the desired state of the host to wake (start) it. ```APIDOC ## POST /cloud/wake ### Description Changes desired state to wake the host. ### Method POST ### Endpoint `/cloud/wake` ``` -------------------------------- ### Build the SDK from a source checkout Source: https://github.com/1jehuang/jcode/blob/master/sdk/typescript/README.md Install dependencies and build the SDK from the source directory. ```bash cd sdk/typescript npm install npm run build ``` -------------------------------- ### Inspect build/version details Source: https://github.com/1jehuang/jcode/blob/master/docs/WRAPPERS.md Shows version and build information. The --json variant outputs machine-readable JSON with fields like version, git_hash, and build_time. ```bash jcode --quiet version ``` ```bash jcode --quiet version --json ``` -------------------------------- ### Todo planning hierarchy JSON example Source: https://github.com/1jehuang/jcode/blob/master/docs/HARNESS.md Defines a plan with phases, lanes, and items. Phases execute in order, lanes can run in parallel, and items run in order. Names must be nonblank and globally unique. ```json { "phases": [ { "phase": 1, "lanes": [ { "lane": "implementation", "items": [ { "name": "Implement the change", "description": "Implement and validate the requested behavior", "status": "in_progress", "priority": "high", "confidence": "validated" } ] } ] } ] } ``` -------------------------------- ### AuthClient::begin() Source: https://github.com/1jehuang/jcode/blob/master/docs/DESKTOP_AUTH_SDK.md Allocates an `AuthFlow` for the given provider and account without starting I/O. Retain a clone for the Cancel button. ```APIDOC ## AuthClient::begin() ### Description Allocates an `AuthFlow` for the given provider and account without starting I/O. Retain a clone for the Cancel button. ### Method Function call ### Endpoint `AuthClient::begin(provider.id, account)` ### Parameters #### Request Body - **provider_id** (string) - Required - The provider ID. - **account** (string) - Required - The account identifier. ### Response #### Success Response - **flow** (`AuthFlow`) - The allocated auth flow. ``` -------------------------------- ### Select response JSON Source: https://github.com/1jehuang/jcode/blob/master/docs/SPONSORED_DISCOVERY_SPONSOR_ONBOARDING.md Returns one canonical entry for the selected tool within the category. Includes setup instructions and MCP launch data. Use a non-2xx response for unknown category, tool, invalid request, or service failure. ```json { "tool": { "name": "example-tool", "blurb": "Managed PostgreSQL with branching and connection pooling", "url": "https://example.com/product", "setup": "Run `npx -y example-tool-mcp@1.2.3`, then connect the resulting MCP server.", "mcp": { "command": "npx", "args": ["-y", "example-tool-mcp@1.2.3"] } } } ``` -------------------------------- ### Manual setup recipe for pinning a benchmark configuration Source: https://github.com/1jehuang/jcode/blob/master/docs/cloud-ephemeral.md Uploads the exact candidate binary and a pristine benchmark checkout to a dedicated ephemeral machine, then verifies the remote binary hash and versions. Record the local hash with the benchmark revision, compiler, task and model config. Do not update a shared daemon or assume the bootstrap build supports the current native SSH protocol. ```sh ID=cm_0123456789abcdef0123456789abcdef BIN=/absolute/path/to/the/linux-x86_64/jcode # Record this locally with the benchmark revision, compiler, task and model config. sha256sum "$BIN" jcode cloud ephemeral exec "$ID" -- bash -lc 'mkdir -p "$HOME/bench"' jcode cloud ephemeral exec "$ID" -- bash -lc \ 'cat > "$HOME/bench/jcode.tmp" && chmod 700 "$HOME/bench/jcode.tmp" && mv "$HOME/bench/jcode.tmp" "$HOME/bench/jcode"' < "$BIN" jcode cloud ephemeral exec "$ID" -- bash -lc \ 'sha256sum "$HOME/bench/jcode"; "$HOME/bench/jcode" --version; cc --version; valgrind --version' # Upload a pristine benchmark checkout, without local credentials/build products. git -C /path/to/jcode-bench archive HEAD | \ jcode cloud ephemeral exec "$ID" -- bash -lc \ 'mkdir -p "$HOME/bench/tasks-src" && tar xf - -C "$HOME/bench/tasks-src"' ``` -------------------------------- ### Example callback response JSON Source: https://github.com/1jehuang/jcode/blob/master/docs/cloud-environment.md Example of a successful callback response. Errors return {"ok":false,"code":"unavailable","applied":0,"skipped":0} without raw diagnostics. A zero process exit means a JSON response was produced, not that transfer succeeded. ```json {"ok":true,"code":"received","applied":1,"skipped":0} ``` -------------------------------- ### Enable gateway in config.toml Source: https://github.com/1jehuang/jcode/blob/master/scripts/remote/README.md Add this to ~/.jcode/config.toml (Windows: %USERPROFILE%\.jcode\config.toml) to enable the gateway. JCODE_GATEWAY_ENABLED=1 works as an env override. ```toml [gateway] enabled = true port = 7643 bind_addr = "0.0.0.0" ``` -------------------------------- ### Verify a published release Source: https://github.com/1jehuang/jcode/blob/master/sdk/typescript/RELEASING.md Run these commands to verify the published package from the registry. Creates a temporary directory, installs the SDK, and runs a consumer check that launches a client, creates a session, and runs a command. ```bash cd "$(mktemp -d)" npm init -y >/dev/null npm install @1jehuang/jcode-sdk node --input-type=module -e ' import { JcodeClient } from "@1jehuang/jcode-sdk"; const client = await JcodeClient.launch({ workingDir: process.cwd() }); const session = await client.createSession(); console.log((await client.run(session.session_id, "say hello")).text); await client.close(); ' ``` -------------------------------- ### provider.status Source: https://github.com/1jehuang/jcode/blob/master/docs/BROWSER_PROVIDER_PROTOCOL.md Returns current availability and setup state of the provider, including browser detection and diagnostics. This is used during discovery and handshake. ```APIDOC ## provider.status ### Description Returns current availability and setup state of the provider, including browser detection and diagnostics. ### Method JSON-RPC method call ### Endpoint N/A (JSON-RPC method) ### Parameters No parameters. ### Response #### Success Response - **availability** (string) - Availability status: `ready`, `degraded`, or `unavailable` - **browser_detected** (boolean) - Whether a browser was detected - **browser_running** (boolean) - Whether the browser is running - **setup_state** (string) - Setup state: `complete`, `partial`, `required`, or `broken` - **requires_manual_setup** (boolean) - Whether manual setup is required - **recommended_browser** (string) - Recommended browser identifier - **manual_steps** (array) - List of manual setup steps - **diagnostics** (array) - List of diagnostic messages #### Response Example ```json { "availability": "ready", "browser_detected": true, "browser_running": true, "setup_state": "complete", "requires_manual_setup": false, "recommended_browser": "firefox", "manual_steps": [], "diagnostics": [ { "level": "info", "code": "native_host_detected", "message": "Native host manifest found" } ] } ``` ``` -------------------------------- ### Run resume latency benchmark suite with samples Source: https://github.com/1jehuang/jcode/blob/master/docs/benchmarks/resume-experience-latency-2026-11-02.md Runs the benchmark suite with a specified number of samples. The first command uses 20 samples for a quick run; the second uses 100 samples for more useful tail exploration but longer runtime. The third adds a specific installed binary to also measure real PTY startup and cancellation. ```bash python3 scripts/bench_resume_suite.py --samples 20 ``` ```bash # More useful tail exploration, larger runtime: python3 scripts/bench_resume_suite.py --samples 100 ``` ```bash # Also measure real PTY startup and cancellation on a specific installed binary: python3 scripts/bench_resume_suite.py --samples 20 --binary /absolute/path/to/jcode ``` -------------------------------- ### Phase with lane_after prerequisite JSON example Source: https://github.com/1jehuang/jcode/blob/master/docs/HARNESS.md Adds a phase with a lane that starts after a specific prerequisite task from an earlier phase, overriding the default phase barrier. The 'after' field must contain unique, existing task names and must not be empty. ```json {"phase": 2, "lanes": [{"lane": "tests", "after": ["Implement the change"], "items": [ {"name": "Test the change", "status": "pending", "priority": "high"} ]}]} ``` -------------------------------- ### Example focus_hook script for tmux Source: https://github.com/1jehuang/jcode/blob/master/docs/SPAWN_HOOK.md A bash script that selects the tmux window matching the title passed via JCODE_FOCUS_TITLE. Used as the focus_hook in the configuration above. If the hook fails to start, jcode falls back to its built-in focus path. ```bash #!/usr/bin/env bash # ~/bin/jcode-focus tmux select-window -t "$(tmux list-windows -F '#{window_id} #{window_name}' \ | grep -F "$JCODE_FOCUS_TITLE" | head -1 | cut -d' ' -f1)" ``` -------------------------------- ### Discover providers and current selection Source: https://github.com/1jehuang/jcode/blob/master/docs/WRAPPERS.md List provider IDs for -p/--provider and inspect the currently requested and resolved provider/model selection. The --json variants output machine-readable JSON. ```bash jcode --quiet provider list ``` ```bash jcode --quiet provider list --json ``` ```bash jcode --quiet provider current ``` ```bash jcode --quiet --provider openai --model gpt-5.4 provider current --json ``` -------------------------------- ### Fresh sandbox launch Source: https://github.com/1jehuang/jcode/blob/master/docs/ONBOARDING_SANDBOX.md Runs the onboarding sandbox script with the 'fresh' command to create a clean jcode launch with isolated state. ```bash scripts/onboarding_sandbox.sh fresh ``` -------------------------------- ### Run Jcode with Bedrock using --provider flag Source: https://github.com/1jehuang/jcode/blob/master/docs/AWS_BEDROCK_PROVIDER.md Starts Jcode with the Bedrock provider and a specific model. Requires the IAM permissions above. ```bash jcode --provider bedrock --model anthropic.claude-3-5-sonnet-20241022-v2:0 ``` -------------------------------- ### Login with OpenAI provider Source: https://github.com/1jehuang/jcode/blob/master/OAUTH.md Starts the OAuth login flow for the OpenAI provider. Use --no-browser for headless/SSH environments and --print-auth-url for scriptable remote flows, completing later with --callback-url. ```bash jcode login --provider openai ``` -------------------------------- ### Install jcode on macOS/Linux via curl or Homebrew Source: https://github.com/1jehuang/jcode/blob/master/packaging/crates-io-placeholder/README.md Install the real jcode agent on macOS or Linux using the official install script or Homebrew. The curl command pipes the script directly to bash; the brew command installs via Homebrew. ```bash curl -fsSL https://jcode.sh/install | bash # macOS / Linux brew install jcode # Homebrew ``` -------------------------------- ### jcode login --provider google Source: https://github.com/1jehuang/jcode/blob/master/OAUTH.md Starts the Google/Gmail OAuth login flow. For headless or SSH environments, use the --no-browser flag. For scriptable remote flows after credentials are configured, use --print-auth-url. ```bash jcode login --provider google ``` ```bash jcode login --provider google --no-browser ``` ```bash jcode login --provider google --print-auth-url ``` -------------------------------- ### Discover available models Source: https://github.com/1jehuang/jcode/blob/master/docs/WRAPPERS.md List model names that can be passed to -m/--model. The --json variant outputs machine-readable JSON, and the --provider flag scopes the list to a specific provider. ```bash jcode --quiet model list ``` ```bash jcode --quiet model list --json ``` ```bash jcode --quiet --provider openai model list --json ``` -------------------------------- ### AuthFlow::start() Source: https://github.com/1jehuang/jcode/blob/master/docs/DESKTOP_AUTH_SDK.md Starts the authentication flow on a worker thread. Renders the returned `AuthPrompt` only inside the login panel. Also binds an optional loopback receiver for OAuth URLs with a local HTTP redirect. ```APIDOC ## AuthFlow::start() ### Description Starts the authentication flow on a worker thread. Renders the returned `AuthPrompt` only inside the login panel. Also binds an optional loopback receiver for OAuth URLs with a local HTTP redirect. ### Method Function call ### Endpoint `AuthFlow::start()` ### Parameters None ### Response #### Success Response - **prompt** (`AuthPrompt`) - The prompt to render in the login panel. ``` -------------------------------- ### Enable integration_tools tool in config.toml Source: https://github.com/1jehuang/jcode/blob/master/docs/SPONSORED_DISCOVERY_SPONSOR_ONBOARDING.md Integration discovery is disabled by default. To enable the integration_tools tool, set [sponsors] enabled = true in ~/.jcode/config.toml and start a new session. The legacy section name is retained for compatibility. ```toml [sponsors] enabled = true endpoint = "https://staging.example.com/v1/discovery" ``` -------------------------------- ### Setup commands for model prices and usage dashboards Source: https://github.com/1jehuang/jcode/blob/master/telemetry-worker/README.md Run these commands in order to set up and run the dashboards. `npm run migrate:model-prices` creates the `model_prices` table (migration 0023), `npm run sync:model-prices` fills it from models.dev, and `npm run token-value:fresh` refreshes prices then runs the legacy dashboard. `npm run migrate:model-usage` creates the legacy response rollup table (migration 0027), and the `npx wrangler` command applies migration 0031 for the authoritative v2 response rollup. `npm run model-usage` reads the v2 rollup by month/source. ```bash npm run migrate:model-prices # creates model_prices (migration 0023) npm run sync:model-prices # fills it from https://models.dev/api.json npm run token-value:fresh # refresh prices, then run the dashboard (recommended) npm run token-value # dashboard using prices already stored in D1 npm run token-value:daily # legacy per-day estimates, in date order npm run migrate:model-usage # legacy response rollup table (migration 0027) npx wrangler d1 execute jcode-telemetry --remote --file=migrations/0031_usage_report_receipts.sql npm run model-usage # authoritative v2 response rollup, by month/source ``` -------------------------------- ### Run root-crate analyzer with options Source: https://github.com/1jehuang/jcode/blob/master/docs/plans/COMPILE_PERFORMANCE_PLAN.md Use to get ranked modules, blockers, cycles, and feedback arcs. The --full flag lists the full feedback-arc set; --json outputs machine-readable data. ```bash python3 scripts/analyze_root_crate.py # ranked modules + blockers + cycles + feedback arcs ``` ```bash python3 scripts/analyze_root_crate.py --full # full feedback-arc-set listing ``` ```bash python3 scripts/analyze_root_crate.py --json # machine-readable ``` -------------------------------- ### Ambient Session Transcript JSON Example Source: https://github.com/1jehuang/jcode/blob/master/docs/SAFETY_SYSTEM.md Full log of every action taken during an ambient cycle, including session metadata, token usage, and action details. Shows auto-allowed actions and a pending permission request. ```json { "session_id": "ambient-2026-02-08-143022", "started_at": "2026-02-08T14:30:22Z", "ended_at": "2026-02-08T14:35:18Z", "provider": "openai", "model": "5.2-codex-xhigh", "token_usage": { "input": 12400, "output": 3200 }, "actions": [ { "type": "memory_consolidation", "description": "Merged 2 duplicate memories about dark mode preference", "tier": "auto_allowed", "details": { "merged": ["mem_abc", "mem_def"], "into": "mem_ghi" } }, { "type": "memory_prune", "description": "Deactivated 1 memory with confidence 0.02", "tier": "auto_allowed", "details": { "pruned": ["mem_xyz"] } }, { "type": "permission_request", "description": "Create PR for 3 auth test fixes", "tier": "requires_permission", "status": "pending", "request_id": "req_abc123" } ], "pending_permissions": 1, "scheduled_next": "2026-02-08T15:05:00Z" } ``` -------------------------------- ### Common onboarding sandbox commands Source: https://github.com/1jehuang/jcode/blob/master/docs/ONBOARDING_SANDBOX.md Shows the main commands for the onboarding sandbox script: checking env/status, resetting, logging in, saving/loading fixtures, and running jcode commands. Use these to isolate onboarding testing from your normal jcode config. ```bash # Show the exact env vars and sandbox paths scripts/onboarding_sandbox.sh env scripts/onboarding_sandbox.sh status # Start over from a blank onboarding state scripts/onboarding_sandbox.sh reset scripts/onboarding_sandbox.sh fresh # Log into a provider without touching your normal jcode config scripts/onboarding_sandbox.sh login openai scripts/onboarding_sandbox.sh login claude scripts/onboarding_sandbox.sh auth-status # Save the resulting logged-in sandbox as a reusable local fixture scripts/onboarding_sandbox.sh fixture-save normal-openai # Later, restore that exact auth state without repeating browser login scripts/onboarding_sandbox.sh fixture-load normal-openai scripts/onboarding_sandbox.sh auth-status # Or load and run one command in the fixture-backed sandbox scripts/onboarding_sandbox.sh fixture-run normal-openai -- auth-test --provider openai --no-smoke # Run arbitrary jcode commands in the sandbox scripts/onboarding_sandbox.sh jcode auth status scripts/onboarding_sandbox.sh jcode pair ``` -------------------------------- ### Coverage report line examples Source: https://github.com/1jehuang/jcode/blob/master/docs/PROVIDER_DOCTOR.md Example lines from `jcode provider-test-coverage` showing status tokens, provider/model, blocker, and freshness notes. ```text READY cerebras / gpt-oss-120b last tested 9 minutes ago (2026-05-30) by developer (dev build) 6/11 nvidia-nim / gemma-4-31b failed at `streaming reply`; run `jcode provider-doctor nvidia-nim --model gemma-4-31b --tier full`; last tested 2 days ago ... ``` -------------------------------- ### Lower-level auth fixture helper commands Source: https://github.com/1jehuang/jcode/blob/master/docs/ONBOARDING_SANDBOX.md Direct commands for the auth_fixture.sh helper: list, save, load, and run. Use these when you need finer control than the onboarding sandbox wrapper provides. ```bash scripts/auth_fixture.sh list scripts/auth_fixture.sh save normal-openai scripts/auth_fixture.sh load normal-openai scripts/auth_fixture.sh run normal-openai -- auth status ``` -------------------------------- ### Session starts by UTC hour Source: https://github.com/1jehuang/jcode/blob/master/telemetry-worker/README.md Count session starts grouped by UTC hour to analyze workflow timing. ```bash wrangler d1 execute jcode-telemetry --command "SELECT session_start_hour_utc, COUNT(*) AS sessions FROM events WHERE event = 'session_start' GROUP BY session_start_hour_utc ORDER BY session_start_hour_utc" ``` -------------------------------- ### Run jcode-tui incremental search benchmarks Source: https://github.com/1jehuang/jcode/blob/master/docs/benchmarks/resume-incremental-search-2026-11-02.md Commands to reproduce the benchmark suite: run checks, run the session_picker library tests, and run the ignored manual readiness benchmark with --ignored --nocapture. ```bash justrust check --remote -p jcode-tui --tests justrust test --remote -p jcode-tui --lib session_picker justrust test --remote -p jcode-tui --lib benchmark_incremental_query_readiness -- --ignored --nocapture ``` -------------------------------- ### D7 retention for users who installed 8-14 days ago Source: https://github.com/1jehuang/jcode/blob/master/telemetry-worker/README.md Query to calculate retention for users who installed 8-14 days ago and were retained in the last 7 days. Uses a cohort of distinct telemetry_ids from install events and checks for session_end or session_crash events in the retention window. ```bash wrangler d1 execute jcode-telemetry --command "WITH cohort AS (SELECT DISTINCT telemetry_id FROM events WHERE event = 'install' AND created_at >= datetime('now', '-14 days') AND created_at < datetime('now', '-7 days')), retained AS (SELECT DISTINCT telemetry_id FROM events WHERE event IN ('session_end', 'session_crash') AND created_at >= datetime('now', '-7 days')) SELECT COUNT(*) AS cohort_users, (SELECT COUNT(*) FROM cohort WHERE telemetry_id IN retained) AS retained_users FROM cohort" ``` -------------------------------- ### Provider command passthrough example Source: https://github.com/1jehuang/jcode/blob/master/docs/BROWSER_PROVIDER_PROTOCOL.md Shows the JSON structure for the browser tool's provider_command action, used as an escape hatch for provider-native methods like cdp.send. This is advanced/debug behavior, not the primary UX. ```json { "action": "provider_command", "provider_method": "cdp.send", "params": { "method": "Network.enable" } } ``` -------------------------------- ### Total installs (raw and excluding CI) Source: https://github.com/1jehuang/jcode/blob/master/telemetry-worker/README.md Count distinct telemetry IDs for install events, both raw and excluding CI runners (is_ci = 0). ```bash wrangler d1 execute jcode-telemetry --command "SELECT COUNT(DISTINCT telemetry_id) AS raw_installs, COUNT(DISTINCT CASE WHEN is_ci = 0 THEN telemetry_id END) AS installs_noci FROM events WHERE event = 'install'" ``` -------------------------------- ### Example input for user_response tool Source: https://github.com/1jehuang/jcode/blob/master/docs/user-response.md Shows the JSON object the model sends to the user_response tool. The content field is required and must be a string, even when empty. Unknown properties are rejected. ```json {"content":"## Result\n\nThe change is ready.","title":"Completed","intent":"Show result"} ``` -------------------------------- ### Generate headless onboarding screenshots Source: https://github.com/1jehuang/jcode/blob/master/docs/ONBOARDING_SANDBOX.md Generate the successful import-logins onboarding sequence without launching a terminal or reading real credentials. Optionally choose an output directory. The generator renders the same `OnboardingFlow` phases and ratatui widget tree into an offscreen `TestBackend`, writing SVG images and, when `rsvg-convert` is installed, matching PNG files. ```bash scripts/capture_onboarding.sh ``` ```bash scripts/capture_onboarding.sh ~/onboarding-screenshots ``` -------------------------------- ### POST /v1/oauth-account/check Source: https://github.com/1jehuang/jcode/blob/master/telemetry-worker/README.md Checks whether an installation UUID is known and whether a specific provider/email digest is tracked for that installation. Used by clients to preflight before uploading raw email. ```APIDOC ## [POST] /v1/oauth-account/check ### Description Checks whether an installation UUID is known and whether a specific provider/email digest is tracked for that installation. Used by clients to preflight before uploading raw email. ### Method POST ### Endpoint /v1/oauth-account/check ### Parameters #### Request Body - **id** (string) - Required - Installation UUID - **provider** (string) - Required - Model provider (anthropic, openai, gemini, copilot, antigravity) - **email_hash** (string) - Required - Lowercase 64-character SHA256 hex digest of the UTF-8 bytes of email.trim().toLowerCase() ### Response #### Success Response (200) - **installation_known** (boolean) - Whether the UUID exists in events, retained daily_active_users, or oauth_accounts - **email_tracked** (boolean) - Whether the candidate provider/digest is stored for this installation ``` -------------------------------- ### GET /health Source: https://github.com/1jehuang/jcode/blob/master/docs/IOS_APP.md Performs a reachability check on the server. ```APIDOC ## [GET] /health ### Description Performs a reachability check on the server. ### Method GET ### Endpoint /health ### Response #### Success Response (200) No response body documented. ``` -------------------------------- ### Create and enable Google Cloud project Source: https://github.com/1jehuang/jcode/blob/master/docs/GOOGLE_GUIDED_SETUP.md Run these gcloud commands to create a project and enable the Gmail and Calendar APIs. Use when gcloud auth list shows an active account. ```bash gcloud projects create jcode-<6 digits> --name jcode --quiet gcloud services enable gmail.googleapis.com calendar-json.googleapis.com --project --quiet ``` -------------------------------- ### Wake Lambda policy (EC2 start) Source: https://github.com/1jehuang/jcode/blob/master/scripts/phone-server/IAM-LEAST-PRIVILEGE.md IAM policy for the Wake Lambda that allows describing instances, starting only the target instance, and writing to its own log group. The log group should be created during provisioning with retention configured, rather than granting runtime `logs:CreateLogGroup` on `*`. ```json { "Version": "2012-10-17", "Statement": [ { "Sid": "ReadTargetInstanceState", "Effect": "Allow", "Action": "ec2:DescribeInstances", "Resource": "*" }, { "Sid": "StartTargetInstanceOnly", "Effect": "Allow", "Action": "ec2:StartInstances", "Resource": "arn:aws:ec2:us-east-1:302154194530:instance/i-08214cf66cd3f80c7" }, { "Sid": "WriteOwnLogs", "Effect": "Allow", "Action": [ "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": "arn:aws:logs:us-east-1:302154194530:log-group:/aws/lambda/jcode-phone-wake:*" } ] } ``` -------------------------------- ### Start isolated jcode daemon with OpenAI ultrafast disabled Source: https://github.com/1jehuang/jcode/blob/master/docs/OPENAI_ULTRAFAST_ACCEPTANCE.md Starts a jcode daemon on a scratch Unix socket with the OpenAI service tier disabled, using the gpt-6.1-sol model. The environment variable JCODE_OPENAI_SERVICE_TIER=off prevents the shared daemon socket from being used. ```bash JCODE_OPENAI_SERVICE_TIER=off ./target/selfdev/jcode \ --no-update --no-selfdev --provider openai --model gpt-6.1-sol \ --socket "$ACCEPTANCE_SOCKET" serve ``` -------------------------------- ### Run main benchmark harness Source: https://github.com/1jehuang/jcode/blob/master/docs/benchmarks/jcode-vs-maki-2026-10-27.md Command to reproduce the main benchmark with Jcode and Maki, specifying pinned paths, runs, sessions, idle seconds, and output file. ```bash python scripts/bench_jcode_maki.py \ --jcode /path/to/pinned/jcode --maki /path/to/pinned/maki \ --runs 3 --sessions 1 5 10 --idle-seconds 5 --output results.json ``` -------------------------------- ### Example policy script for pre_tool_transform Source: https://github.com/1jehuang/jcode/blob/master/docs/HOOKS.md A bash script that reads tool input JSON from stdin and uses JCODE_HOOK_TOOL_NAME to block destructive shell commands and writes to /etc. Exits with code 2 to block, otherwise exits 0. This is an example policy script for the pre_tool_transform hook. ```bash #!/usr/bin/env bash # ~/bin/jcode-tool-policy # stdin: tool input JSON. Env: JCODE_HOOK_TOOL_NAME, JCODE_HOOK_SESSION_ID... input=$(cat) case "$JCODE_HOOK_TOOL_NAME" in bash) if grep -qE 'rm -rf /([^a-zA-Z]|$)|mkfs|dd if=' <<<"$input"; then echo "blocked: destructive shell command" >&2 exit 2 fi ;; write|edit) if grep -q '"file_path":"/etc/' <<<"$input"; then echo "blocked: writes to /etc are not allowed" >&2 exit 2 fi ;; esac exit 0 ``` -------------------------------- ### Build and run isolated acceptance daemon with debug control Source: https://github.com/1jehuang/jcode/blob/master/docs/BROWSER_FAST_AGENT.md Builds the selfdev profile, creates isolated JCODE_HOME and runtime directories, copies the browser fixture, and starts a temporary server with debug control enabled. Requires OPENROUTER_API_KEY, BROWSER_SESSION, and JCODE_BROWSER_HANDOFF_TEST_TAB_ID in the environment. Waits for the private debug socket and verifies the server binary. ```bash cargo build --profile selfdev BIN="$PWD/target/selfdev/jcode" REAL_JCODE_HOME="${JCODE_HOME:-$HOME/.jcode}" export JCODE_HOME="$(mktemp -d "$JCODE_SCRATCH_DIR/browser-fast-home.XXXXXX")" export JCODE_RUNTIME_DIR="$(mktemp -d "${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/jbf.XXXXXX")" SOCK="$JCODE_RUNTIME_DIR/jcode-browser-fast.sock" cp -a "$REAL_JCODE_HOME/browser" "$JCODE_HOME/browser" : "${OPENROUTER_API_KEY:?Provide OpenRouter credentials through the process environment}" : "${BROWSER_SESSION:?Use the existing dedicated fixture browser session}" : "${JCODE_BROWSER_HANDOFF_TEST_TAB_ID:?Use a disposable local fixture tab}" # Enable debug control only for this disposable acceptance daemon. JCODE_DEBUG_CONTROL=1 "$BIN" --no-update --provider openrouter --socket "$SOCK" serve \ --temporary-server --owner-pid "$$" --temp-idle-timeout-secs 300 \ >"$JCODE_HOME/acceptance-server.log" 2>&1 & SERVER_PID=$! # Wait for this private debug listener, never fall back to the shared socket. for attempt in $(seq 1 100); do test -S "${SOCK%.sock}-debug.sock" && break sleep 0.1 done test -S "${SOCK%.sock}-debug.sock" || exit 1 readlink -f "/proc/$SERVER_PID/exe" "$BIN" debug --socket "$SOCK" server:info SID=$("$BIN" debug --socket "$SOCK" create_session "$PWD" | python3 -c 'import json,sys; print(json.load(sys.stdin)["session_id"])') PAYLOAD=$(python3 -c 'import json,os; print(json.dumps({ "action":"handoff", "tab_id":int(os.environ["JCODE_BROWSER_HANDOFF_TEST_TAB_ID"]), "frame_id":0, "max_steps":8, "goal":"Open Documentation, then Browser controls. Finish only when Fast browser integration verified is visible. Stay on the local fixture website." }))') "$BIN" debug --socket "$SOCK" --session "$SID" tool "browser $PAYLOAD" ``` -------------------------------- ### Run controlled production smoke check Source: https://github.com/1jehuang/jcode/blob/master/telemetry-worker/CONCURRENCY_ROLLOUT.md Run a controlled production smoke check that sends synthetic CI telemetry to production, isolated under a disposable installation ID. Do not remove the CI tag to make a report nonempty. Use the printed installation ID in read-only Wrangler queries against concurrency_event_quality. ```sh # From the repository root, after deploying the Worker: scripts/dev_cargo.sh run -p jcode-telemetry-core --example concurrency_probe \ -- --emit-ci-telemetry ```