starterctl is the Go-based command-line client for this starter app. It talks to the app's HTTP API and supports health checks, user management, audit queries, background jobs, shell completion, and authenticated automation via personal access tokens.
If you are looking for the end-user guide instead of build and packaging details, see docs/cli-user-guide.md.
- Go 1.25+
- A running app server
- A personal access token for the target environment
For local development, the default app URL is http://localhost:3270.
Build the CLI from the cli/ directory:
go build -o starterctl.exe .On macOS or Linux:
go build -o starterctl .The simplest setup flow is to store the server URL and PAT locally:
starterctl configure --server http://localhost:3270 --token starter_pat_...That validates both /api/health and /api/auth/me before saving the config.
The default config locations are:
- Windows:
%APPDATA%\starterctl\config.json - macOS/Linux:
~/.config/starterctl/config.json
You can also override config and auth through environment variables:
STARTERCTL_CONFIG_DIRSTARTERCTL_SERVER_URLSTARTERCTL_TOKENSTARTERCTL_AUTH_HEADER
STARTERCTL_AUTH_HEADER=api-key switches auth from Authorization: Bearer ... to X-API-Key: ....
Check connectivity:
starterctl health
starterctl versionList users:
starterctl users list
starterctl users list --format json
starterctl users list --status ACTIVEInspect audit events:
starterctl audit list
starterctl audit list --format jsonWork with background jobs:
starterctl jobs list
starterctl jobs create --type noop --payload "{}"Generate shell completions:
starterctl completion powershell
starterctl completion install powershellThis is the fastest local verification path on Windows PowerShell.
- Create a local
.envif you do not already have one.
DATABASE_URL="file:./dev.db"
PORT=3270
AUTH_BASE_URL=http://localhost:3270
BETTER_AUTH_SECRET=dev-secret-change-me-in-production
INITIAL_ADMIN_EMAIL=admin@example.com
INITIAL_ADMIN_PASSWORD=ChangeMe123!
PAT_TOKEN_PREFIX=starter_pat- Bootstrap the local SQLite database and seed the admin user.
node scripts/ensure-local-db.mjs- Start the app.
pnpm run dev- In another terminal, build the CLI.
cd cli
go build -o starterctl.exe .- Create a PAT from the running app.
You can do that in the UI, or by logging in and calling the API:
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$loginBody = @{ email='admin@example.com'; password='ChangeMe123!' } | ConvertTo-Json
Invoke-WebRequest -UseBasicParsing -Uri 'http://localhost:3270/api/auth/login' -Method POST -ContentType 'application/json' -Body $loginBody -WebSession $session
$tokenBody = @{ name='CLI Smoke Test'; expiresInDays=90 } | ConvertTo-Json
$tokenResponse = Invoke-WebRequest -UseBasicParsing -Uri 'http://localhost:3270/api/tokens' -Method POST -ContentType 'application/json' -Body $tokenBody -WebSession $session
($tokenResponse.Content | ConvertFrom-Json).token.tokenValue- Configure the CLI and run a few live commands.
starterctl configure --server http://localhost:3270 --token starter_pat_...
starterctl health --format json
starterctl version
starterctl users list --format jsonFor a quick manual cross-build, set GOOS and GOARCH:
$env:GOOS='windows'; $env:GOARCH='amd64'; go build -o dist/starterctl-windows-amd64.exe .
$env:GOOS='linux'; $env:GOARCH='amd64'; go build -o dist/starterctl-linux-amd64 .
$env:GOOS='darwin'; $env:GOARCH='arm64'; go build -o dist/starterctl-darwin-arm64 .
Remove-Item Env:GOOS
Remove-Item Env:GOARCHThis repo also includes GoReleaser config in .goreleaser.yaml and the GitHub Actions workflow in .github/workflows/cli-release.yml.
Create a local snapshot release from cli/ with:
goreleaser release --snapshot --cleanFrom cli/:
gofmt -l .
go test ./...
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck ./...
go run github.com/fzipp/gocyclo/cmd/gocyclo -over 15 .
go build ./...From the repository root, pnpm run quality:cli runs the full CLI quality gate,
including the Go cyclomatic-complexity threshold. Set
QUALITY_THRESHOLDS_BYPASS=1 to make that threshold advisory while keeping the
other CLI checks blocking.
- If
goworks in a fresh terminal but not in VS Code, fully close all VS Code windows and reopen the editor so it picks up the updatedPATH. - If
starterctl healthsays the server URL is not configured, rerunstarterctl configure --server ... --token ...or setSTARTERCTL_SERVER_URLandSTARTERCTL_TOKENexplicitly. - If local auth requests fail, make sure the app is actually running on
http://localhost:3270and that your.envmatches that origin.