teakit

teakit is a Bun-first command-line tool for creating new Teakit tslib projects from a built-in template and checking an existing project against the Teakit baseline. It is designed to be driven by humans and AI agents alike: every command prints a single structured JSON result by default.

Installation

npm
yarn
pnpm
bun
deno
npm install -D teakit

teakit is published on the public npm registry. After installing, invoke the teakit binary directly, via your runner (bunx teakit …, npx teakit …), or from a package script.

Quick start

# Scaffold a new tslib project named "hello" in the current directory
teakit create hello

# Check whether the current directory matches the Teakit tslib baseline
cd hello && teakit doctor

A freshly created project passes teakit doctor with no findings.

Commands

teakit create <name>

Creates a new Teakit tslib project from the built-in template (rendered locally, no network fetch). The project defaults to Bun and ships with empty runtime dependencies.

<name> is normalized into a package slug (^[a-z0-9][a-z0-9-]*$); an @scope/ prefix or a leading teakit- is stripped. All package metadata (name, skill folder, PascalCase symbol, repository, owner, description) is derived from it.

FlagDescription
--cwd <dir>Base directory to create <name> in (default: current directory).
--owner <scope>Override the npm scope and GitHub owner; wins over any @scope/ in the name.
--description <text>Override the default package description.
--dry-runRun all checks and report the files that would be written, without writing anything.
--format <json|text>Output format (see Output).
teakit create hello --owner acme --description "A friendly greeting library."
teakit create widget --cwd packages --dry-run

On success it prints the created target, the list of files, and nextActions (cd …, bun install, bun run check, bun run test). It never overwrites a non-empty target.

teakit doctor

Checks the current working directory against the Teakit tslib baseline and prints structured findings. It never modifies files and has no fix mode — an AI agent (or you) applies the fixes from the findings.

Findings carry a stable kebab-case code and a severity:

  • error — breaks build/test or violates a core constraint: package.json, ESM type, empty runtime deps, Bun scripts, README.md, src/index.ts, tests/.
  • warn — missing convention scaffolding (AGENTS.md, docs/**/index.md, skills/llms.md, a package skill); the project still builds.

status is error if any error finding exists, else warn if any warning, else ok.

teakit doctor              # JSON in a pipe, human text in a terminal
teakit doctor --format text

teakit --describe

Prints a machine-readable description of the CLI — commands, required arguments, exit codes, and the full list of doctor finding codes. Running teakit with no arguments prints the same thing. Use it to discover the real command surface instead of guessing.

teakit --version / --help

Plain-text version number and usage. (These two are the only non-JSON output.)

Output

create and doctor produce a single JSON object — the command's structured result — with a schemaVersion field. Diagnostics and usage errors are JSON on stderr; results are on stdout.

create and doctor also accept --format <json|text>:

  • Default follows the TTY: a terminal gets human-readable text; a pipe or redirect gets json. So scripts and agents capturing stdout get JSON automatically.
  • Pass --format json (or text) to force it. --describe and usage errors are always JSON; --version/--help are always plain text.

Exit codes

CodeMeaning
0Completed with status ok or warn.
1Completed but has error findings, or could not finish safely (e.g. non-empty target).
2Usage error: unknown command, missing argument, or unsupported flag.

For AI agents

See LLMs for the compact contract — the command surface, the JSON output protocol, and exit codes for driving teakit programmatically.