A command-line tool for deploying and invoking Kernel applications.
brew install onkernel/tap/kernelInstall the following tools:
- Go 1.22+ ( https://go.dev/doc/install )
- Goreleaser Pro - IMPORTANT: You must install goreleaser-pro, not the standard version, as this is required for our release process
- chglog
Compile the CLI:
make build # compiles the binary to ./bin/kernelRun the CLI:
./bin/kernel --helpUseful make targets:
make build– compile the project to./bin/kernelmake test– execute unit testsmake lint– run the linter (requiresgolangci-lint)make changelog– generate/update theCHANGELOG.mdfile using chglogmake release– create a release using goreleaser (builds archives, homebrew formula, etc. See below)
A typical workflow we encounter is updating the API and integrating those changes into our CLI. The high level workflow is (update API) -> (update SDK) -> (update CLI). Detailed instructions below
- Get added to https://www.stainless.com/ organization
- For the given SDK version switch to branch changes - see https://app.stainless.com/docs/guides/branches
- Update
openapi.stainless.ymlwith new endpoint paths, objects, etc- Note: https://github.com/stainless-sdks/kernel-config/blob/main/openapi.stainless.yml is the source of truth. You can pull older versions as necessary
- Update
openapi.ymlwith your changes - Iterate in the diagnostics view until all errors are fixed
- Hit
Save & build branch - This will then create a branch in https://github.com/stainless-sdks/kernel-go
- Using either your branch name or a specific commit hash you want to point to, run this script to modify the CLI's
go.mod:
./scripts/go-mod-replace-kernel.sh <commit | branch name>
Prerequisites:
-
Make sure you have goreleaser-pro installed via
brew install --cask goreleaser/tap/goreleaser-pro. You will need a license key (in 1pw), and thenexport GORELEASER_KEY=<the key>. Note: goreleaser-pro is required, not the standard goreleaser version. -
Grab the NPM token for our org (in 1pw) and run
npm config set '//registry.npmjs.org/:_authToken'=<the token> -
export a
GITHUB_TOKENwith repo and write:packages permissions: https://github.com/settings/tokens/new?scopes=repo,write:packages.
With a clean tree on the branch you want to release (can be main or a pr branch you're about to merge, doesn't matter), run:
make release-dry-runThis will check that everything is working, but not actually release anything. You should see one error about there not being a git tag, and that's fine.
To actually release, run:
# use `git describe --abbrev=0` to find the latest version and then bump it following https://semver.org/
./scripts/release.sh <version> [description]