mech.app
Dev Tools

Terax: What a 7MB Terminal-First AI Workspace Reveals About Agentic Dev Environments

How Terax achieves a complete AI-native development workspace in 7MB with native PTY, WebGL rendering, and an agentic side-panel.

Source: github.com
Terax: What a 7MB Terminal-First AI Workspace Reveals About Agentic Dev Environments

Terax is a 7MB terminal-first development workspace that bundles a native PTY backend, WebGL-accelerated terminal, code editor, file explorer, source control, web preview pane, and an agentic AI side-panel. Built on Tauri 2 and Rust, it demonstrates the minimal plumbing required for a local-first coding agent harness without telemetry, cloud backends, or Electron bloat.

The project sits at 8,128 stars and trending rank 5 in TypeScript. It matters because it exposes the architectural tradeoffs between native process isolation and browser-based terminal emulators, and shows what you can strip away when you prioritize local execution over cloud orchestration.

Architecture: Native PTY vs Browser Emulation

Terax uses portable-pty for its PTY backend, which spawns real shell processes (zsh, bash, pwsh, fish, cmd) and communicates over OS-level pseudoterminals. This differs from browser-based terminal emulators in three ways:

  1. Process isolation: Each terminal tab runs in a separate OS process. If a shell crashes, it does not take down the renderer or other tabs.
  2. Security boundaries: The Rust backend enforces capability-based permissions through Tauri’s IPC layer. The renderer cannot spawn arbitrary processes or read files outside the workspace without explicit grants.
  3. Performance: Native PTY avoids the overhead of WebSocket tunneling or server-side terminal multiplexing. Output streams directly from the shell to xterm.js over Tauri’s async IPC.

The WebGL renderer (xterm.js with GPU acceleration) handles block-based terminal drawing. This means glyph rasterization happens on the GPU, reducing CPU load during high-throughput output like build logs or test runs.

The 7MB Footprint: What’s Missing

Terax achieves its size by excluding:

  • Language servers: No built-in LSP. You bring your own or run them in the terminal.
  • Extension marketplace: No plugin system. Features are compiled in.
  • Cloud sync: No account, no telemetry, no remote state.
  • Electron: Tauri 2 uses the OS webview (WebKit on macOS, WebView2 on Windows, WebKitGTK on Linux), which is already installed.

The tradeoff is reduced flexibility. You cannot install third-party themes beyond the built-in presets, and you cannot extend the editor with custom language support without forking the codebase.

ComponentTerax ApproachTraditional IDE Approach
PTY backendNative portable-pty (Rust)WebSocket to server-side tmux/pty.js
Rendererxterm.js + WebGLCustom canvas or DOM-based
EditorCodeMirror 6 (bundled)Monaco or custom with LSP
AI integrationSide-panel with user keysCloud API or MCP server
Footprint7-8 MB200-500 MB (Electron + extensions)

Agentic AI Side-Panel: Local-First Orchestration

The AI side-panel runs against user-provided API keys or fully local models. It does not require an external orchestration layer or MCP server. The workflow:

  1. User writes a prompt in the side-panel.
  2. The panel sends the prompt and current editor context (file path, selection, git diff) to the configured model endpoint.
  3. The model returns a response with code edits.
  4. Terax applies the edits as diffs in the CodeMirror editor, showing inline additions and deletions.

The side-panel does not maintain long-running agent state. Each interaction is stateless. If you want multi-turn reasoning or tool use, you handle it in the prompt or use a model with built-in function calling.

// Simplified Tauri command for AI edit
#[tauri::command]
async fn apply_ai_edit(
    file_path: String,
    original: String,
    edited: String,
    state: State<'_, AppState>,
) -> Result<(), String> {
    let diff = diff::compute(&original, &edited);
    state.editor.apply_diff(file_path, diff).await
        .map_err(|e| e.to_string())
}

This design avoids the complexity of agent memory, tool routers, or state machines. The cost is limited agentic capability. Terax is not a framework for building multi-step workflows. It is a harness for single-shot code edits driven by LLM completions.

Security Boundaries: Tauri’s Capability Model

Tauri 2 enforces a capability-based permission model. The renderer (React frontend) cannot call arbitrary Rust functions. Each command must be explicitly allowed in tauri.conf.json:

{
  "tauri": {
    "allowlist": {
      "fs": {
        "scope": ["$APPDATA/*", "$HOME/.config/terax/*"]
      },
      "shell": {
        "open": true,
        "scope": [
          { "name": "zsh", "cmd": "zsh" },
          { "name": "bash", "cmd": "bash" }
        ]
      }
    }
  }
}

This means:

  • The AI side-panel cannot read files outside the workspace without user approval.
  • The terminal cannot spawn processes beyond the allowed shell list.
  • The web preview pane cannot make arbitrary HTTP requests. It runs in an isolated webview with a separate session.

The tradeoff is reduced flexibility. If you want to run a custom build script or integrate a new shell, you must modify the allowlist and recompile.

Observability: What You Don’t Get

Terax has no built-in observability. There is no trace logging for AI interactions, no metrics for terminal throughput, and no crash reporting. If the AI side-panel fails to apply an edit, you see an error message in the UI. If a shell process hangs, you kill it manually.

For production use, you would need to add:

  • Structured logging: Emit JSON logs from the Rust backend to a file or syslog.
  • Error boundaries: Wrap React components in error boundaries to catch renderer crashes.
  • Health checks: Periodically ping the PTY backend to detect hung processes.

The lack of observability is intentional. Terax prioritizes privacy and simplicity over operational insight.

Deployment Shape: Single Binary

Terax ships as a single binary per platform (macOS .app, Windows .exe, Linux AppImage). The binary includes:

  • Tauri runtime
  • Rust backend (PTY manager, file watcher, git integration)
  • React frontend (bundled as static assets)
  • xterm.js and CodeMirror 6 (vendored)

You do not need Node.js, Python, or any other runtime. The binary is self-contained. Updates are distributed as new binaries, not incremental patches.

The tradeoff is larger update payloads. A 7MB binary means a 7MB download for every update, even if only a single Rust function changed.

Failure Modes

  1. PTY backend crash: If portable-pty crashes, all terminal tabs freeze. The renderer does not detect the failure automatically. You must restart the app.
  2. AI timeout: If the model endpoint is slow or unreachable, the side-panel blocks until the request times out. There is no cancellation UI.
  3. Git conflict: If the file watcher detects a git conflict while the AI is applying edits, the diff application fails silently. You see no error message.
  4. WebGL fallback: If WebGL is unavailable (e.g., in a VM without GPU passthrough), xterm.js falls back to canvas rendering. This is slower but functional.

When to Use Terax

Use Terax when:

  • You want a lightweight, local-first coding environment with no cloud dependencies.
  • You already have API keys or local models and do not need a managed AI service.
  • You prioritize terminal workflows over IDE features like refactoring or debugging.
  • You are comfortable with limited extensibility and no plugin ecosystem.

Avoid Terax when:

  • You need multi-step agentic workflows with memory, tool use, or state machines.
  • You require language server protocol support for autocomplete, go-to-definition, or inline diagnostics.
  • You want observability, crash reporting, or telemetry for production use.
  • You need a plugin system to extend the editor or terminal with custom features.

Technical Verdict

Terax proves that a complete AI-native development workspace can fit in 7MB by using native PTY, OS webviews, and stateless AI integration. The architecture is simple: Rust backend for process management, React frontend for UI, and direct IPC for communication. No orchestration layer, no cloud backend, no telemetry.

The tradeoff is reduced flexibility. You cannot extend the editor, you cannot build multi-step agents, and you cannot observe failures in production. But if you want a fast, private, terminal-first coding environment with basic AI assistance, Terax exposes the minimal viable plumbing.