Install — tcm-ts

Install

You need Node 22.18 or newer. Everything else comes with tcm, or is installed when your code first needs it.

Get tcm

curl -fsSLO https://tcm.codes/tcm-ts.tgz && npm install -g ./tcm-ts.tgz
tcm help

This installs the tcm command. tcm help lists the commands; tcm <command> --help shows one's options.

Shell completion

Tab completes commands, options, and names from your codebase.

echo 'source <(tcm complete zsh)' >> ~/.zshrc     # or: bash >> ~/.bashrc
tcm complete fish > ~/.config/fish/completions/tcm.fish
tcm complete powershell >> $PROFILE

Make a codebase

A codebase lives in a directory, like a git repository:

mkdir myproject && cd myproject
tcm init

tcm init creates:

  • .tcm/: the codebase (code, names, history) and what's generated from it
  • package.json, with the #codebase import your files use to reach saved definitions
  • tsconfig.json, so your editor's TypeScript agrees with tcm's
  • .mcp.json and AGENTS.md, so coding agents know how to work here
  • scratch.ts, a file to start writing in

Only .tcm/codebase.sqlite can't be rebuilt; see files and folders.

To start from a small project, saved and ready to run, name a template: tcm init react, then tcm dev app.App. The templates are app (a web app in plain TypeScript and the DOM), react (React with server components), package (an npm package) and pwa (an installable, offline app). tcm init says what to run next.

Ways to work

Use any of these, or all of them: they work on the same codebase.

  • With an AI agent. tcm init registers tcm's MCP server, so Claude Code, Cursor, Codex and other MCP clients find, change and test code through tcm. See AI agents.
  • In the studio. tcm studio opens the codebase in your browser: edit code with live values, see what needs fixing, run tests, read traces, and merge your agents' branches. See the studio.
  • In VS Code. The tcm-ts extension shows each definition's status as you type, with Add and Update buttons, watch values inline, and your apps in a sidebar. Any other editor works too: scratch files are ordinary TypeScript, and tcm lsp serves editors that speak LSP. See editors.

Next

Follow your first codebase, or read tcm's own code, which is a codebase too: browse it, or get it with tcm init && tcm remote add origin https://tcm.codes && tcm pull.

Built from c482a14e