Development
This page is about working on the Kerpeten CLI itself, in the KerpetenSH/kerpeten repository. You need Bun 1.4.5. Install the dependencies once, in a clone of that repository:
bun installFrom source
Section titled “From source”scripts/kerpeten.ts runs the CLI from source, without a build, from any directory:
bun /path/to/kerpeten/scripts/kerpeten.ts review --dry-runbun run build -- --target linux-x64 writes a standalone binary to dist/, which also runs from any directory.
Do not start src/cli/main.ts directly from another directory: Bun takes the decorator dialect from the tsconfig.json of the working directory, and the CLI needs the experimentalDecorators setting of the Kerpeten repository’s. The launcher passes it with --tsconfig-override; the binary has it compiled in.
Checks and builds
Section titled “Checks and builds”bun run checkbun run build -- --target linux-x64check runs the linter, the type check, the tests and the source layout rules. build writes a standalone binary to dist/; the targets are linux-x64, linux-arm64 and darwin-arm64.
bun run npm-packages writes the npm packages to dist/npm/: the kerpeten package with the launcher, and one @kerpetensh/kerpeten-<target> package with the binary of each target. bun run npm-smoke installs them with npm into an empty directory and runs the installed command. RELEASING.md tells how a version gets to npm.
Changesets
Section titled “Changesets”A pull request to the Kerpeten repository that changes what a user of kerpeten gets adds a changeset: a small file under .changeset/ that names the bump (patch, minor or major) and describes the change. bun run changeset writes it from a few questions, and .changeset/README.md shows how to write it by hand. The version in package.json is never edited by hand: the release workflow raises it from these files.
These docs are in the KerpetenSH/website repository. A change to Kerpeten that changes what a user sees needs a change to the docs there.