A durable coding assistant — available as a terminal TUI and a browser web app. Plan and review modes, approval-gated tools, MCP integration, persistent sessions with full audit trail. Built on AbstractAgent + AbstractRuntime + AbstractCore.
pip install abstractcode
# Start the terminal TUI
abstractcode --provider ollama --model qwen3:1.7b-q4_K_M
# Or with an OpenAI-compatible server
abstractcode --provider openai --base-url http://127.0.0.1:1234/v1 --model qwen3-4b
# One-shot mode (scripting)
abstractcode --prompt "Summarize @README.md"
AbstractCode is a host UI for running durable agentic coding sessions. It connects the interactive agent experience to the full AbstractFramework stack: agents reason, tools execute with approval gates, and everything is persisted in a durable ledger.
Full-screen terminal interface built with prompt_toolkit. Scrollable output, ANSI colors, mouse support, animated spinners, command history, and autocomplete. Status bar with live provider, model, and token usage.
The browser host in web/ connects to AbstractGateway under /api/gateway/*. Renders runs by replaying the durable ledger. Supports voice (push-to-talk + TTS), image understanding, and cross-device continuity.
Every session, tool call, and reasoning step is persisted. Resume paused runs, save named snapshots, browse full conversation history. Sessions survive crashes and restarts.
# How AbstractCode fits together
#
# User ──▸ FullScreenUI (prompt_toolkit)
# └─▸ ReactShell (command router + UX)
# ├─▸ AbstractRuntime (durable execution)
# │ └─▸ AbstractCore (LLM providers + tools)
# ├─▸ PassthroughToolExecutor (approval boundary)
# └─▸ MappingToolExecutor (local tools or MCP)
#
# Web ──/api/gateway/*──▸ AbstractGateway ──▸ Runtime
From interactive tool approval to full conversation audit trails, AbstractCode provides a complete agentic coding experience.
Built-in ReAct, CodeAct, and MemAct agents from AbstractAgent. Configurable iteration limits, context tokens, and per-provider model selection. Switch agents at runtime.
Tool calls pause at a durable boundary and require approval by default. Interactive y/n/all/edit/quit flow with argument preview. Session-persistent auto-approve mode available.
Plan mode: the agent outputs a TODO plan before acting. Review mode: the agent self-checks its work before concluding. Both can be enabled via CLI flags or TUI commands.
Connect to remote MCP servers for tool execution. Automatic tool synchronization. MCP tools integrate into the native tool allowlist and approval flow. Supports stdio-based servers.
File-backed state with JSON storage. Run, ledger, and snapshot persistence in ~/.abstractcode/. Resume sessions, save/load named snapshots. Optional in-memory mode.
list_files, search_files, read_file, write_file, edit_file, execute_command, web_search, fetch_url. All tools have approval gating and observation previews.
Every LLM call, tool execution, and reasoning step is recorded in the durable ledger. Inspect system prompts, user messages, responses, and raw JSON. /logs runtime and /logs provider commands.
Run VisualFlow workflows locally (abstractcode flow ...) or as specialized agents (--agent <flow_ref>). Implements the abstractcode.agent.v1 contract for host-workflow integration.
Conversation compaction with light, standard, and heavy modes. Focus-based summarization. @path file attachments. Workspace mounts and allowlists. Configurable max tokens and messages.
Install, configure a provider, and start an interactive session. Supports Ollama, OpenAI, Anthropic, LM Studio, and any OpenAI-compatible endpoint.
# Base install
pip install abstractcode
# With VisualFlow support (run workflows locally)
pip install "abstractcode[flow]"
# From source (development)
pip install -e ".[dev]"
# Ollama (default provider, no API keys)
abstractcode --provider ollama --model qwen3:1.7b-q4_K_M
# OpenAI-compatible (e.g. LM Studio)
abstractcode --provider openai --base-url http://127.0.0.1:1234/v1 --model qwen3-4b
# CodeAct agent with auto-approve
abstractcode --agent codeact --auto-approve
# Plan + review modes
abstractcode --plan --review --provider ollama --model qwen3:4b
# One-shot mode (for scripting)
abstractcode --prompt "Explain @src/main.py" --provider ollama --model qwen3:4b
/help # Full command list
/task <description> # Start a new task
/status # Current run status
/resume # Resume last run
/clear # Clear and start fresh
/history [N] # Recent conversation
/tools # List available tools
/auto-accept # Toggle auto-approve
/mcp add <server> # Connect MCP server
/executor use <id> # Set default executor
/plan [on|off] # Toggle plan mode
/review ... # Configure review
/logs runtime # Durable step trace
/logs provider # Provider wire logs
/memory # Token usage breakdown
/compact [mode] # Compress conversation
/snapshot save <name> # Save named snapshot
/snapshot load <name> # Load a snapshot
# Run a workflow as an agent
abstractcode --agent /path/to/flow.json
# Local VisualFlow runs
abstractcode flow run <id>
abstractcode flow runs
abstractcode flow attach <run_id>
# Gateway control-plane
abstractcode gateway run <flow_id>
# The web host connects to AbstractGateway
# Start the gateway first:
export ABSTRACTGATEWAY_AUTH_TOKEN="dev-token"
abstractgateway serve --port 8081
# Launch the web app
npx @abstractframework/code
# Open http://127.0.0.1:3002
# Set Gateway URL and Auth Token in settings
# Features: voice input/output, image understanding, cross-device continuity
# Default paths:
# State file: ~/.abstractcode/state.json
# Durable stores: ~/.abstractcode/state.d/
# Settings: ~/.abstractcode/state.config.json
# Custom state file
abstractcode --state-file /path/to/state.json
# Disable persistence (ephemeral session)
abstractcode --no-state
# Snapshots
/snapshot save before-refactor
/snapshot load before-refactor
/snapshot list
AbstractCode is primarily a CLI/TUI application. These are the key integration surfaces for external use.
# Primary interface
abstractcode --help
# Subcommands
abstractcode flow --help
abstractcode gateway --help
abstractcode workflow --help
from abstractcode import main
# Programmatic invocation
raise SystemExit(main(["--help"]))
# Module entry
# python -m abstractcode --help
Run VisualFlow workflows as first-class agents using the abstractcode.agent.v1 interface contract.
# Run a workflow as an agent in the TUI
abstractcode --agent /path/to/workflow.json --provider ollama --model qwen3:4b
# Contract requirements:
# - Flow declares: interfaces: ["abstractcode.agent.v1"]
# - On Flow Start outputs: provider, model, prompt, tools
# - On Flow End inputs: response, success, meta
#
# Variables injected at run start:
# - vars.prompt (user task text)
# - vars.provider/model (from --provider/--model)
# - vars.tools (session allowlist)
# - vars.context.messages (conversation history)
# - vars._limits (max_iterations, max_tokens, ...)
# Agent & Provider
ABSTRACTCODE_AGENT # Default agent (react|memact|codeact)
ABSTRACTCODE_BASE_URL # Provider base URL
ABSTRACTCODE_MAX_ITERATIONS # Default iteration limit
ABSTRACTCODE_MAX_TOKENS # Default context token limit
# State & Persistence
ABSTRACTCODE_STATE_FILE # Default state file path
# Workspace & Attachments
ABSTRACTCODE_WORKSPACE_MOUNTS # Newline-separated name=/path
ABSTRACTCODE_MAX_ATTACHMENT_BYTES # Max file size (default 25MB)
# Gateway
ABSTRACTCODE_GATEWAY_URL # Gateway endpoint
ABSTRACTCODE_GATEWAY_TOKEN # Bearer token
ABSTRACTCODE_GPU_MONITOR # GPU meter (0|1|auto)
# Themes
ABSTRACTCODE_THEME # Theme preset name
ABSTRACTCODE_THEME_PRIMARY # Custom primary color
Enter — Submit
Up/Down — History
Ctrl+C/D — Exit
PageUp/Down — Scroll output
Home/End — Jump top/bottom
Mouse wheel — Scroll
Ctrl+L — Clear output
Ctrl+Up/Down — Smooth scroll
Mouse click — Position cursor