@onkernel/cli v0.2.1
Kernel CLI
A command-line tool for deploying and invoking Kernel applications.
Installation
brew install onkernel/tap/kernelDevelopment Prerequisites
Install the following tools:
- Go 1.22+ ( https://go.dev/doc/install )
- Goreleaser
- chglog
Compile the CLI:
make build # compiles the binary to ./bin/kernelRun the CLI:
./bin/kernel --helpDevelopment workflow
Useful 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)
Releasing a new version
Prerequisites:
Make sure you have
goreleaserpro installed viabrew install goreleaser/tap/goreleaser-pro. You will need a license key (in 1pw), and thenexport GORELEASER_KEY=<the key>.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.Make sure you are logged in to the prod AWS account with
aws sso login --sso-session=kernel+export AWS_PROFILE=kernel-prod. This is necessary to publish releases to S3.
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 tag -l | grep cli` to find the latest version and what you want to bump it to
export VERSION=0.1.1
git tag -a cli/v$VERSION -m "Bugfixes"
git push origin cli/v$VERSION
make releaseThe NPM publish needs some extra steps (hopefully one day goreleaser will support this, but right now it assumes download links are public github releases, which we don't have at the moment):
go run scripts/npmpublish/npmpublish.go ./.npmdisttmpl ./dist
cd .npmdist && npm publish --access public
```)
### Environment variables
The CLI requires a Kernel API key to interact with the platform:
```bash
export KERNEL_API_KEY=your_api_keyDirectory structure
packages/cli
├── cmd/ # cobra commands (root, deploy, invoke, …)
│ └── kernel/
│ └── main.go
├── pkg/ # reusable helpers (zip util, etc.)
├── .goreleaser.yaml
├── Makefile
└── README.md5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago