KnightCode Docs

Welcome

KnightCode is a local-first, interactive AI coding assistant built for your terminal.


KnightCode is an open-source terminal TUI (Terminal User Interface) built on OpenTUI and React 19. It runs entirely in your terminal, providing a rich, keyboard-driven environment where you can work with AI agents side-by-side with your repository context.

No account or telemetry is required. KnightCode is BYOK (Bring Your Own Key), routing all your queries securely through OpenRouter to access standard, frontier, or free models.

What's Inside

  • Keyboard-First TUI: Run sessions directly from a repository in your terminal. Work in an interactive interface without switching to a web browser.
  • Interactive Chat: A scrollable message area displaying agent reasoning, streaming responses, and formatted output.
  • Task & Todo System: Ephemeral in-session checklists plus a durable, multi-session task ledger (.knightcode/tasks.json in your project) track progress and keep long-running agent workflows organized.
  • Verification & Approvals: Inspect proposed file diffs and command runs. Confirm or deny actions before the agent executes them.
  • Project Memory: Automatic recall and extraction of project preferences to a local per-project memory store, plus project-specific KNIGHTCODE.md guidelines.
  • Custom Themes: Switch the TUI between six bundled themes — Dark, Light, Dark/Light Daltonized (color-blind friendly), and Dark/Light ANSI.

Where to Start

  1. Install KnightCode and run the onboarding setup to configure your provider keys.
  2. Take a tour of TUI Workspace layout.
  3. Review available Slash Commands to control the application.