skmtcdocs
CLI

CLI overview

The skmtc CLI's command surface, conventions, and shared flags. Quick navigation to every command, plus the conventions every command obeys.

The CLI is the orchestration layer around the engine. It bootstraps projects, manages generator installation, runs the worker, and reports diagnostics. Every command writes structured JSON output behind --json so agents can consume it programmatically.

Synopsis

skmtc <command> [args...] [--json] [--no-input]

The CLI is installed via Deno's install mechanism, then invoked as skmtc from any shell. The entry point is skmtc/deno/cli/mod.ts.

Command list

Project lifecycle

CommandPurposeReference
initInitialize a new SKMTC workspaceinit
createScaffold a new local generator from scratchcreate
cloneFork an existing JSR generator into the projectclone
installAdd a JSR-hosted generator to the projectinstall
listShow installed generators in a projectlist
removeRemove a generator from a projectremove

Generation

CommandPurposeReference
generateRun the engine end-to-end on a project's specgenerate
bundleRebuild the project's bundle.js (worker payload)bundle
cleanDelete a project's generated files + manifest, pruning emptied dirsclean
devWatch mode for iterative generator developmentdev

Publish

CommandPurposeReference
publishPublish a new immutable stack version to skmtc-hubpublish
pushPush a project's client.json (config + enrichments) to its hub projectpush
pullPull a project's config (enrichments + filters) from its hub project into the local client.jsonpull
projectManage a hub project built from the local setup: create a new project, rm itproject
loginValidate + store a hub PAT (paste-a-PAT; becomes publish's default credential)login
logoutDelete the stored hub credential (idempotent)logout

Diagnostics

CommandPurposeReference
doctorDiagnose project setup issuesdoctor
agent-contextWrite a structured project state dump for AI agentsagent-context

Shared flags

--no-input

Disables interactive prompts. Commands that prompt for missing arguments (e.g., "which project?", "which generator?") will exit with code 2 instead.

Use in scripts, CI, and agent workflows where TTY-style interaction isn't possible or desirable.

--json

Writes structured JSON to stdout instead of human-readable text.

Implies --no-input — JSON output is incompatible with interactive prompting (a prompt would corrupt the JSON stream).

The exact JSON shape is documented per-command. Common fields across commands:

{
  "command": "install",
  "projectName": "my-api",
  // ... command-specific fields
  "verifyWith": "cat .skmtc/my-api/deno.json"
}

Many commands include a verifyWith field — a follow-up shell command an agent can run to confirm the operation landed. This is a key affordance for agentic workflows where the CLI is one tool among many.

Strict mode

When --no-input (or --json) is set, the CLI runs in strict mode:

  • Required arguments not provided on the command line cause exit code 2 (rather than prompting)
  • No interactive disambiguation (e.g., "we found multiple matches, pick one")
  • Errors are reported as structured JSON when --json is set

This makes the CLI's behavior fully deterministic and scriptable.

Exit codes

The CLI uses a consistent exit-code convention across commands:

CodeMeaning
0Success
1Operational failure (network, filesystem, validation)
2Invalid invocation (missing args, unknown flags)

doctor collapses "internal failure" and "a check ran at error severity" onto exit 1 — it does not use a distinct exit code for diagnostics failures.

Per-command pages document which codes apply.

Project layout assumed by the CLI

workspace-root/
├── deno.json                          # workspace deno.json
├── .skmtc/
│   └── <project>/
│       ├── deno.json                  # per-project generator imports
│       ├── .settings/
│       │   ├── client.json            # per-project settings (source, basePath, enrichments)
│       │   └── manifest.json          # last-run manifest (written by generate)
│       ├── bundle.js                  # generated worker payload
│       └── <generator>/               # cloned or created generator source
│           ├── deno.json
│           ├── mod.ts
│           └── src/
└── (your application code)

The .skmtc/ directory is the CLI's working area. Each subdirectory is a separate "project" — a logical bundle of generators applied to one spec. Most workspaces have one project; multi-project workspaces exist when one repo produces multiple sets of artifacts.

Configuration files

The CLI reads (and sometimes writes) these files:

FilePurpose
deno.json (workspace root)Workspace-level configuration
.skmtc/<project>/deno.jsonPer-project generator imports
.skmtc/<project>/.settings/client.jsonPer-project generation settings (source, basePath, enrichments)
.skmtc/<project>/.settings/manifest.jsonLast-run manifest
<generator>/deno.jsonPer-generator package metadata

See reference/settings/client-json-schema.md for the client.json schema.

Command conventions

Project argument

Most commands take [project] as an optional positional argument. Resolution order:

  1. Explicit [project] argument
  2. Single-project workspace: the project name is inferred
  3. Interactive prompt (only if not in strict mode)
  4. Strict mode without arg → exit code 2

Generator argument

Generator specifiers can be:

  • Bare package names: @skmtc/gen-zod
  • With semver: @skmtc/gen-zod@^0.0.55
  • Full JSR specifiers: jsr:@skmtc/gen-zod@^0.0.55

The CLI normalizes all three forms.

Output style

Human mode (no --json)

  • Colored output to stdout/stderr
  • Progress indicators for long-running operations
  • Tables for tabular data (e.g., skmtc list)

JSON mode (--json)

  • Single JSON object to stdout
  • Errors go to stderr (also as JSON when --json is set)
  • No progress indicators

See also

On this page