CLI
Every codetik command, its flags, the JSON it prints and its exit codes.
@codetik/cli needs Node.js 22.12 or later and runs on macOS, Linux and Windows. Run a command inside a tik folder, or pass the folder as [dir]: a command run from src/ finds the tik.yaml in the nearest parent. codetik on its own opens a menu: dev or publish inside a tik, a new tik anywhere else.
$ npm i -g @codetik/cli| Command | What it does |
|---|---|
codetik new | Scaffold a folder and register the tik |
codetik init | Set up an existing project as a tik, where it is |
codetik add | Add a shared library to the tik |
codetik pull | Download one of your tiks, or bring the server's copy into yours |
codetik dev | The tik in a phone frame with the real window.tik |
codetik check | Types, formatting, assets and grants, before anything uploads |
codetik build | A local build with Codetik's own setup |
codetik publish | A draft by default; --live releases |
codetik backend | Turn the backend on and publish its module |
codetik set | Title, description, tags, category and visibility in tik.yaml |
codetik permissions | Check or set what the tik may reach |
codetik issues | Bugs and performance problems users hit |
codetik remove | Delete an unreleased tik from Codetik, keep the folder |
codetik status | The tik in this folder and the active server, offline |
codetik manifest | Categories, tags, libraries and limits the server accepts |
codetik login | Sign in with an API key; logout, whoami |
codetik config | The servers the CLI knows |
codetik skill | Install the agent skill |
codetik about, ideas | What a tik is, and starting ideas |
Global flags
Every command takes these, so the CLI runs the same in CI as on your machine.
| Flag | What it does |
|---|---|
--json | One JSON document on stdout, and no prompts. Notes and errors go to stderr. |
--no-input | Never prompt: a question that would be asked becomes an error naming its flag. |
--server <name> | Talk to this server for one command. |
--version | Print the CLI version. |
CI=true or a stdin that is not a terminal implies --no-input.
| Environment | What it does |
|---|---|
CODETIK_TOKEN | The API key; wins over a saved one. What CI uses. |
CODETIK_API_URL | The server URL; wins over the saved config. |
CODETIK_NO_UPDATE_CHECK | Set to 1 to silence the update notice. |
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Something to fix locally: a bad flag, a check error, a missing answer under --no-input |
2 | Not signed in: run codetik login or set CODETIK_TOKEN |
3 | Refused by the server, a problem on its side, or no answer at all; the message says which |
4 | A bug in the CLI itself |
A failed command prints its reason to stderr and no JSON. A server error or an unreachable server means trying the same command again later, not changing the tik.
codetik new
$ codetik new [folder] [--title <title>] [--category <slug>] [--offline]Creates the folder, registers the tik on your account and writes its id into tik.yaml. The folder must not exist or must be empty.
| Flag | What it does |
|---|---|
--title <title> | The title people see. Default: from the folder name, tap-tempo is "Tap tempo". |
--category <slug> | A category now; usually chosen at the first release. |
--offline | Mint the id locally, no account or network; claimed at the first publish. |
It writes index.html, src/main.ts, src/tik.d.ts, package.json, tsconfig.json, .gitignore, .prettierrc.json, tik.yaml, AGENTS.md, CLAUDE.md and README.md. There is no logo yet.
codetik init
$ codetik init [dir] [--title <title>] [--offline] [-y]Sets up the project in the folder as a tik, in place. See Bring your game.
| Flag | What it does |
|---|---|
--title <title> | The title people see. Default: from package.json's name or the folder. |
--offline | Mint the id locally; claimed at the first publish. |
-y, --yes | Move the shared libraries and add the brief to an existing AGENTS.md and CLAUDE.md without asking. |
It reads the layout, registers the tik, writes tik.yaml and src/tik.d.ts, moves the libraries Codetik serves to peerDependencies and writes or adds the agent brief, each change to your own files after a yes. It ends with what codetik check reports, plus a warning for each library that jumps a major version. It refuses a folder that is a tik or inside one, and a folder with no package.json or index.html.
$ codetik init --yes --json{ "id": "…", "title": "Space blaster", "layout": { "entry": "index.html", "builder": "vite", "configs": ["vite.config.ts"], "unsupported": ["lodash"] }, "moved": [{ "name": "phaser", "from": "^3.80.1", "to": "3.90.0", "major": false }], "brief": "appended", "errors": ["…"], "warnings": ["…"] }codetik add
$ codetik add <library...> [--dir <path>] [-y]Adds shared libraries to package.json peerDependencies, at the version Codetik serves. codetik manifest lists the names.
| Flag | What it does |
|---|---|
--dir <path> | The tik folder, when the terminal is not in it. |
-y, --yes | Move a library out of dependencies without asking. |
The CLI keeps its own copy of each library and links it into the tik's node_modules, so your editor, codetik check and codetik dev all find it without an npm install. A library already in peerDependencies keeps its version. One in dependencies moves after a yes. A name Codetik does not serve is refused.
$ codetik add pixi.js --json{ "added": [{ "name": "pixi.js", "version": "8.19.0" }], "moved": [], "kept": [], "left": [] }codetik pull
$ codetik pull <id or link> [folder]$ codetik pull --update [--apply edits|all|none]Downloads one of your tiks into a new, empty folder: the source, tik.yaml and the logo. With --update, run inside a tik folder, it takes the server's copy instead: --apply edits writes changed and new files, --apply all also deletes files the server does not have, and --apply none only lists them.
codetik dev
$ codetik dev [dir] [--port <n>] [--open] [--detach] [--stop]Runs the tik in the preview shell: a phone frame, the app's bars around it, and the real window.tik with your account as the viewer. The Overview tab shows what tik.yaml declares, the logo and the libraries. The page reloads on save, and a backend republishes on every save under backend/src.
| Flag | What it does |
|---|---|
--port <n> | The shell's port; the tik takes the next one. Default: the first free pair from 5173. |
--open | Open a browser. |
--detach | Start in a process of its own and print the URL; reuses one already running for this tik. |
--stop | Stop the background server for this tik. |
--force-kill | End whatever holds the port pair, then start. |
--no-iframe | Run the tik bare, without the frame, with a stub tik that is always visible. |
--browser | Also start the coding agent's headless browser. |
While it runs in a terminal:
A tik with no id gets one when dev starts.
codetik check
$ codetik check [dir] [--fix]Everything that must be true before a tik ships, without uploading. --fix formats the code, refreshes src/tik.d.ts and checks again.
- Errors (exit 1): TypeScript errors in the tik and its backend, unformatted code, an asset the code references that does not exist, a logo that is not square or too big, missing backend bindings, malformed grants.
- Warnings: no logo, no description, images over 400 KB (512 KB for a sprite sheet), audio over 1 MB, files the allowlist drops, an outdated
src/tik.d.ts, grants only Codetik gives (a publish refuses them). - Porting: no
index.htmlat the root, a library Codetik does not serve (imported or inpeerDependencies), code imported from a URL, media imported fromsrc/, a script the build does not bundle, a file over 512 KB and WebAssembly are errors. A build config that never runs, a shared library used but not declared, network use, and a loop or sound that never pauses off screen are warnings.
$ codetik check --json{ "ok": true, "live_ready": false, "warnings": ["No tik.webp. A 512x512 logo is required before going live."] }codetik build
$ codetik build [dir]Builds the tik locally with the same setup Codetik uses and prints where dist/ went. A check only: publishing builds on the server.
codetik publish
$ codetik publish [dir] [--live] [--category <slug>] [--apply edits|all|none]Uploads the source; Codetik builds it and stores it. It runs check --fix first, and any error stops it.
| Flag | What it does |
|---|---|
| (none) | A draft: replaces your files, reaches nobody, needs no logo. |
--live | Release at the visibility in tik.yaml: public unless it says private or unlisted. |
--draft | Push a draft without being asked. |
--visibility <level> | draft, private, unlisted or public for this publish. |
--category <slug> | Saved to tik.yaml. A release needs one; the CLI asks the first time. |
--apply <what> | What to do with the release check's edits: edits, all or none. |
- A release runs Codetik's check: it removes unused files and fixes build and type errors. Its edits come back to you.
--apply editswrites the rewrites into your folder,--apply allalso deletes the pruned files, and--apply none(the default without a terminal) leaves the folder as it is and warns that it differs from what shipped. - After the first release there is no draft any more:
codetik publishupdates the tik at the visibility it has, and--draftis refused. - A public tik cannot be republished from the CLI. Private and unlisted tiks can.
- A tik with a backend needs the Pro plan for every publish, drafts included.
$ codetik publish --live --category arcade --apply edits --json{ "id": "…", "url": "https://codetik.dev/t/…", "version": 1, "visibility": "public", "changes": [{ "path": "src/main.ts", "action": "update" }] }url is null for a draft.
codetik backend
$ codetik backend [dir] [--status] [--off] [--reset-db] [-y]Turns the backend on if it is off, then publishes the module alone, without a new tik version. See Backend.
| Flag | What it does |
|---|---|
| (none) | Add what is missing (the switch in tik.yaml, a starter module, the spacetimedb library), publish, write the bindings. |
--status | Report what the backend has and lacks, offline. |
--off | Remove it: the switch, backend/, the bindings and the library. The data stays on Codetik. |
--reset-db | Delete every row in the tik's database. |
-y | Do not ask for confirmation. |
Needs an id in tik.yaml and the Pro plan. A public tik's backend cannot be changed from the CLI.
codetik set
$ codetik set [dir] [--title <t>] [--description <text>] [--tags a,b] [--category <slug>] [--visibility <level>]Writes those fields into tik.yaml and keeps the file's comments. --tags replaces the list. With no flags it prints the current values.
codetik permissions
$ codetik permissions [dir] [--profile on|off] [--auth on|off] [--mic on|off] [--links <ids>|off]With no flags, checks the grants in tik.yaml against the publish rules and reports the shape the tik has. With flags, sets them, refusing anything a publish would refuse. See Permissions.
codetik issues
$ codetik issues [dir]The open bugs and performance problems users hit in the released tik, up to 50 of each, with the file and function a bug came from, how many devices saw it, and the version it started in. A release marks them fixed; one seen again comes back as regressed.
codetik remove
$ codetik remove [dir] [-y]Deletes a tik that was never released from Codetik: its record, storage and database. The folder stays and the id leaves tik.yaml. A released tik is refused; get in touch with Codetik to take one down.
codetik status
$ codetik status [dir]The tik in this folder (title, id, grants, backend, logo, slides, libraries, a running dev server) and the active server. Offline and instant.
codetik manifest
$ codetik manifestWhat the server accepts: the category tree, the tags, the shared libraries with their versions, and the size limits. Use it for a category slug or to check a library name.
codetik login
$ codetik login [--token <key>]$ codetik logout$ codetik whoamilogin saves an API key for the active server; create one in the Codetik app under Settings, API keys. whoami shows the account, plan and key name. logout forgets the key. Every command that uses the key starts by naming the account, so you always know where a publish goes.
codetik config
$ codetik config [--show]$ codetik config add <name> <url>$ codetik config use <name>$ codetik config remove <name>The servers the CLI knows and which one is active. Production is the built-in codetik (https://api.codetik.dev). A key belongs to a server, so sign in again after switching. Settings live in ~/.config/codetik/config.json.
codetik skill
$ codetik skill [--agent claude,codex,cursor|all] [--project] [--path] [--remove]Installs the codetik skill for your coding agents. See Using an agent.
codetik about
$ codetik about$ codetik ideasabout explains what a tik is and what one can do. ideas lists the starting ideas the app offers in chat, each with its full brief; it needs no key.