0.2.1 • Published 5 months ago

@onkernel/cli v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Kernel CLI

A command-line tool for deploying and invoking Kernel applications.

Installation

brew install onkernel/tap/kernel

Development Prerequisites

Install the following tools:

Compile the CLI:

make build   # compiles the binary to ./bin/kernel

Run the CLI:

./bin/kernel --help

Development workflow

Useful make targets:

  • make build – compile the project to ./bin/kernel
  • make test – execute unit tests
  • make lint – run the linter (requires golangci-lint)
  • make changelog – generate/update the CHANGELOG.md file using chglog
  • make release – create a release using goreleaser (builds archives, homebrew formula, etc. See below)

Releasing a new version

Prerequisites:

  • Make sure you have goreleaser pro installed via brew install goreleaser/tap/goreleaser-pro. You will need a license key (in 1pw), and then export 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_TOKEN with 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-run

This 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 release

The 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_key

Directory structure

packages/cli
├── cmd/          # cobra commands (root, deploy, invoke, …)
│   └── kernel/
│       └── main.go
├── pkg/          # reusable helpers (zip util, etc.)
├── .goreleaser.yaml
├── Makefile
└── README.md
0.2.1

5 months ago

0.2.0

5 months ago

0.1.7

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.0.2

6 months ago

0.0.1-alpha.2

6 months ago

0.0.1-alpha.1

6 months ago