Skip to content

CLI Reference

curl -fsSL https://cli.kernstack.com | sh
kernstack [command] [flags]

Global flags: -v, --verbose, -h, --help. Credentials resolve as described in Configuration.

Project setup

Command Description
kernstack auth Browser login (alias login)
kernstack auth status Show the signed-in account (alias whoami)
kernstack auth logout Sign out
kernstack init [--demo] Create a project: console project, credentials, SDKs, starter code, hosted git
kernstack use [ENV] [--unset] [--print-env] [--yes] Select or create an environment and pin it for this project
kernstack current Show account, profile, and project context
kernstack version Print the CLI version

Hosted git

Command Description
kernstack git clone <project-id> [dir] [-b BRANCH] Clone with credentials and large objects configured
kernstack git branch List remote branches, including agent/<id>
kernstack git checkout <branch> [-f] Check out a remote branch (agent/<id> or agent-<id>)

See Hosted Git storage.

Plan and deploy

kernstack plan   [-f FILE] [--phase all|infra|deploy] [--json]
kernstack deploy [-f FILE] [--phase all|infra|deploy] [--only kind:name] [--json] [flags]
Flag Description
--phase all (default), infra, or deploy
--only Deploy one workload or frontend, e.g. function:api or app:web (function/worker force --phase deploy; app:web builds and uploads only that app's bucket, which must already exist)
--confirm-destructive Apply deletes for resources removed from stack.json
--allow-domain-takeover Rebind hostnames owned by another environment
--purge-cdn Purge CDN cache for all CDN routes after apply
--force-rebuild Rebuild and upload every bundle
--skip-local-build Skip npm run kernstack:build for Node.js workers
--skip-hooks Skip hooks.* and all apps[] builds (also on plan)
--skip-all-apps / --skip-app NAME Skip all or one apps[] build (also on plan)
--skip-seed Skip table and bucket seed uploads
--seed-only Upload seeds only; no build or apply
--seed-prefix PATH Limit seeds to buckets/<name>[/<path>] or tables/<name>
--allow-unverified Bypass stack.min_source_assurance (audited)
--yes Skip confirmation prompts

Develop

Command Description
kernstack serve [--function NAME] [--allow-remote] [-f FILE] Build and run one function locally (default: first in stack.json)
kernstack logs [--tail N] [--no-follow] [--function NAME] [--worker NAME] [--request-id ID] [--show-meta] Tail environment logs
kernstack add function [--name NAME] [--blueprint ID] [--project DIR] Add a function under functions/{name}/ (default blueprint func-go-minimal)
kernstack add worker [--name NAME] [--lang go\|python\|nodejs\|php] [--blueprint ID] [--project DIR] Add a worker under workers/{name}/

Inspect and data

kernstack inspect lists live functions, workers, tables, buckets, and routes.

kernstack inspect tables
kernstack inspect tables query TABLE --key-name NAME -k JSON [--index INDEX] [-l N] [--sort-key-op OP] [--sort-key-values JSON] [--descending]
kernstack inspect tables scan TABLE [-l N] [--index INDEX]
kernstack inspect tables get TABLE (-k JSON [--sort-key JSON] | --keys keys.json)
kernstack inspect tables put TABLE (--item item.json | --items items.json) [--respond-with none|old]
kernstack inspect tables delete TABLE (-k JSON [--sort-key JSON] | --keys keys.json) [--respond-with none|old]

kernstack inspect buckets [--max-keys N] [--start-after KEY]
kernstack inspect buckets list [bucket[/path]] [--delimiter D] [--max-keys N]
kernstack inspect buckets get bucket/path/key [-o PATH] [--version-id ID]
kernstack inspect buckets put LOCAL bucket/path/key [--content-type MIME]
kernstack inspect buckets put-dir LOCAL_DIR bucket[/prefix]
kernstack inspect buckets delete bucket/path/key [--version-id ID]

kernstack inspect aliases reconcile [--json]   # report broken or duplicate route aliases

Create tables and buckets through stack.json, not the CLI.