clanker-agent/packages/coding-agent/docs/development.md
Harivansh Rathi 67168d8289 chore: rebrand companion-os to clanker-agent
- Rename all package names from companion-* to clanker-*
- Update npm scopes from @mariozechner to @harivansh-afk
- Rename config directories .companion -> .clanker
- Rename environment variables COMPANION_* -> CLANKER_*
- Update all documentation, README files, and install scripts
- Rename package directories (companion-channels, companion-grind, companion-teams)
- Update GitHub URLs to harivansh-afk/clanker-agent
- Preserve full git history from companion-cloud monorepo
2026-03-26 16:22:52 -04:00

1.3 KiB

Development

See AGENTS.md for additional guidelines.

Setup

git clone https://github.com/badlogic/clanker-agent
cd clanker-agent
npm install
npm run build

Run from source:

./clanker-test.sh

Forking / Rebranding

Configure via package.json:

{
  "clankerConfig": {
    "name": "clanker",
    "configDir": ".clanker"
  }
}

Change name, configDir, and bin field for your fork. Affects CLI banner, config paths, and environment variable names.

Path Resolution

Three execution modes: npm install, standalone binary, tsx from source.

Always use src/config.ts for package assets:

import { getPackageDir, getThemeDir } from "./config.js";

Never use __dirname directly for package assets.

Debug Command

/debug (hidden) writes to ~/.clanker/agent/clanker-debug.log:

  • Rendered TUI lines with ANSI codes
  • Last messages sent to the LLM

Testing

./test.sh                         # Run non-LLM tests (no API keys needed)
npm test                          # Run all tests
npm test -- test/specific.test.ts # Run specific test

Project Structure

packages/
  ai/           # LLM provider abstraction
  agent/        # Agent loop and message types
  tui/          # Terminal UI components
  coding-agent/ # CLI and interactive mode