Skip to content

vitillo/talos

Repository files navigation

Talos

Talos is a terminal AI coding agent built with Bun + Ink. It runs a chat loop in your terminal, streams model output live, and executes tool calls for codebase work (read/edit/write files, search, run shell commands, fetch web content, and delegate tasks to sub-agents).

What It Does Today

  • Runs an interactive terminal UI (src/console/app.tsx) with live transcript rendering of model thinking/text/tool events.
  • Supports prompt history and keyboard-driven input.
  • Shows a session status bar with model, context usage, and estimated cost.
  • Uses an Agent event loop (src/agent.ts) that stores conversation history in memory.
  • Streams model responses and executes tool calls until each turn completes.
  • Uses AnthropicSDK by default (src/console/index.ts) with model claude-haiku-4-5-20251001.
  • Includes an OpenAISDK implementation in src/sdk/openai.ts (used in tests/integration and available for future wiring).

Built-In Tools

Configured in src/console/index.ts:

  • ask_user_question: interactive multiple-choice questions in-terminal.
  • bash: run shell commands.
  • glob: file discovery with ripgrep globbing.
  • grep: regex search with ripgrep.
  • read: read files with line offsets/limits.
  • write: write full file contents.
  • edit: targeted string replacement in files.
  • webfetch: fetch URL content and convert HTML to Markdown.
  • websearch: search the web via Exa MCP and return LLM-friendly context.
  • task: run specialized sub-agents (bash, explore, general-purpose).
  • todo_write: maintain in-memory task lists for progress tracking.

Interactive Tools

Tools can render interactive UI directly in the terminal. A tool marked as interactive can mount a React (Ink) component via context.ui.mountReact(component). The component receives an onComplete callback — when invoked, its argument becomes the tool result. Interactive tools run sequentially to avoid UI conflicts.

See ToolWidgetComponent and ExecutionContext in src/tools.ts for the interface, and ask_user_question for a working example.

Requirements

  • Bun (project uses bun/bunx tooling).
  • ANTHROPIC_API_KEY for the default runtime path.
  • OPENAI_API_KEY if running OpenAI integration paths/tests.
  • rg (ripgrep) installed for glob/grep tools.

Quick Start

bun install
bun run dev

bun run dev launches bun --hot src/index.ts, which boots the terminal app.

Development Commands

# Run all tests
bun test

# Run integration tests
bun test:integration

# Lint
bunx eslint .

# Type-check
bunx tsc -p tsconfig.json --noEmit

Logs

  • Default log directory: ~/.local/share/talos/logs
  • Override with: TALOS_LOG_DIR
  • Minimum log level: LOG_LEVEL (debug, info, warn, error)

Logs are JSONL and logging failures are intentionally non-fatal.

About

A minimal terminal AI coding agent

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors