CLI
@kitbase/cli lets you manage your Kitbase projects from the terminal. Currently supports building and pushing Ionic/Capacitor web apps for OTA updates.
Installation
npm install -g @kitbase/clinpx @kitbase/cli ionic pushSetup
Initialize your project with an SDK key:
kitbase initThis creates a .kitbasecli file in your project root and adds it to .gitignore.
You can also pass values directly:
kitbase init --api-key sk_live_xxxFor self-hosted instances, provide your API URL:
kitbase init --api-key sk_live_xxx --base-url https://api.mycompany.comThis writes both values to .kitbasecli:
KITBASE_API_KEY=sk_live_xxx
KITBASE_API_URL=https://api.mycompany.comConfiguration Resolution
Both the SDK key and API base URL are resolved in the same priority order (first match wins):
| Setting | CLI flag | Environment variable | Config file key |
|---|---|---|---|
| SDK key | --api-key | KITBASE_API_KEY | KITBASE_API_KEY |
| API URL | --base-url | KITBASE_API_URL | KITBASE_API_URL |
If no API URL is configured, it defaults to https://api.kitbase.dev.
Commands
kitbase init
Initialize Kitbase CLI config in the current project.
kitbase init # Interactive prompt for SDK key
kitbase init --api-key sk_live_xxx # Non-interactive
kitbase init --force # Overwrite existing configkitbase ionic push
Build and upload your Ionic/Capacitor web app to Kitbase for OTA updates.
# Build and upload
kitbase ionic push
# Skip build, upload existing output
kitbase ionic push --skip-build
# Upload a pre-built zip
kitbase ionic push --file ./build.zip --version 1.0.0
# CI/CD usage (non-interactive)
kitbase ionic push --api-key $KITBASE_API_KEY --skip-buildFlags:
| Flag | Short | Description |
|---|---|---|
--skip-build | -s | Skip building, use existing build output |
--output-dir | -o | Custom web build output directory |
--file | -f | Path to an existing zip file to upload |
--version | -v | Override app version |
--api-key | -k | SDK key for authentication |
--base-url | Override API base URL | |
--commit | Override git commit hash | |
--branch | Override git branch name | |
--message | Override git commit message |
CI/CD
Set KITBASE_API_KEY as an environment variable in your CI pipeline:
# GitHub Actions
- name: Push to Kitbase
env:
KITBASE_API_KEY: ${{ secrets.KITBASE_API_KEY }}
run: npx @kitbase/cli ionic push --skip-buildFor self-hosted instances, also set KITBASE_API_URL:
- name: Push to Kitbase (self-hosted)
env:
KITBASE_API_KEY: ${{ secrets.KITBASE_API_KEY }}
KITBASE_API_URL: ${{ secrets.KITBASE_API_URL }}
run: npx @kitbase/cli ionic push --skip-build