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>
Releases are automated via GitHub Actions. Simply push a version tag and the release workflow will handle the rest.
# Find the latest version
git describe --abbrev=0
# Create and push a new tag (bump version following https://semver.org/)
git tag -a v<VERSION> -m "Version <VERSION>"
git push origin v<VERSION>The release workflow will automatically:
- Build binaries for darwin, linux, and windows (amd64 and arm64)
- Create a GitHub release with changelog
- Publish to npm as
@onkernel/cli - Update the Homebrew formula in
onkernel/homebrew-tap
The following secrets must be configured in the repository settings:
| Secret | Description |
|---|---|
GH_PAT |
GitHub Personal Access Token with repo scope. Must have write access to both this repository (for creating releases) and onkernel/homebrew-tap (for updating the Homebrew formula). Create at https://github.com/settings/tokens/new?scopes=repo |
GORELEASER_KEY |
GoReleaser Pro license key (required for npm and homebrew publishing) |
NPM_TOKEN |
npm access token for publishing @onkernel/cli |
To test the release process locally before pushing a tag:
Prerequisites:
- Install goreleaser-pro via
brew install --cask goreleaser/tap/goreleaser-pro - Export
GORELEASER_KEY=<license key from 1pw>
make release-dry-runThis will check that everything is working without actually releasing anything.