41. Contributing to tcm-ts
tcm is developed in tcm: all of it is in its own codebase, on tcm's server, and the git repository only says how to get it. So a change isn't a pull request. It's a contribution: a branch of the codebase, proposed on tcm's server and reviewed there as definitions, as on Unison Share. Anyone can read tcm's codebase; proposing a change takes a contributor's token.
Only want to use tcm? Install it and follow your first codebase.
41.1 Setting up
You need Node 22.18 or newer, pnpm and git, and Chrome for the tests that render in a browser (they're skipped without it).
git clone https://github.com/hipstersmoothie/tcm-ts && cd tcm-ts
pnpm tcm status
The first pnpm tcm gets the tcm tcm's server runs (into dist/known-good) and tcm's codebase, history and all
(into codebase/, which git ignores). Reading needs no token: tcm's server is public. pnpm test runs the tests a
change reaches, and pnpm verify checks everything (the first time takes some minutes; after that, only what a
change reaches runs again). Developing tcm-ts says how the codebase is laid out and how it's
tested.
To propose changes, ask the maintainer for a contributor's token: they make one with tcm user add <your handle>.
Then:
pnpm tcm remote add origin https://tcm.codes --token <your token>
pnpm tcm user # you're @<handle> on origin
41.2 Making a change
- With an agent: open the repository in Claude Code, or another MCP client. Its
.mcp.jsonruns tcm's MCP server on the codebase, andAGENTS.mdhas the rules. Each agent works in a session, a branch of its own, whichtcm_statusnames. - By hand: make a branch (
pnpm tcm branch my-change && pnpm tcm switch my-change), then change code withpnpm tcm patch, orpnpm tcm editandpnpm tcm update(scratch files).
What a change needs, as AGENTS.md says:
- One thing. Each change is one entry in the history, and says what it does and why.
- Tests. New behaviour gets a test definition (
export const testX = () => …): beside the code, or intcmts.cli.test.e2ewhen it runs tcm as a program (testing). - Docs. A change to what users see (a command, a flag, an API, an error they act on, a limit) updates its page in
tcmts.docswith it: new commands and flags intcmts.docs.cliandtcmts.cli.commandstoo, limits intcmts.docs.limitations. - Pinned hashes stay as they are, unless the change is to the hash format, on purpose.
pnpm verifypasses on its branch:TCM_BRANCH=<branch> pnpm verify.
41.3 Proposing it
From your branch:
pnpm tcm contribute --title "What it does" --description "Why"
or, for an agent's session, TCM_BRANCH=<its branch> pnpm tcm contribute --as my-change --title "…". It pushes the
branch as @<handle>/my-change and opens a contribution of it into main, printing its review page. Agents don't push or
contribute on their own: you do, or tell one to.
- Pushing again updates it:
pnpm tcm contribute, orpnpm tcm push, from the same branch. - Review is in the terminal (
pnpm tcm contribution view <id>,pnpm tcm contribution comment <id> "…") or on the review page. - If it conflicts with
main, bringmaininto your branch (pnpm tcm pull origin main), settle the conflicts (pnpm tcm todo), and push again (merging). - The maintainer merges it. Then
pnpm tcm switch main && pnpm tcm pullbrings it back.