A modern terminal coding agent in Rust. Single binary. No Node.js runtime required, and no npm install step. Runs against DeepSeek, OpenAI, or Claude with the same workflow.
ASI Code 2.0 is coming soon. The 2.0 line moves beyond pure code editing into desktop and professional-software control: native GUI automation (screenshot / window targeting / synthetic input / on-screen OCR), live engine bridges for Unreal Engine 5, Blender, and Unity (drive the already-open Editor via
[InitializeOnLoad]C# drops), 3D-aware scene probes plusprobe_difffor deterministic structural verification, frame-folder video capture with keyframe selection for temporal context, and a smarter auto-loop that no longer mistakes successful read-only investigation for "no progress." See What's New in 2.0 below.
Inspired by modern coding-agent CLIs, with a similar workflow and UX: REPL with slash commands, streaming output, auto-tool loop, work / code / secure / review modes, sub-agents, MCP server support, plugin system, agent skills, cron jobs, git worktrees, sandbox + audit log, and a 60+ command surface.
# 30-second quickstart (Windows / PowerShell)
# DeepSeek
$env:DEEPSEEK_API_KEY = "sk-..."
cargo run --release -- repl --provider deepseek --model deepseek-v4-pro --project D:\your-project --no-setup
# OpenAI/Claude native tool_use
# OpenAI
$env:OPENAI_API_KEY = "sk-..."
cargo run --release -- repl --provider openai --model <openai-model> --project D:\your-project --no-setup
# Claude
$env:ANTHROPIC_API_KEY = "sk-ant-..."
cargo run --release -- repl --provider claude --model <claude-model> --project D:\your-project --no-setupASI Code is a Rust-built terminal coding agent with a workflow similar to modern coding-agent CLIs.
This project is independent and is not affiliated with, endorsed by, or sponsored by Anthropic, OpenAI, Anysphere, or any other model/tool provider.
- Interactive REPL with slash commands and streaming output
- REPL startup provider wizard (choose provider, API key, model before chat)
- API key safety: wizard keys are session-only by default unless explicitly persisted
- Provider support: OpenAI, DeepSeek, Claude (API key + Claude OAuth token)
- Tool system:
bash,read_file,write_file,edit_file,glob_search,grep_search - Compact read display:
read_filedefaults to chunked ranges and UI shows a concise read summary instead of dumping full file content - Web tools:
web_search,web_fetch - Auto tool loop: parses assistant
/toolcall ...lines and executes them (toggle with/auto on|off) - Work mode:
/work <task>or/code <task>injects workspace snapshot and drives tool-first project editing - Intent-aware coding mode: non-command prompts that look like coding requests auto-enter workspace coding flow (simple greetings do not)
- Security fix mode:
/secure <task>focuses on vulnerability and hardening fixes - Review mode:
/review <task>focuses on bugs, regressions, risks, and missing tests - Session persistence: save, list, resume
- Change tracking: per-turn
changed_file=...feedback and/changesfor session summary (/changes clearto reset) - Todo tracking: add/list/done/remove
- Project memory notes and notebook markdown cells
- Git integration command wrapper
- MCP server management (add/rm/auth/oauth/config/show/start/list/stop)
- Subagent tool-loop closure:
/agentruns in an isolated runtime and can continue through tool-call loops (toggle:ASI_SUBAGENT_TOOL_LOOP) - Cost tracking and status line (tokens + USD estimate)
- Markdown ANSI rendering toggle
- Model aliases:
opus,sonnet,haiku - Privacy and safety controls:
- local telemetry JSONL (disabled by default)
- tool-input telemetry redaction by default
- safe shell guard for dangerous commands
- undercover mode for sanitized commit messages
- auto-review guard layer:
off|warn|blockwith severity thresholdcritical|high|medium|low - feature killswitches (
web_tools,bash_tool,subagent,research) - explicit remote policy sync (
/policy sync) with safe-mode guardrails
- Theme setup flow:
theme//themetext style chooser with preview (7 themes: dark / light / colorblind variants / ANSI variants / cubist Picasso-inspired truecolor)setup//setupAPI key + model + wallet setup wizardscan//scanrepository pattern scan panel (auto-detects project profile: Rust/JavaScript/Python when no patterns are provided, supports deep mode:--deepor--deep=N)
- Context auto-compaction: triggers automatically before each turn when cumulative input tokens cross
ASI_AUTO_COMPACT_INPUT_TOKENS(default120000) OR live turn count crossesASI_AUTO_COMPACT_TURN_RATIO * max_turns(default0.80), so long sessions never silently dead-end onmax_turns_reached - Test feedback loop (opt-in via
ASI_AUTO_TEST=1): after every code-changing iteration the auto-tool-loop runs the project's test command (cargo testfor Rust,pytestfor Python with a pytest config marker,npm testfor Node with ascripts.test) and on failure injects the trace as a synthetic user message so the model fixes the cause — capped atASI_AUTO_TEST_MAX_ATTEMPTSconsecutive self-heal rounds (default 3) - Auto-loop journal + resume (default ON, throttled to one save per
ASI_AUTO_JOURNAL_INTERVAL_SECS, default 30s): every auto-tool-loop iteration writes a checkpoint withmessages+changed_files+change_events+ the original task input; if the prior session crashed mid-loop, REPL startup detectsloop_running=trueand promptsResume? [Y/n]. Manual trigger:/checkpoint resume. Disable withASI_AUTO_JOURNAL=0
Everything below is already implemented and merged on main; the 2.0 release is the moment we cut a numbered tag and ship signed installers. Try it from source today.
A /computer tool family lets the agent see and drive any Windows GUI app, not just the terminal. Five tools, all available as native tool_use / tool_calls blocks and via /toolcall:
screenshot— capture the screen, return base64 PNG for vision modelsfind_window <title>— locate windows by title substring, returnspid+MainWindowHandleso other tools can target them preciselyclick <x> <y>/click_text "Save"— UI Automation pointer + button click via the accessibility treetype_text— paste arbitrary text into a target window (see below for the focus fix)read_screen_text— full-screen OCR via Tesseract, returns extracted text
type_text was rebuilt around two real-world bugs the naive SendKeys approach silently hides:
- Focus:
SendKeys::SendWaitposts to the foreground window — without an explicit focus grab, keystrokes hit the terminal running asi-code, not the app the user wanted.type_textnow accepts optionalwindow_pid(preferred, get it fromfind_window) orwindow_title, callsSetForegroundWindow+ShowWindow(SW_RESTORE)with a 150 ms settle delay, then types. - Whitespace and Unicode: Windows 11 Notepad (WinAppSDK) silently drops space characters from rapid
SendKeysinput, and SendKeys's special-character escapes (+ ^ % ~ ( ) { }) break naive payloads.type_textnow writes through the clipboard (Set-Clipboard+Ctrl+V) and restores the user's prior clipboard contents — arbitrary text round-trips byte-perfect, including CJK and emoji.
Three bridges turn the CLI into a remote control for the heavy-iron creative tools that the generic computer-control approach can't drive intelligently:
| Tool | Default driver | What it does |
|---|---|---|
ue5_bridge |
UnrealEditor-Cmd.exe -ExecutePythonScript=<file> |
Runs Python in a headless Unreal Editor session for the given .uproject. |
blender_bridge |
blender --background --python <file> |
Runs a Python script in a headless Blender; override the binary via ASI_BLENDER_BIN (needed for Microsoft Store installs). |
unity_bridge |
dispatched by action field |
Five modes — see below. |
unity_bridge is the most developed of the three. Pass action to pick a mode:
python(default) — legacy: spawnUnity -batchmode -executeMethod PythonRunner.RunFile, fresh headless instance per call.open— launch the Editor for the project and return immediately. Use this beforecsharp/create_terrainto make sure the live Editor is running. Unity Hub focuses an existing instance instead of duplicating.csharp— execute C# inside the already-running Editor. The bridge drops a one-shotAssets/Editor/AsiOneshot_<NONCE>.cswith an[InitializeOnLoad]hook, lets Unity's own compiler pick it up, polls a unique result file in%TEMP%forOK\n…orERR\n…, then the script self-deletes viaEditorApplication.delayCall. This is how you make interactive edits to the open scene without an extra IPC daemon — Unity's asset pipeline is the IPC channel.create_terrain— convenience: generate the C# that spawns aTerrainGameObject in the active scene (size, heightmap resolution, name all configurable), dispatch viacsharp.save—SaveOpenScenes()+SaveAssets()+Refresh(), also viacsharp.
Example:
/toolcall unity_bridge {"project":"D:/unity/My project","action":"open"}
/toolcall unity_bridge {"project":"D:/unity/My project","action":"create_terrain","name":"ParkourTerrain","size":[500,50,500]}
/toolcall unity_bridge {"project":"D:/unity/My project","action":"csharp","csharp":"var c = GameObject.CreatePrimitive(PrimitiveType.Cube); c.transform.position = new Vector3(10,5,10);"}
/toolcall unity_bridge {"project":"D:/unity/My project","action":"save"}
Bridge environment variables:
ASI_UE5_EDITOR/UE5_EDITOR— Unreal Editor binaryASI_BLENDER_BIN/BLENDER_BIN— Blender binary (set to the full path for Microsoft Store installs, e.g.C:\Program Files\WindowsApps\BlenderFoundation.Blender_*_x64_*\Blender\blender.exe)ASI_UNITY_EDITOR/UNITY_EDITOR— Unity binaryASI_BRIDGE_TIMEOUT_SECS— wait budget for batch calls and for thecsharpresult-file poll (default 120 s)
The bridge layer can drive engines, but "drive" alone is not enough — the model also needs to see what is in the scene before it acts, and verify what changed after. Frames of a viewport are interpretation; structured scene data is truth. Tier 3 adds both.
Six new tools, all exposed as native tool_use / tool_calls and /toolcall entries:
| Tool | Purpose |
|---|---|
blender_scene_probe |
Dump active Blender scene (objects, transforms, cameras, lights, actions, materials) as JSON via bpy. |
ue5_scene_probe |
Dump UE5 level state (actor list, transforms, materials, light/camera params) as JSON via Unreal Python. |
unity_scene_probe |
Dump active Unity scene as JSON by executing C# in the live Editor (same [InitializeOnLoad] drop pattern as unity_bridge action=csharp). |
probe_diff |
Deterministic structural diff between two probe payloads. Returns added / removed / modified (with the specific fields that changed) instead of a free-text "looks different." |
video_capture |
Capture a frame sequence to a directory (fps=2, duration_sec=6 defaults). v1 deliberately skips MP4 encoding — frames-on-disk is what the model actually consumes, and removes an external dependency. |
video_keyframes |
Pick a compact subset from a frame directory (default max_frames=12). Selection mixes boundary frames, change-magnitude ranking, and equidistant fill — so the model gets the most informative frames, not random samples. |
The system prompt steers the agent to probes first, video second: blender_scene_probe / ue5_scene_probe / unity_scene_probe are deterministic ground truth, while video_capture + video_keyframes are visual evidence used only when the structural data is not enough on its own.
Example loop — make a Unity edit, verify it structurally, capture supporting frames only on uncertainty:
/toolcall unity_scene_probe {"project":"D:/unity/My project"} # -> before.json
/toolcall unity_bridge {"project":"D:/unity/My project","action":"csharp","csharp":"GameObject.CreatePrimitive(PrimitiveType.Cube).transform.position = new Vector3(0,1,0);"}
/toolcall unity_scene_probe {"project":"D:/unity/My project"} # -> after.json
/toolcall probe_diff {"before":{...},"after":{...}} # -> {added:[Cube], modified:[]}
/toolcall video_capture {"duration_sec":4,"fps":2,"target":"window","window_title":"Unity"}
/toolcall video_keyframes {"dir":"<frame dir from previous step>","max_frames":8}
Why frames-on-disk instead of MP4: vision-capable LLMs ingest images, not video. Encoding to MP4 just to extract PNGs again is wasted work; the frame-folder hands the keyframe selector exactly what it needs and avoids pulling in ffmpeg as a runtime dependency.
The auto-loop's "no progress across too many rounds" circuit breaker previously only counted file mutations as progress. Read-heavy tasks (screenshot, find_window, bash inspection, web_search, OCR, computer-control sequences) would trip the breaker mid-investigation even while the model was making real headway.
The detector now classifies each round as one of FilesChanged / ReadOnlyToolSuccess / Nothing, and only the third increments the no-progress counter. The tunable cap (ASI_AUTO_AGENT_MAX_NO_PROGRESS_ROUNDS, default 12) is unchanged; what changed is what counts.
A 7th /theme option, cubist, gives the REPL a high-contrast Picasso-style look that goes beyond ANSI 16-color palettes. It is opt-in — pick 7 in /theme and the existing six themes stay byte-identical.
What changes when theme=cubist is active:
- Truecolor palette — 24-bit ANSI (
\x1b[38;2;R;G;B) cobalt / ochre / sage / terra cotta / slate / ivory replaces the basic 4-bit colors. - Asymmetric welcome mosaic — two side-by-side block-drawn panels with diagonal
╱╲cuts and a deconstructed◆ A ◇ S ◢ I ▲ ◆ C ◇ o ◢ d ▲ e ▽letter banner instead of the rounded box. - Geometric tool panel —
◢◣ TOOL <name> (<status>) ◣◢head with a▰▱block-fragment border, replacing the─line. - Animated spinner — a real tick-driven frame loop cycling through
◆ ◇ ▲ △ ▰ ▱at 200 ms intervals (a thread is spawned only in cubist; other themes keep the static glyph). - Deconstructed progress bar —
◇ progress ▰▰▰▱▱▱▱▱▱▱ 3/10rendered after each tool call in the auto-loop, parallel and sequential branches alike. - Streaming
<toolcall>interception — when the model emits raw<toolcall>…</toolcall>(or<tool_call>/<tool_calls>) XML mid-stream, the line buffer suppresses it and emits a single◢◣ INTENT ▸ <tool name>panel instead of dumping the XML to the terminal. - Hidden-content notice — the read_file compact body becomes
◢ [read_file:… lines …] / ◇ content hidden ◇ use /toolcall read_file …instead of the previous parenthetical. - Diff highlighting in edit_file / write_file panels —
+/-/@@/[section]lines inside the tool body are colored with the cubist diff palette (sage on dark for added, ivory on terra-cotta for removed).
Pick the theme: /theme → 7. Persisted in AppConfig.theme. Truecolor requires a modern terminal (Windows Terminal, VS Code terminal, iTerm2, mintty); legacy conhost falls back gracefully on the other six themes.
The runtime tracks both cumulative input tokens and live turn count. Earlier the only auto-trigger was a token threshold (ASI_AUTO_COMPACT_INPUT_TOKENS, default 120000) and it only fired inside the auto-tool-loop. A long auto-loop could rack up 200 turns at 40 K tokens, hit max_turns_reached, and then every subsequent REPL input would fail immediately because turn-count is the gate.
Two changes close this gap:
- Turn-ratio trigger —
Runtime::auto_compact_recommendation_by_turns(ratio)returnsSome(reason)whenturn_count() >= ceil(max_turns * ratio). The default ratio is 0.80 (so atmax_turns=200, compaction fires at 160). Tune withASI_AUTO_COMPACT_TURN_RATIO=0.0to disable, or any(0.0, 1.0]value. - Pre-turn REPL guard — before each
run_turn_streamingcall, the REPL checks both the token threshold and the turn ratio. If either fires, it runscompact_with_summary(8)first, prints the result, and proceeds. So even if you walked away from a session that hitmax_turns_reached, the next prompt auto-compacts and continues normally instead of returning the error immediately.
The auto-tool-loop also picks up the turn-ratio trigger alongside the existing token trigger, so long-running fan-outs (50+ tool calls) compact mid-run instead of waiting for either limit to land.
Default-OFF, opt-in via ASI_AUTO_TEST=1. Once enabled, every iteration of the auto-tool-loop that touches code (write_file / edit_file / /toolcall write_file …) is followed by a real test run. The detector classifies the changed files by suffix and only fires the matching language's test command:
| Language trigger | Marker required | Command emitted |
|---|---|---|
.rs / Cargo.toml / Cargo.lock |
Cargo.toml in CWD |
cargo test --offline --quiet --no-fail-fast |
.py |
pytest.ini OR pyproject.toml with [tool.pytest…] OR setup.cfg with [tool:pytest] |
pytest -q --no-header |
.ts / .tsx / .js / .jsx / .mjs / .cjs |
package.json with non-empty scripts.test |
npm test --silent |
On failure, the loop:
- Renders an
auto_test (error)tool panel with the clipped (6000 char) trace. - Pushes a synthetic user-role message
[auto_test:error] One or more tests failed after your last code change. Diagnose the root cause from the trace below and fix it. Do not skip or weaken tests.followed by the command and trace into runtime history. - Lets the next loop iteration run normally — the model now has the failure in context and produces a fix.
Self-heal is capped by ASI_AUTO_TEST_MAX_ATTEMPTS (default 3). After that many consecutive failures the loop exits with stop_reason=auto_test_max_attempts_reached instead of looping forever. Outside the auto-tool-loop (manual /toolcall write_file etc.) the same test command runs at the end of the turn for visibility, but no self-heal injection happens.
Project-marker-aware: a Rust-only repo never runs pytest, a Python-only repo never runs cargo test. Multi-language repos run only the tests for languages whose source actually changed this turn. Pure docs / markdown edits never trigger tests.
Long auto-tool-loops (hours of agent work) used to be all-or-nothing: a single crash, network blip, or laptop sleep mid-run discarded every prior tool call's spend. The journal layer turns the existing checkpoint into a per-iteration journal, so the next launch can resume from the last completed iteration with zero replay.
Default ON; disable with ASI_AUTO_JOURNAL=0. What changes:
- Per-iteration save (throttled): inside
run_tool_loop_core, after every iteration finishes, the runtime writesmessages+changed_files+change_events+original_task_input+ iteration counter intosessions/_checkpoint_latest.jsonunder a newmeta.in_loop_stateblock. Throttled to one save perASI_AUTO_JOURNAL_INTERVAL_SECS(default30) so a fast loop doesn't hammer disk. loop_runningflag: every in-loop save marksloop_running=true. The final save on any terminal branch (completed, stopped, errored,auto_test_max_attempts_reached) flips it tofalse, so a cleanly-finished loop never triggers the resume prompt on the next launch.- Startup auto-prompt: when the REPL starts, if
_checkpoint_latest.jsonhasloop_running=trueand a non-emptyoriginal_task_input, you see:Enter (orINFO interrupted auto-loop detected: iterations=47 last_activity=12m ago task="fix the parser bug…" Resume? [Y/n]y) restoresrt.messages,changed_files,change_events, and re-enters the auto-tool-loop with a[resume]banner so the model continues from where it left off.nkeeps the checkpoint on disk for later. - Manual resume:
/checkpoint resumedoes the same thing mid-session — useful if you dismissed the startup prompt and changed your mind, or want to abandon the current REPL state and pick up the prior interrupted loop.
The journal piggybacks on the existing single-file checkpoint, so disk footprint stays bounded — each save overwrites the previous. v1 keeps only the latest snapshot; full history with named resumable points is a v2.
- Tier 1 (shipped): screen capture, window targeting, click, typing, on-screen OCR.
- Tier 2 (shipped): UE5 / Blender / Unity bridges; Unity has live-editor C# drop.
- Tier 3 (shipped): 3D-aware scene probes for UE5 / Blender / Unity, deterministic
probe_diff, frame-foldervideo_capture+video_keyframesfor temporal context. - Engineering reliability (shipped on
main): cubist Picasso theme, auto-compact (token + turn-ratio + pre-turn guard), test feedback loop (cargo test/pytest/npm testwith self-heal), auto-loop journal + resume (per-iteration checkpoint + startup auto-resume prompt). - Tier 4 (planned, ~1 week): MCP (Model Context Protocol) integration — the existing tools list (
bash,read_file,edit_file,glob_search,grep_search, computer-control, engine bridges, scene probes) is all hardcoded in Rust today. Adding a proper MCP client lets users plug in any MCP server — Jira, Confluence, GitHub Enterprise, Datadog, Snowflake, internal RAG, anything the community ships — without patching ASI Code source. This is the single largest leverage point for the B2B story: it converts a fixed tool set into an open ecosystem and is what every "agentic IDE" in the market is converging on. Listed as the next milestone after engineering-reliability work lands. - Tier 5 (planned, ~2-3 weeks): Semantic codebase index — full-suite test feedback only works when the model can actually navigate the repo. On a 50K-line project glob+grep is fine; on a 500K-line monorepo it returns hundreds of low-signal matches that burn context. The plan is an embeddings + AST index (call graph, type hierarchy, file synopsis cache extended to symbol-level) so queries like "find all callers of
PaymentService" or "show me every place this type is consumed" return ranked results without scanning every file. This is the gating capability for true enterprise-scale work; Cursor / Claude Code both ship a version of it. Holds until Tier 4 lands because the MCP layer naturally hosts the index server. - Tier 6 (next, then): mobile and cross-device remote — a small relay so the CLI can be triggered from a phone or another machine.
- Tier 7 (deliberately not pursued in 2.0): AGI-level autonomous creative work. The bridge layer is the leverage — when the underlying models get stronger, every existing bridge inherits the new capability automatically.
cd "<path\to\ASI-Code>"
cargo run --offline -- repl --project "D:\Code\YourProject" --provider deepseek --model deepseek-v4-proThe CLI can execute real long-running tasks through tool calls, with approval gating, live progress, and artifact output.
/toolcall bash command="cd D:\\test_code; python train_nn.py 2>&1"
What happened
Prompted for approval first (permission_mode=on-request)
Executed the command after approval
Streamed heartbeat logs during long execution (INFO bash still running ...)
Returned full training output
Saved generated artifact to disk:
D:/test_code/training_results.png
Sample output excerpt
Training PyTorch model for 1500 epochs...
Epoch 300/1500 | train_loss: 0.0034 | val_loss: 0.0036 | val_acc: 1.0000
Epoch 600/1500 | train_loss: 0.0006 | val_loss: 0.0008 | val_acc: 1.0000
...
Epoch 1500/1500 | train_loss: 0.0001 | val_loss: 0.0001 | val_acc: 1.0000
Plot saved to: D:/test_code/training_results.png
TOOL bash (ok)
This demonstrates three core behaviors:
1.Safe execution control (approval gate)
2.Reliable long-task handling (progress heartbeat + streaming logs)
3.End-to-end task completion (command success + output artifact)
## Real CLI Execution Example
The CLI can execute real long-running tasks through tool calls, with approval gating, live progress, and artifact output.
### Command
```text
/toolcall bash command="cd D:\\test_code; python train_nn.py 2>&1"
What happened
Prompted for approval first (permission_mode=on-request)
Executed the command after approval
Streamed heartbeat logs during long execution (INFO bash still running ...)
Returned full training output
Saved generated artifact to disk:
D:/test_code/training_results.png
Sample output excerpt
Training PyTorch model for 1500 epochs...
Epoch 300/1500 | train_loss: 0.0034 | val_loss: 0.0036 | val_acc: 1.0000
Epoch 600/1500 | train_loss: 0.0006 | val_loss: 0.0008 | val_acc: 1.0000
...
Epoch 1500/1500 | train_loss: 0.0001 | val_loss: 0.0001 | val_acc: 1.0000
Plot saved to: D:/test_code/training_results.png
TOOL bash (ok)
This demonstrates three core behaviors:
1.Safe execution control (approval gate)
2.Reliable long-task handling (progress heartbeat + streaming logs)
3.End-to-end task completion (command success + output artifact)
## Standalone Windows Install (No npm/pnpm)
Install ASI Code as a standalone app (`asi.exe`) with one command:
```powershell
cd "<path\to\ASI-Code>"
powershell -ExecutionPolicy Bypass -File .\scripts\windows\install_asi.ps1 -BuildRelease
Package a distributable release for users (zip + one-click installer exe):
powershell -ExecutionPolicy Bypass -File .\scripts\windows\package_release.ps1Generated artifacts:
dist\asi-code-installer-<version>.exe(one-click installer, creates Start Menu entries)dist\asi-code-installer-<version>.exe.sha256.txtdist\asi-code-windows-x64-<version>.zipdist\asi-code-windows-x64-<version>.zip.sha256.txt
Inside the ZIP root:
asi.exe(portable launcher, double-click entry)ASI Launcher.exe(same launcher name for clarity)start_asi.cmd(script-based launcher)bin\asi.exe(CLI engine binary)
Detailed guide: INSTALL_WINDOWS.md
cd "<path\to\ASI-Code>"
.\start_asi.ps1What start_asi.ps1 does:
- Prompts provider: OpenAI / DeepSeek / Claude
- Prompts matching API key env (
OPENAI_API_KEY/DEEPSEEK_API_KEY/ANTHROPIC_API_KEY) - Prompts project path
- Runs:
cargo run --release -- repl --provider <provider> --project <path> --no-setup
Optional flags:
.\start_asi.ps1 -Provider openai
.\start_asi.ps1 -Provider claude -ProjectPath "D:\Code\YourProject"
.\start_asi.ps1 -WithSetupDouble-click launcher:
.\start_asi.cmdcd /mnt/d/Code/Rust
chmod +x ./start_asi.sh
./start_asi.sh /mnt/d/Code/RustSkip startup setup wizard:
./start_asi.sh /mnt/d/Code/Rust --no-setupOptional API keys before launch:
export OPENAI_API_KEY="..."
export DEEPSEEK_API_KEY="..."
export ANTHROPIC_API_KEY="..."
export ASI_AUTO_REVIEW_MODE="warn"
export ASI_AUTO_REVIEW_SEVERITY_THRESHOLD="medium"- Run ASI Code from your project folder (or pass
--project) and it will read/write directly in that workspace. - Agent file edits are written to the same files you see in VS Code Explorer.
- Agent command execution happens in terminal via
/run <command>or/toolcall bash <command>.
cargo run --offline -- version
cargo run --offline -- api-page
cargo run --offline -- theme
cargo run --offline -- theme --select 1
cargo run --offline -- setup
cargo run --offline -- scan --deep
cargo run --offline -- scan --deep-limit 20 "**/*.py"
cargo run --offline -- tokenizer doctor --repo "D:\Code\rustbpe"
cargo run --offline -- tokenizer build --repo "D:\Code\rustbpe" --timeout-secs 900
cargo run --offline -- tokenizer train --repo "D:\Code\rustbpe" --input "D:\data\corpus.txt" --vocab-size 8192 --timeout-secs 1800 --auto-build
cargo run --offline -- wiki init --root "D:\Code\my-wiki"
cargo run --offline -- wiki ingest --root "D:\Code\my-wiki" --source "D:\Code\my-wiki\raw-input\paper.md" --title "Paper Notes"
cargo run --offline -- wiki query --root "D:\Code\my-wiki" --question "what changed in method section" --top 5 --save
cargo run --offline -- wiki lint --root "D:\Code\my-wiki" --write-report
cargo run --offline -- prompt "review this repo" --project "D:\Code\YourProject" --output-format text
cargo run --offline -- prompt "review this repo" --output-format json
cargo run --offline -- prompt "review this repo" --output-format jsonl
cargo run --offline -- repl --speed sprint
cargo run --offline -- prompt "review this repo" --speed deep --output-format json
cargo run --offline -- bench --provider deepseek --model deepseek-reasoner --project "<path\to\ASI-Code>" --suite core --agent-max-steps 8 --repeat 1 --out-dir bench_reports
cargo run --release -- bench --provider deepseek-reasoner --model deepseek-reasoner --project "<path\to\ASI-Code>" --suite gpt53-proxy6d --agent-max-steps 4 --repeat 3 --out-dir bench_reports
cargo run --offline -- sessions --limit 20
cargo run --offline -- self-update --source "<path\to\ASI-Code>\dist\asi-code-windows-x64-0.3.0.zip"
cargo run --offline -- self-update --source "https://example.com/asi-code-windows-x64-0.3.0.zip" --sha256 "<sha256>"
cargo run --offline -- config --telemetry-enabled true --safe-shell-mode true --undercover-mode true
cargo run --offline -- config --disable-web-tools true --disable-bash-tool false
cargo run --offline -- config --auto-review-mode warn --auto-review-severity-threshold medium
cargo run --offline -- config --allow-tool-rule read_file --allow-tool-rule "bash:git "
cargo run --offline -- config --deny-tool-rule "bash:rm -rf" --clear-tool-rules
cargo run --offline -- config --path-restriction-enabled true --additional-dir "D:\Code\shared"
cargo run --offline -- config --execution-speed sprint
cargo run --offline -- mcp list --json
cargo run --offline -- mcp add local-agent "python -m mcp_server" --json
cargo run --offline -- mcp config scope local-agent project --json
cargo run --offline -- mcp config trust local-agent on --json
cargo run --offline -- plugin list --json
cargo run --offline -- plugin add demo-plugin "D:\Code\my-plugin" --json
cargo run --offline -- plugin trust demo-plugin manual --json
cargo run --offline -- plugin trust demo-plugin hash --json
cargo run --offline -- plugin verify demo-plugin --json
powershell -ExecutionPolicy Bypass -File .\scripts\windows\benchmark_regression.ps1 -Project "D:\Code" -Agent/help,/status,/project [path],/cost,/compact,/clear,/changes,/changes clear,/changes tail [n],/changes file <pattern>,/changes export <path> [md|json] [n],/exit/provider <name>,/model <name>,/profile [standard|strict],/speed [sprint|deep],/permissions list|mode <mode>|allow <rule>|deny <rule>|rm-allow <rule>|rm-deny <rule>|clear-rules|path-restriction on|off|dirs|add-dir <path>|rm-dir <path>|clear-dirs|temp-list|temp-allow <rule>|temp-deny <rule>|temp-rm-allow <rule>|temp-rm-deny <rule>|temp-clear|temp-dirs|temp-add-dir <path>|temp-rm-dir <path>|temp-clear-dirs|temp-next-allow <rule>|temp-next-add-dir <path>|temp-next-clear|auto-review <off|warn|block>|auto-review-threshold <critical|high|medium|low>/theme,/setup,/scan [patterns...] [--deep|--deep=N],/project <path>,/import <path>,/run <command>,/work <task>,/code <task>,/secure <task>,/workmode on|off,/auto on|off,/autoresearch help|doctor [--repo <path>]|init [--repo <path>]|run [--repo <path>] [--iterations <n>] [--timeout-secs <sec>] [--log <path>] [--description <text>] [--status <keep|discard|crash>],/tokenizer help|doctor [--repo <path>]|build [--repo <path>] [--debug] [--timeout-secs <sec>]|train --input <corpus.txt> [--repo <path>] [--vocab-size <n>] [--output <path>] [--pattern <regex>] [--name <name>] [--python-cmd <cmd>] [--timeout-secs <sec>] [--auto-build|--no-auto-build]/runtime-profile [safe|fast|status](one-command runtime safety preset switch)/markdown on|off,/think on|off/privacy status|telemetry on|off|tool-details on|off|undercover on|off|safe-shell on|off/flags list|set <web_tools|bash_tool|subagent|research> on|off/policy sync/tools,/toolcall <tool> <args>/audit tail [n] | /audit stats [n] | /audit tools [n] | /audit reasons [n] | /audit export <path> [md|json] [n] | /audit export-last [dir] [md|json|both] [n](tail, summaries, and export report)/sessions [limit],/resume <id>,/save,/checkpoint [status|on|off|save|load|clear]/oauth login <token>,/oauth logout/todo ...,/memory ...,/git ...,/mcp [list [--json]|add <name> <command> [--scope <session|project|global>] [--json]|rm <name> [--json]|show <name> [--json]|auth <name> <none|bearer|api-key|basic> [value] [--json]|oauth login <name> <provider> <token> [--scope <session|project|global>] [--link-auth] [--json]|oauth status <name> [provider] [--scope <session|project|global>] [--json]|oauth logout <name> [provider] [--scope <session|project|global>] [--json]|config <name> <key> <value> [--json]|config rm <name> <key> [--json]|config scope <name> <session|project|global> [--json]|config trust <name> <on|off> [--json]|export <path.json> [--json]|import <path.json> [merge|replace] [--json]|start <name> [command] [--json]|stop <name> [--json]],/plugin [list [--json]|add <name> <path> [--json]|rm <name> [--json]|show <name> [--json]|enable <name> [--json]|disable <name> [--json]|trust <name> <manual|hash> [hash] [--json]|verify <name> [--json]|config set <name> <key> <value> [--json]|config rm <name> <key> [--json]|export <path.json> [--json]|import <path.json> [merge|replace] [--json]|market [--json]],/notebook ...,/agent [spawn [--json|--jsonl] <task>|send [--json|--jsonl] [--interrupt] [--no-context] <id> <task>|wait [--json|--jsonl] [id] [timeout_secs]|list [--json|--jsonl]|status [--json|--jsonl] <id>|log [--json|--jsonl] <id> [--tail <n>]|retry [--json|--jsonl] <id>|cancel [--json|--jsonl] <id>|close [--json|--jsonl] <id>|view [foreground|background|all]|front|back]- Undercover commit helper:
/git commit-msg <message>
--output-format text: human-readable output--output-format json: single JSON object (stable machine payload)--output-format jsonl: line-delimited JSON events (schema_version=1) for CI/automation pipelinesprompt.resultprompt.changed_filesprompt.native_tool_callsprompt.auto_validationprompt.reviewprompt.runtime
When using JSON-enabled /agent commands, output uses a stable envelope:
{
"schema_version": "1",
"command": "<spawn|send|list|status|wait|log|retry|cancel|close>",
"agent": { "...": "..." }
}Compatibility policy:
schema_version=1remains stable for backward-compatible additions.- Any breaking field rename/removal or shape change requires a schema version bump.
When using /agent ... --jsonl, each command emits one JSONL event row:
{
"schema_version": "1",
"event": "agent.<spawn|send|list|status|wait|log|retry|cancel|close>",
"data": {
"command": "<spawn|send|list|status|wait|log|retry|cancel|close>",
"agent": { "...": "same payload shape as --json agent field" }
}
}/agent spawn --json <task>(or--jsonl)- optional profile/run mode:
/agent spawn --json --profile <name> [--background|--foreground] <task> agent:id,status(running),provider,model,run_mode(foreground|background),task
- optional profile/run mode:
/agent list --json(or--jsonl)/agent list --json [--scope <foreground|background|all>] [--profile <name>] [--skill <name>]agent:count,filters_applied(scope,profile,skill),diagnostics(filters,total_items,counts,run_modes,timings),items[]- each item:
id,status,provider,model,run_mode,turns,interrupted_count,last_interrupted_at_ms,started_at_ms,finished_at_ms,task,preview
/agent status --json <id>(or--jsonl)agent:id,status,provider,model,allow_rules,deny_rules,rules_source,diagnostics(rules_source,allow_rule_count,deny_rule_count),run_mode,turns,interrupted_count,last_interrupted_at_ms,started_at_ms,finished_at_ms,age_ms,duration_ms,task,preview- unknown id:
agent.id,agent.status=unknown
/agent wait --json [id] [timeout_secs](or--jsonl)- finished:
agent.id,provider,model,run_mode,task,started_at_ms,finished_at_ms,status(done|error),ok,result - timeout:
agent.status=timeout,timeout_secs,message - idle:
agent.status=idle,message
- finished:
/agent close --json <id>(or--jsonl)agent:id,status(closed),message
/agent cancel --json <id>(or--jsonl)agent:id,status(cancelled|closed|completed|failed|unknown),message
/agent retry --json <id>(or--jsonl)agent:id,status,provider,model,turns,run_mode,task,message
/agent log --json <id> [--tail <n>](or--jsonl)agent:id,status,provider,model,run_mode,turns,events_total,tail,items[]- each log item:
at_ms,event,message
/agent send --json [--interrupt] [--no-context] <id> <task>(or--jsonl)agent:id,status,provider,model,run_mode,turns,interrupted_count,last_interrupted_at_ms,started_at_ms,finished_at_ms,task,context(append|reset),interrupt,message
# Spawn
/agent spawn --json "inspect src/main.rs"
# Spawn with agent profile (loaded from ./agent_profiles.json)
/agent spawn --json --profile safe-review "inspect src/main.rs"
# Spawn as background task (for /agent view background)
/agent spawn --json --background "inspect src/main.rs"
# List
/agent list --json
/agent list --json --scope background --profile safe-review --skill review
# Send
/agent send --json sa-1 "continue with tests"
# Status
/agent status --json sa-1
# Wait
/agent wait --json sa-1 30
# Close
/agent close --json sa-1
# Cancel running task
/agent cancel --json sa-1
# Retry last task for one subagent
/agent retry --json sa-1
# Show latest subagent events
/agent log --json sa-1 --tail 20When using JSON-enabled /mcp commands, output uses a stable envelope:
{
"schema_version": "1",
"command": "<mcp_list|mcp_show|mcp_add|mcp_rm|mcp_auth|mcp_config_set|mcp_config_rm|mcp_export|mcp_import|mcp_start|mcp_stop>",
"mcp": { "...": "..." }
}Compatibility policy:
schema_version=1remains stable for backward-compatible additions.- Any breaking field rename/removal or shape change requires a schema version bump.
/agent spawn --profile <name> <task> can apply project-local defaults from ./agent_profiles.json.
Supported fields:
providermodelpermission_modeallowed_tools(tool whitelist; maps to allow rules in subagent runtime)denied_tools(tool deny list; maps to deny rules in subagent runtime)default_skills(skill labels attached to subagent metadata)disable_web_toolsdisable_bash_tool
Example:
{
"profiles": {
"safe-review": {
"provider": "deepseek",
"model": "deepseek-reasoner",
"permission_mode": "on-request",
"allowed_tools": ["read_file", "glob_search", "grep_search"],
"denied_tools": ["bash"],
"default_skills": ["review", "security"],
"disable_web_tools": true,
"disable_bash_tool": false
},
"fast-code": {
"provider": "openai",
"model": "gpt-5.3-codex",
"permission_mode": "workspace-write"
}
}
}Notes:
allowed_toolsis enforced as allow-rules in the subagent runtime. Tools outside the list are blocked.denied_toolsis enforced as deny-rules in the subagent runtime. Matching tools are blocked even if broadly allowed.default_skillsis surfaced in agent JSON outputs (spawn/list/status/send/wait) and logged for traceability.
/mcp list --jsonmcp:count,diagnostics(trusted_count,untrusted_count,scope_counts),items[]
- each item:
name,status,pid,command,scope,trusted,auth_type,auth_value,config[](key,value) /mcp show <name> --json- found:
mcpserver record shape (same fields as list item) plusdiagnostics(has_auth_value,config_key_count,scope,trusted,oauth_provider,oauth_token_present) - missing:
mcp.name,mcp.status=unknown
- found:
/mcp add <name> <command> [--scope <session|project|global>] --jsonmcp:added(bool),scope,server(server record)
/mcp rm <name> --jsonmcp:name,changed(bool)
/mcp auth <name> <none|bearer|api-key|basic> [value] --jsonmcp:name,auth_type,value_set(bool)
/mcp oauth login <name> <provider> <token> [--scope <session|project|global>] [--link-auth] --jsonmcp:name,provider,scope,saved(bool),linked_auth(bool)
/mcp oauth status <name> [provider] [--scope <session|project|global>] --jsonmcp:name,provider,token_present(bool),token_scope,request_scope,stored_providers(string array)
/mcp oauth logout <name> [provider] [--scope <session|project|global>] --jsonmcp:name,provider,scope,removed(bool)
/mcp config <name> <key> <value> --jsonmcp:name,key
/mcp config rm <name> <key> --jsonmcp:name,key,changed(bool)
/mcp config scope <name> <session|project|global> --jsonmcp:name,scope
/mcp config trust <name> <on|off> --jsonmcp:name,trusted(bool)
/mcp export <path.json> --jsonmcp:path
/mcp import <path.json> [merge|replace] --jsonmcp:path,mode,total_servers
/mcp start <name> [command] --json- success:
mcp:started(bool),server(server record) - blocked/error:
mcp:started=false,name,error
- success:
/mcp stop <name> --jsonmcp:name,changed(bool)
# List
/mcp list --json
# Show
/mcp show local-agent --json
# Add
/mcp add local-agent "python -m mcp_server" --json
# OAuth (stored token for MCP server scope)
/mcp oauth login local-agent deepseek sk-example --scope project --link-auth --json
/mcp oauth status local-agent deepseek --scope project --json
/mcp oauth logout local-agent deepseek --scope project --json
# Start / Stop
/mcp start local-agent --json
/mcp stop local-agent --jsonEquivalent top-level CLI subcommands:
asi mcp list --json
asi mcp add local-agent "python -m mcp_server" --json
asi mcp config scope local-agent project --json
asi mcp config trust local-agent on --json
asi mcp oauth status local-agent deepseek --scope project --jsonServer records support optional publish metadata via /mcp config:
sourceversionsignature
Accepted formats:
sourcemust start with one of:https://,http://,git+,file://,local://signaturemust start withsha256:orsig:versionmust be non-empty when set
Examples:
/mcp config local-agent source "https://example.com/org/mcp-server" --json
/mcp config local-agent version "1.2.3" --json
/mcp config local-agent signature "sha256:abcd1234" --json
asi mcp config local-agent source "https://example.com/org/mcp-server" --json
asi mcp config local-agent version "1.2.3" --json
asi mcp config local-agent signature "sig:publisher-v1" --jsonWhen using JSON-enabled /plugin commands (or asi plugin ... --json), output uses:
{
"schema_version": "1",
"command": "<plugin_list|plugin_add|plugin_rm|plugin_show|plugin_enable|plugin_disable|plugin_trust|plugin_config_set|plugin_config_rm|plugin_export|plugin_import>",
"plugin": { "...": "..." }
}Quick examples:
/plugin list --json
/plugin show demo-plugin --json
/plugin trust demo-plugin manual --json
/plugin trust demo-plugin hash --json
/plugin verify demo-plugin --json
asi plugin list --json
asi plugin add demo-plugin "D:\Code\my-plugin" --json
asi plugin trust demo-plugin manual --json
asi plugin trust demo-plugin hash --json
asi plugin verify demo-plugin --jsontrust ... hash stores a deterministic SHA-256 of the plugin directory contents (not only manifest),
so changing plugin code/config invalidates trust until re-trusted.
Plugin records support optional publish metadata via /plugin config set:
sourceversionsignature
Accepted formats:
sourcemust start with one of:https://,http://,git+,file://,local://signaturemust start withsha256:orsig:versionmust be non-empty when set
Examples:
/plugin config set demo-plugin source "https://example.com/org/demo-plugin" --json
/plugin config set demo-plugin version "0.9.0" --json
/plugin config set demo-plugin signature "sha256:abcd1234" --json
asi plugin config set demo-plugin source "https://example.com/org/demo-plugin" --json
asi plugin config set demo-plugin version "0.9.0" --json
asi plugin config set demo-plugin signature "sig:publisher-v1" --json- OpenAI:
OPENAI_API_KEY,OPENAI_BASE_URL - DeepSeek:
DEEPSEEK_API_KEY,DEEPSEEK_BASE_URL - Claude:
ANTHROPIC_API_KEY,ANTHROPIC_BASE_URL - ASI toggles:
ASI_TELEMETRY,ASI_UNDERCOVER,ASI_AUTO_CHECKPOINT,ASI_NATIVE_TOOL_CALLING,ASI_PROVIDER_MAX_RETRIES,ASI_PROVIDER_RETRY_BACKOFF_MS,ASI_MODEL_AUTO_FALLBACK - Auto-compaction:
ASI_AUTO_COMPACT_INPUT_TOKENS(default120000;0disables the token trigger),ASI_AUTO_COMPACT_TURN_RATIO(default0.80; values outside(0.0, 1.0]disable the turn trigger). Both are evaluated before each REPL turn AND inside the auto-tool-loop. - Test feedback loop (opt-in):
ASI_AUTO_TEST(1/true/onto enable; default OFF),ASI_AUTO_TEST_MAX_ATTEMPTS(default3, clamped to>=1; caps consecutive self-heal attempts before the loop exits withauto_test_max_attempts_reached). - Auto-loop journal (default ON):
ASI_AUTO_JOURNAL(0/false/offto disable),ASI_AUTO_JOURNAL_INTERVAL_SECS(default30, clamped to>=1; minimum seconds between per-iteration saves to bound disk writes). - Project instruction loading:
ASI_PROJECT_INSTRUCTIONS_LAYERED(defaulttrue),ASI_PROJECT_INSTRUCTIONS_MAX_LEVELS(default4),ASI_CLAUDE_SINGLE(defaulttrue)- instruction candidates (high to low priority per directory):
- Claude single mode:
CLAUDE.override.md,CLAUDE.local.md,CLAUDE.md - fallback mode:
AGENTS.override.md,AGENTS.local.md,AGENTS.md,README.override.md,README.local.md,README.md - non-single mode loads all above in order
- Claude single mode:
- instruction candidates (high to low priority per directory):
- Hooks (disabled by default):
ASI_HOOKS_ENABLED,ASI_HOOK_PRE_TOOL_USE,ASI_HOOK_PERMISSION_REQUEST,ASI_HOOK_POST_TOOL_USE,ASI_HOOK_SESSION_START,ASI_HOOK_USER_PROMPT_SUBMIT,ASI_HOOK_STOP,ASI_HOOK_SUBAGENT_STOP,ASI_HOOK_PRE_COMPACT,ASI_HOOK_POST_COMPACT,ASI_HOOK_TIMEOUT_SECS(default15),ASI_HOOK_JSON(defaulttrue, providesASI_HOOK_INPUT_JSON),ASI_HOOK_CONFIG_PATH(optional JSON handler matrix file),ASI_HOOK_FAILURE_POLICY(fail-closeddefault, supportsfail-open)- Hook plugin context envs:
ASI_HOOK_PLUGIN_COUNT,ASI_HOOK_PLUGIN_NAMES(trusted+enabled plugin names CSV) - Windows lifecycle hook template:
scripts/windows/hooks/lifecycle_event.ps1(logs SessionStart/UserPromptSubmit/Stop/SubagentStop/PreCompact/PostCompact into.asi/hooks.lifecycle.log) - Trusted + enabled plugins can also provide hook scripts in
.codex-plugin/plugin.jsonunderhooks:- single-event keys:
pre_tool_use,permission_request,post_tool_use,session_start,user_prompt_submit,stop,subagent_stop,pre_compact,post_compact - optional
handlersarray with fields:event,script,timeout_secs,json_protocol,tool_prefix,permission_mode,failure_policy - runtime executes order: env hook -> config handlers -> plugin hooks (deterministic by plugin name)
- single-event keys:
- Hook plugin context envs:
- Subagent auto tool-loop toggle:
ASI_SUBAGENT_TOOL_LOOP(defaulttrue) - Review risk scoring weights:
ASI_REVIEW_RISK_WEIGHT_CRITICAL(default8),ASI_REVIEW_RISK_WEIGHT_HIGH(default4),ASI_REVIEW_RISK_WEIGHT_MEDIUM(default2),ASI_REVIEW_RISK_WEIGHT_LOW(default1),ASI_REVIEW_RISK_WEIGHT_UNKNOWN(default1) - Review JSON-only strict gate:
ASI_REVIEW_JSON_ONLY_STRICT_SCHEMA(defaultfalse; whentrue, invalid/review --json-onlyoutput is wrapped in an explicit error envelope) - Review JSON-only strict fail exit:
ASI_REVIEW_JSON_ONLY_STRICT_FAIL_EXIT(defaultfalse; whentrue, prompt mode exits non-zero if strict JSON-only schema validation fails) - Review JSON-only prompt envelope:
ASI_REVIEW_JSON_ONLY_PROMPT_ENVELOPE(defaultfalse; whentrue, prompt/review --json-onlysuccess output uses the same{schema_version,status,review}envelope as REPL) - Security defaults:
- Default
permission_modeison-request(interactive approvals for mutating tools) - Default sandbox mode is
local(startup setsASI_SANDBOX=localwhen unset; explicit env keeps priority) - MCP start trust gate: untrusted MCP servers are blocked by default; trust explicitly with
/mcp config trust <name> on(override for controlled environments:ASI_MCP_ALLOW_UNTRUSTED_START=true) - Use
/runtime-profile safeto enforceon-request + local - Use
/runtime-profile fastto switch toworkspace-write + disabled
- Default
/status includes project_context sources=<n> [...] so you can verify which instruction files were loaded.
When hooks are enabled, /status also reports hook diagnostics summary:
hooks enabled=true diagnostics=<n> denied=<n> errors=<n>- up to 5 recent hook outcome lines in shape:
hook source=<env-hook|config-hook|plugin-hook> event=<...> allow=<...> is_error=<...> reason=<...>When hooks are disabled, it reports:
hooks enabled=false
Windows hook templates are provided under scripts/windows/hooks/ with ready-to-use examples.
Includes permission_request_strict.ps1 for default-deny bash policy with whitelist prefixes.
Also includes hooks.config.example.json for event-matrix style hook configuration.
For quick enable/disable in the current PowerShell session, use:
scripts/windows/hooks/enable_strict_hooks.ps1scripts/windows/hooks/disable_hooks.ps1
Hook config matrix (ASI_HOOK_CONFIG_PATH) supports multiple handlers with filters:
event:PreToolUse,PermissionRequest,PostToolUse,SessionStart,UserPromptSubmit,Stop,SubagentStop,PreCompact,PostCompact, or*script: command string to executetimeout_secs: optional per-handler overridejson_protocol: optional per-handler overridetool_prefix: optional tool name prefix filter (for examplebash)permission_mode: optional permission mode filter (for exampleworkspace-write)failure_policy: optional per-handler override (fail-closedorfail-open)
Failure policy behavior:
fail-closed: hook runtime errors (spawn failure, timeout, non-json parse/exec errors) block the action.fail-open: hook runtime errors are treated as allow, but explicit deny results still block.
If both legacy env hooks and config handlers are set, both run for the same event.
Hook JSON versioning policy:
schema_versionis the top-level hook payload schema version (currently"1").event_versionis per-event payload contract version (currently"1"for all events).- Backward-compatible field additions keep the same version; breaking changes require bumping the corresponding version and update notes.
Prompt JSON output includes a review object for /review ... tasks:
schema_version("1", stable for backward-compatible additions)is_review_task(bool)schema_valid(bool)schema_error(string|null)sectionswhen parseable:findings(structured objects:severity,normalized_severity,path,line,location,summary,evidence,risk,raw)findings_sorted(same shape asfindings, sorted by severity and location for deterministic UI ordering)findings_raw(original lines for compatibility)missing_tests,open_questions,summary
stats:has_findings(bool)total_findings(number)severity_counts(critical,high,medium,low,unknown)risk_score_total(number, weighted total across all findings using configured severity weights)missing_tests_count(number, excludesNone)top_risk_paths(top files by weighted risk score, includes per-path severity counts)
Machine-consumable example:
cargo run --release -- prompt "/review inspect parser" `
--provider openai `
--model gpt-5.3-codex `
--project "<path\to\ASI-Code>" `
--output-format json | `
ConvertFrom-Json | `
Select-Object -ExpandProperty review | `
ConvertTo-Json -Depth 8Fast review-only JSON (no wrapper envelope):
cargo run --release -- prompt "/review inspect parser --json-only" `
--provider openai `
--model gpt-5.3-codex `
--project "<path\to\ASI-Code>"Optional strict CI gate for /review --json-only:
$env:ASI_REVIEW_JSON_ONLY_STRICT_SCHEMA="true"
$env:ASI_REVIEW_JSON_ONLY_STRICT_FAIL_EXIT="true"
cargo run --release -- prompt "/review inspect parser --json-only" `
--provider openai `
--model gpt-5.3-codex `
--project "<path\to\ASI-Code>" `
--output-format jsonWhen strict mode is enabled and schema validation fails, JSON-only output is:
- REPL
/review ... --json-onlysuccess shape:{ "schema_version":"1", "status":"ok", "review":{...} } - REPL
/review ... --json-onlystrict-fail shape:{ "schema_version":"1", "status":"error", "error":"review_schema_invalid", "schema_error":"...", "review":{...} } - Prompt
/review ... --json-only --output-format jsondefault success shape: rawreviewobject (no outerstatus) - Prompt
/review ... --json-only --output-format jsonstrict-fail shape: same error envelope - Prompt success envelope optional: set
ASI_REVIEW_JSON_ONLY_PROMPT_ENVELOPE=trueto emit{ "schema_version":"1", "status":"ok", "review":{...} } smoke_review_json.ps1hard-checksstatus=="ok"and top-levelschema_version=="1"when-PromptEnvelope onis used.- If
ASI_REVIEW_JSON_ONLY_STRICT_FAIL_EXIT=true, prompt mode returns a non-zero exit code after emitting the error envelope (CI-friendly failure signal).
The smoke scripts now support provider-scoped runs for API-compat and gateway checks. You can run OpenAI/DeepSeek flows independently without requiring Claude credentials.
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_api_compat.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "D:\test_code" `
-SkipOpenAi `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>" `
-DeepSeekModel "deepseek-reasoner"powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_api_compat.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "D:\test_code" `
-SkipDeepSeek `
-OpenAiBaseUrl "https://api.openai.com/v1" `
-OpenAiApiKey "<YOUR_OPENAI_KEY>" `
-OpenAiModel "gpt-5.3-codex"DeepSeek example:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_gateway.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "D:\test_code" `
-Provider deepseek `
-ApiKey "<YOUR_DEEPSEEK_KEY>" `
-Model "deepseek-reasoner"OpenAI example:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_gateway.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "D:\test_code" `
-Provider openai `
-BaseUrl "https://api.openai.com/v1" `
-ApiKey "<YOUR_OPENAI_KEY>" `
-Model "gpt-5.3-codex"Fast DeepSeek gateway path (skip tool turn for speed):
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_all.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "D:\test_code" `
-Repo "D:\Code\rustbpe" `
-Quick `
-SkipApiCompat -SkipProviderModel -SkipTokenizer -SkipCheckpoint `
-RunGateway `
-GatewayProvider deepseek `
-GatewaySkipToolTurn `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>" `
-DeepSeekModel "deepseek-reasoner"Optional auto-summary for smoke reports:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_all.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-Repo "D:\Code\rustbpe" `
-SkipApiCompat -SkipProviderModel -SkipTokenizer -SkipCheckpoint -SkipGateway `
-ReportJsonPath ".\artifacts\smoke_all.json" `
-RenderSummaryOptional custom summary output path:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_all.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-Repo "D:\Code\rustbpe" `
-SkipApiCompat -SkipProviderModel -SkipTokenizer -SkipCheckpoint -SkipGateway `
-ReportJsonPath ".\artifacts\smoke_all.json" `
-RenderSummary `
-SummaryOutFile ".\artifacts\reports\custom_summary.md"Strict profile (CI parity) example for smoke_all.ps1:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_all.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-Repo "D:\Code\rustbpe" `
-StrictProfile `
-SkipApiCompat -SkipProviderModel -SkipTokenizer -SkipCheckpoint -SkipGateway `
-ReportJsonPath ".\artifacts\smoke_all_strict_profile.json"-StrictProfile requires these checks to remain enabled and rejects:
-SkipHookMatrix-SkipHooksCliAdvanced-SkipSubagent
smoke_api_compat.ps1andsmoke_api_compat_min.ps1support:-SkipOpenAi-SkipDeepSeek
smoke_review_json.ps1validates/reviewstructured JSON fields (schema_valid,sections.findings_sorted,stats.top_risk_paths,stats.missing_tests_count).smoke_prompt_jsonl.ps1validates prompt--output-format jsonlevent stream fields (schema_version,event,data) and required events (prompt.result,prompt.changed_files,prompt.native_tool_calls,prompt.auto_validation,prompt.review,prompt.runtime).smoke_all.ps1supports env fallbacks when flags are not passed:ASI_SMOKE_SKIP_OPENAI=1ASI_SMOKE_SKIP_DEEPSEEK=1
smoke_gateway.ps1supports generic provider args (-Provider/-BaseUrl/-ApiKey/-Model) and legacy provider-specific args for backward compatibility.
Use run_smoke_recipes.ps1 to avoid manual command assembly:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\run_smoke_recipes.ps1 `
-Provider deepseek `
-Recipe smoke-all-gateway `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "D:\test_code" `
-Repo "D:\Code\rustbpe" `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>" `
-Quick `
-GatewaySkipToolTurnUnified smoke entrypoint (mode router):
# strict (default)
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke.ps1 `
-Mode strict `
-Provider deepseek `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>"
# risk review + gateway
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke.ps1 `
-Mode risk `
-Provider deepseek `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>"
# gateway path
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke.ps1 `
-Mode gateway `
-Provider openai `
-OpenAiApiKey "<YOUR_OPENAI_KEY>" `
-NoQuickFor a shorter strict-regression entrypoint, use smoke_strict_quick.ps1 (compatibility alias to smoke.ps1 -Mode strict).
One-command strict quick wrapper (recommended for daily regression):
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_strict_quick.ps1 `
-Provider deepseek `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>"OpenAI variant:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_strict_quick.ps1 `
-Provider openai `
-OpenAiApiKey "<YOUR_OPENAI_KEY>" `
-NoQuickOne-command risk review + gateway (relaxed schema gate):
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\run_smoke_recipes.ps1 `
-Provider deepseek `
-Recipe smoke-all-gateway-risk `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-Repo "D:\Code\rustbpe" `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>" `
-ReportDir ".\artifacts" `
-RenderSummaryRecommended standard regression template (copy and run):
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\run_smoke_recipes.ps1 `
-Provider deepseek `
-Recipe smoke-all-gateway-risk `
-AsiExe ".\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-Repo "D:\Code\rustbpe" `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>" `
-ReportDir ".\artifacts\risk_recipe_live" `
-RenderSummary `
-SummaryOutFile ".\artifacts\risk_recipe_live\SUMMARY_SMOKE_ALL_GATEWAY_RISK.md"Recommended template for the OpenAI API endpoint (copy and run):
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\run_smoke_recipes.ps1 `
-Provider openai `
-Recipe smoke-all-gateway-risk `
-AsiExe ".\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-Repo "D:\Code\rustbpe" `
-OpenAiApiKey "<YOUR_OPENAI_KEY>" `
-OpenAiBaseUrl "https://api.openai.com/v1" `
-ReportDir ".\artifacts\risk_recipe_live_openai" `
-RenderSummary `
-SummaryOutFile ".\artifacts\risk_recipe_live_openai\SUMMARY_SMOKE_ALL_GATEWAY_RISK.md"Direct review JSON smoke example:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_review_json.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-Provider deepseek `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>" `
-Model "deepseek-reasoner" `
-PromptAutoTools off `
-PromptEnvelope off `
-SchemaRetries 1 `
-FailOnSchemaInvalid on `
-ReviewTask "Provide exactly the required sectioned review format with one low severity finding for src/main.rs:1 and no tool calls"Direct prompt JSONL smoke example:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_prompt_jsonl.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-Provider deepseek `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>" `
-Model "deepseek-reasoner" `
-PromptText "Reply with exactly JSONL_SMOKE_OK"One-command artifacts + summary via recipe runner:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\run_smoke_recipes.ps1 `
-Provider deepseek `
-Recipe review-json `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>" `
-ReviewJsonPromptAutoTools off `
-ReviewJsonPromptEnvelope off `
-ReviewJsonSchemaRetries 1 `
-ReviewJsonFailOnSchemaInvalid on `
-ReviewJsonTask "Provide exactly the required sectioned review format with one low severity finding for src/main.rs:1 and no tool calls" `
-ReportDir ".\artifacts" `
-RenderSummarySupported recipes:
api-compatapi-compat-mingatewayreview-jsonhook-matrixhooks-cli-advancedsubagentsubagent-strictsmoke-all-gatewaysmoke-all-gateway-risksmoke-all-strict
Unified wrapper modes:
smoke.ps1 -Mode strictsmoke.ps1 -Mode risksmoke.ps1 -Mode gateway
Run one command to build/test/smoke and emit a single JSON report:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\ci_machine_json.ps1 `
-Provider deepseek `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>"Optional gate controls:
# Use a custom gate template and keep process success even when gates fail
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\ci_machine_json.ps1 `
-Provider deepseek `
-DeepSeekApiKey "<YOUR_DEEPSEEK_KEY>" `
-GateRulesPath .\scripts\windows\ci_gate_rules.template.json `
-SkipFailGate
# Validate CI report schema + gates
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\validate_ci_machine_report.ps1 `
-ReportPath .\artifacts\ci_machine_json\ci_machine_report.json `
-StrictOutput:
- JSON report:
.\artifacts\ci_machine_json\ci_machine_report.json - Smoke summary:
.\artifacts\ci_machine_json\smoke\SMOKE_SUMMARY.md - Prompt JSONL smoke report:
.\artifacts\ci_machine_json\smoke\smoke_prompt_jsonl.json - Gate rules template:
.\scripts\windows\ci_gate_rules.template.json
Tips:
- Set
-DryRunto print the exact command without executing. - Use
-Provider ask -Recipe askfor interactive menu selection. - Use
-StrictCifor one-command strict CI mode. It forcessmoke-all-strict, enables summary rendering, requires strict review-json validation, and defaultsReportDirto.\artifacts\strict_ciwhen not provided. -StrictCidefaults review-json task to deterministic schema validation prompt (Provide exactly the required sectioned review format...) andReviewJsonPromptAutoTools=offfor stability; override via explicit flags when needed.smoke-all-gatewayandsmoke-all-gateway-risknow includehook-matrix smoke,hooks-cli-advanced smoke, andsubagent smokeby default. Use-SkipHookMatrix,-SkipHooksCliAdvanced, and/or-SkipSubagentto disable them.smoke-all-strictenforces hook-matrix, hooks-cli-advanced, and subagent checks;-SkipHookMatrix,-SkipHooksCliAdvanced, and-SkipSubagentare rejected.- Use
-AllowProviderNetworkErrorto enable all network/provider downgrade toggles at once forsmoke-all-*recipes. - Use
-AllowReviewJsonNetworkErrorforsmoke-all-*recipes when provider/network instability is expected.review-json smokenetwork/provider failures are downgraded towarnso later steps (hook-matrix/subagent/gateway) can still run. - Use
-AllowSubagentNetworkErrorforsmoke-all-*recipes when provider/network instability is expected.subagent smokenetwork/provider failures are downgraded towarnso gateway checks can still run. - Use
-AllowGatewayNetworkErrorforsmoke-all-*recipes when provider/network instability is expected.gateway smokenetwork/provider failures are downgraded towarnso the aggregate run can finish and emit reports. - CI machine report gate behavior:
schema_version="1"andci_schema="asi.ci.machine_report.v1"are fixed.gates.pass=falsewill exit non-zero by default.- pass
-SkipFailGateto always emit report and exit zero (useful for flaky network runs).
- For recipe
subagent, use-SubagentAllowWaitErrorto downgrade wait failure to warning-pass mode. - Recipe
subagent-strictalways enforces wait success and rejects-SubagentAllowWaitError. - When using recipe
smoke-all-gateway, summary generation is handled bysmoke_all.ps1; the runner will not invokerender_smoke_summary.ps1a second time. smoke-all-gateway-riskdefaults to:ReviewJsonTask = "inspect current project and report top bug risks"ReviewJsonPromptAutoTools = onReviewJsonSchemaRetries = 1ReviewJsonFailOnSchemaInvalid = offYou can still override these via CLI flags.
- Use
-ReviewJsonTaskto switch between deterministic schema validation prompts and real project risk-review prompts. - Use
-ReviewJsonPromptAutoTools on|offto control review-json prompt continuation behavior. - Use
-ReviewJsonPromptEnvelope on|offto control prompt/review --json-onlysuccess envelope mode in smoke runs.
Hook matrix smoke (event handler config) example:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_hook_matrix.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-ReportJsonPath "<path\to\ASI-Code>\artifacts\smoke_hook_matrix.json"Recipe runner equivalent:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\run_smoke_recipes.ps1 `
-Recipe hook-matrix `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-ReportDir "<path\to\ASI-Code>\artifacts"Hooks CLI advanced smoke example:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_hooks_cli_advanced.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "<path\to\ASI-Code>" `
-ReportJsonPath "<path\to\ASI-Code>\artifacts\smoke_hooks_cli_advanced.json"powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows\smoke_subagent.ps1 `
-AsiExe "<path\to\ASI-Code>\target\release\asi.exe" `
-Project "D:\test-cli" `
-Provider deepseek `
-Model deepseek-reasoner `
-OutputMode json `
-ReportJsonPath "<path\to\ASI-Code>\artifacts\smoke_subagent.json"-OutputModesupportsjson(default) andjsonl.- For JSONL mode use:
-OutputMode jsonl(parsesagent.<command>events). - Pass criteria are strict:
/agent wait --jsonmust returnagent.status == "done"andagent.ok == true; otherwise smoke fails withfailure_category=subagent_wait_not_successful. - Optional downgrade mode: add
-AllowWaitErrorto keepstatus=passwhen wait fails, and recordmetrics.wait_warning=truewith failure details in metrics. - Use
-ReviewJsonSchemaRetries <n>to retry schema validation by rerunning the prompt when output format is unstable. - Use
-ReviewJsonFailOnSchemaInvalid on|offto choose whether schema-invalid review-json should fail smoke or only warn.
Recommended report artifacts in the report directory:
smoke_all.json: aggregated run result fromsmoke_all.ps1smoke_gateway.json: provider gateway smoke resultsmoke_review_json.json:/reviewJSON schema/stats smoke resultsmoke_prompt_jsonl.json: prompt--output-format jsonlevent stream smoke resultsmoke_hook_matrix.json: hook event-matrix allow/deny regression resultSMOKE_SUMMARY.md: markdown summary generated byrender_smoke_summary.ps1
By default, smoke_all.ps1 -RenderSummary writes SMOKE_SUMMARY.md under the same directory as -ReportJsonPath.
Use -SummaryOutFile <path> to override the summary output file path.
- Unsigned Windows binaries can still trigger SmartScreen warnings. Signed artifacts are supported by
scripts/windows/package_release.ps1 -SignArtifacts .... - New builds auto-validate provider/model compatibility. If you still see DeepSeek
Model Not Exist, verify you are not running an old binary and check/status. - API keys are now masked in startup flows, but previously saved plaintext environment variables remain visible via OS environment inspection.
- Some enterprise/proxy networks can block provider endpoints and cause connection or TLS errors.
- Verify binary works:
.\asi.exe(double-click launcher) or.\asi.cmd versionor.\bin\asi.exe version
- Start REPL and check runtime state:
/status
- Confirm selected provider key is set:
- OpenAI:
OPENAI_API_KEY - DeepSeek:
DEEPSEEK_API_KEY - Claude:
ANTHROPIC_API_KEY
- OpenAI:
- Fully extract the ZIP before running
asi.exe. - If downloaded from browser, open file Properties and click
Unblockif present. - If SmartScreen appears for unsigned beta builds, click
More info->Run anyway. - Prefer signed release artifacts for distribution to reduce SmartScreen friction.
- DeepSeek
Model Not Exist:- Ensure you are on a recent build (provider/model mismatch now auto-falls back).
- Verify provider/model via
/status(or run explicitly with--provider deepseek --model deepseek-chat).
- Claude authentication issues:
- Verify
ANTHROPIC_API_KEYor/oauth login <token>state. - Recheck with
/status.
- Verify
Run these checks before packaging:
cargo check --release
cargo test --release$env:ASI_SIGN_CERT_PASSWORD="<pfx-password>"
powershell -ExecutionPolicy Bypass -File .\scripts\windows\package_release.ps1 -SignArtifacts -CertFile "C:\certs\asi-code.pfx" -TimestampUrl "http://timestamp.digicert.com"If you use certificate store instead of PFX file:
powershell -ExecutionPolicy Bypass -File .\scripts\windows\package_release.ps1 -SignArtifacts -CertThumbprint "<sha1-thumbprint>"- Report bugs in the repository Issues tab (use the bug template).
- Share product ideas and UX feedback in Discussions.
- Contribution process: CONTRIBUTING.md
- Security reporting: SECURITY.md
This project is licensed under the MIT License. See LICENSE.
- Community (MIT): local CLI core, REPL, provider integration, tool calls, and wiki workflows.
- Commercial (planned): managed gateway, team workspace, policy packs, audit dashboard, and priority support.
- Positioning: keep individual developer productivity open; monetize team/enterprise governance and reliability.
See: GITHUB_REPO_COPY_BILINGUAL.md
- Collaboration reality and upgrade blueprint (English): CLI_API_COLLABORATION_EN.md