Docs›Reference

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.

Shell
$ npm i -g @codetik/cli
CommandWhat it does
codetik newScaffold a folder and register the tik
codetik initSet up an existing project as a tik, where it is
codetik addAdd a shared library to the tik
codetik pullDownload one of your tiks, or bring the server's copy into yours
codetik devThe tik in a phone frame with the real window.tik
codetik checkTypes, formatting, assets and grants, before anything uploads
codetik buildA local build with Codetik's own setup
codetik publishA draft by default; --live releases
codetik backendTurn the backend on and publish its module
codetik setTitle, description, tags, category and visibility in tik.yaml
codetik permissionsCheck or set what the tik may reach
codetik issuesBugs and performance problems users hit
codetik removeDelete an unreleased tik from Codetik, keep the folder
codetik statusThe tik in this folder and the active server, offline
codetik manifestCategories, tags, libraries and limits the server accepts
codetik loginSign in with an API key; logout, whoami
codetik configThe servers the CLI knows
codetik skillInstall the agent skill
codetik about, ideasWhat a tik is, and starting ideas

Global flags

Every command takes these, so the CLI runs the same in CI as on your machine.

FlagWhat it does
--jsonOne JSON document on stdout, and no prompts. Notes and errors go to stderr.
--no-inputNever prompt: a question that would be asked becomes an error naming its flag.
--server <name>Talk to this server for one command.
--versionPrint the CLI version.

CI=true or a stdin that is not a terminal implies --no-input.

EnvironmentWhat it does
CODETIK_TOKENThe API key; wins over a saved one. What CI uses.
CODETIK_API_URLThe server URL; wins over the saved config.
CODETIK_NO_UPDATE_CHECKSet to 1 to silence the update notice.

Exit codes

CodeMeaning
0Success
1Something to fix locally: a bad flag, a check error, a missing answer under --no-input
2Not signed in: run codetik login or set CODETIK_TOKEN
3Refused by the server, a problem on its side, or no answer at all; the message says which
4A 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

Shell
$ 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.

FlagWhat 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.
--offlineMint 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

Shell
$ codetik init [dir] [--title <title>] [--offline] [-y]

Sets up the project in the folder as a tik, in place. See Bring your game.

FlagWhat it does
--title <title>The title people see. Default: from package.json's name or the folder.
--offlineMint the id locally; claimed at the first publish.
-y, --yesMove 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.

Shell
$ 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

Shell
$ codetik add <library...> [--dir <path>] [-y]

Adds shared libraries to package.json peerDependencies, at the version Codetik serves. codetik manifest lists the names.

FlagWhat it does
--dir <path>The tik folder, when the terminal is not in it.
-y, --yesMove 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.

Shell
$ codetik add pixi.js --json{ "added": [{ "name": "pixi.js", "version": "8.19.0" }], "moved": [], "kept": [], "left": [] }

codetik pull

Shell
$ 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

Shell
$ 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.

FlagWhat it does
--port <n>The shell's port; the tik takes the next one. Default: the first free pair from 5173.
--openOpen a browser.
--detachStart in a process of its own and print the URL; reuses one already running for this tik.
--stopStop the background server for this tik.
--force-killEnd whatever holds the port pair, then start.
--no-iframeRun the tik bare, without the frame, with a stub tik that is always visible.
--browserAlso start the coding agent's headless browser.

While it runs in a terminal:

pToggle permissions
bBackend on or off
sSet up slides
rReload
hHelp
qQuit

A tik with no id gets one when dev starts.

codetik check

Shell
$ 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.html at the root, a library Codetik does not serve (imported or in peerDependencies), code imported from a URL, media imported from src/, 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.
Shell
$ codetik check --json{ "ok": true, "live_ready": false,  "warnings": ["No tik.webp. A 512x512 logo is required before going live."] }

codetik build

Shell
$ 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

Shell
$ 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.

FlagWhat it does
(none)A draft: replaces your files, reaches nobody, needs no logo.
--liveRelease at the visibility in tik.yaml: public unless it says private or unlisted.
--draftPush 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 edits writes the rewrites into your folder, --apply all also 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 publish updates the tik at the visibility it has, and --draft is 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.
Shell
$ 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

Shell
$ 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.

FlagWhat it does
(none)Add what is missing (the switch in tik.yaml, a starter module, the spacetimedb library), publish, write the bindings.
--statusReport what the backend has and lacks, offline.
--offRemove it: the switch, backend/, the bindings and the library. The data stays on Codetik.
--reset-dbDelete every row in the tik's database.
-yDo 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

Shell
$ 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

Shell
$ 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

Shell
$ 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

Shell
$ 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

Shell
$ 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

Shell
$ codetik manifest

What 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

Shell
$ codetik login [--token <key>]$ codetik logout$ codetik whoami

login 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

Shell
$ 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

Shell
$ codetik skill [--agent claude,codex,cursor|all] [--project] [--path] [--remove]

Installs the codetik skill for your coding agents. See Using an agent.

codetik about

Shell
$ codetik about$ codetik ideas

about 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.