CLI and documentation

CLI

The published npm package and executable are both named napikit. The CLI exposes:

  • new [name] to scaffold a project.
  • build and build --release to build addons.
  • bump [version] to version generated packages.
  • publish to publish packages to npm.
  • npm-init to initialize npm trusted publishing.

The CLI workspace lives at packages/cli/. Keep bunup as its bundler. The published bundle requires Node.js >=20.19.0; repository development uses Bun 1.3.14, and generated Zig projects use Zig 0.16.0. Validate TypeScript with bun run typecheck, behavior with bun test, and the distributable plus its node dist/index.js --help smoke check with bun run build.

Keep command files focused on orchestration:

  • src/build/targets.ts owns target discovery and CLI target parsing.
  • src/build/reconcile.ts owns release package reconciliation.
  • src/scaffold/ owns templates, writes, project validation, and Zig fingerprints.
  • src/internal/validation.ts owns npm name/version, GitHub repository, workflow filename, and containment checks.

Documentation

Rspress serves skills/ at https://napi.teakit.org, following the teakit/arith content model. The root contains only the overview, compact LLM contract, and teakit-napi package guidance. Detailed public pages live beside this file and are mapped back to stable routes by rspress.config.ts, including /quick-start, /async/workers, and /reference/env.

  • Put detailed public tutorials, reference pages, and package guidance in skills/teakit-napi/references/.
  • Put durable implementation knowledge in docs/knowledge/.
  • Put decisions and invariants in docs/memory/.
  • Put design options in docs/proposals/.
  • Put accepted implementation contracts in docs/specs/.
  • Update skills/_meta.json, skills/teakit-napi/references/_meta.json, and the route map in rspress.config.ts together when public pages move.
  • Keep Rspress itself at the repository root: root dependency, root scripts, root configuration, root skills/ content, and root doc_build/ output.
  • Run bun run docs:build to detect broken links and verify generated routes.

Repository automation and hosting boundary

  • .github/workflows/quality.yml runs the canonical check, typecheck, test, build, and docs:build gate. Repository CI and the tag-driven CLI release reuse that gate.
  • .github/workflows/publish-to-npm.yml releases this repository's napikit package. The scaffolded addon workflow is a different file, .github/workflows/publish.yml, written into generated consumer projects.
  • Rspress writes the static site to doc_build/ and tests/docs/verify-routes.ts verifies the canonical origin and stable routes.
  • No hosting-provider deployment workflow or DNS configuration for napi.teakit.org is present in this repository. Maintainers must configure and verify external hosting, artifact deployment, TLS, and DNS separately; a successful docs:build proves the site artifact and route contract, not that production deployment occurred.

Use the detailed CLI reference when changing commands or flags.