KDCube Apps bootstrap CLI
Project description
KDCube CLI
Bootstrap installer for the KDCube platform stack. This package clones the repository (if needed) and launches the guided setup wizard.
Prerequisites
macOS
- Python 3.9+ (Homebrew recommended)
- Git (Xcode Command Line Tools or Homebrew)
- Docker Desktop (includes Docker Compose)
Windows
- Python 3.9+
- Git for Windows
- Docker Desktop (enable WSL2 backend)
Linux
- Python 3.9+
- Git
- Docker Engine + Docker Compose plugin
Install
pipx install kdcube-cli
Alternative (pip):
python -m pip install --user kdcube-cli
On Debian/Ubuntu hosts that enforce PEP 668 (externally-managed-environment),
install the CLI into a dedicated virtual environment instead of the system
Python:
sudo apt-get update
sudo apt-get install -y python3-pip python3-venv
python3 -m venv ~/.venvs/kdcube-cli
~/.venvs/kdcube-cli/bin/pip install -e /path/to/kdcube_cli
~/.venvs/kdcube-cli/bin/kdcube-setup --help
Run
kdcube-setup
Quick start (new users)
- Run
kdcube-setup - Choose release-latest (pull prebuilt images)
- Answer yes to “Run docker compose now?”
That brings up the stack with no local build required.
We aim for a setup that is simple to try, and easy to explore further using the installed admin assistant and bundled tools.
What it installs (default)
- Repo clone:
~/.kdcube/kdcube-ai-app - Workdir:
~/.kdcube/kdcube-runtime - Docker images: pulled (release-latest/release-tag) or built (upstream/workspace/local)
CLI options (common)
| Option | Purpose |
|---|---|
--repo <url> |
Git repo URL (default: official kdcube repo). |
--path <repo> |
Use a local repo checkout for templates and builds (skips install-source menu). |
--workdir <path> |
Use a specific workdir instead of ~/.kdcube/kdcube-runtime. |
--reset-config |
Re‑prompt for config values without deleting files. |
--reset |
Alias for --reset-config. |
--clean |
Clean local Docker cache and unused KDCube images. |
--secrets-prompt |
Prompt for LLM keys (OpenAI/Anthropic/Brave/OpenRouter) and inject them at runtime (sidecar). |
--secrets-set KEY=VALUE |
Inject a secret value without prompting (repeatable). |
--proxy-ssl |
Force SSL proxy config (overrides assembly descriptor). |
--no-proxy-ssl |
Force non‑SSL proxy config (overrides assembly descriptor). |
--dry-run |
Generate env files and print their paths without running Docker. |
--dry-run-print-env |
With --dry-run, also print the full env file contents. |
Use a local checkout (dev)
kdcube-setup --path /Users/you/src/kdcube/kdcube-ai-app
When --path is provided, the wizard uses that repo for templates and local builds
and does not show the Install source menu.
Re-run prompts (edit existing values):
kdcube-setup --reset
Clean local Docker images/cache:
kdcube-setup --clean
Tip: if kdcube-setup is not on your PATH, run python -m pipx ensurepath
or re-open your shell after installation.
What the wizard does (today)
When you run kdcube-setup, the wizard performs the steps below:
- Creates a workdir with
config/,data/, andlogs/folders. - Writes compose env files into
config/(only if missing; it won’t overwrite existing files). - Copies nginx configs into
config/for runtime overrides:nginx_ui.conf- runtime proxy config (based on selected auth mode)
- Selects auth mode (simple, cognito, or delegated) and writes:
AUTH_PROVIDERin.env.ingress+.env.proc- Cognito fields when applicable (see below)
- Generates frontend runtime config based on auth mode or descriptor template.
- Creates local data folders for Postgres/Redis/exec workspace/bundle storage.
- Optionally builds images and starts
docker compose up -d.
Authentication modes
The wizard prompts for an auth mode and updates both backend and frontend config.
Simple (hardcoded)
AUTH_PROVIDER=simple- Frontend config:
frontend.config.hardcoded.json - Uses a hardcoded admin token in config (local dev only)
Cognito
AUTH_PROVIDER=cognito- Frontend config:
frontend.config.cognito.json - Required fields:
COGNITO_REGIONCOGNITO_USER_POOL_IDCOGNITO_APP_CLIENT_IDCOGNITO_SERVICE_CLIENT_ID
- The frontend
authorityis composed as:https://cognito-idp.<COGNITO_REGION>.amazonaws.com/<COGNITO_USER_POOL_ID>
Delegated
AUTH_PROVIDER=cognito- Frontend config:
frontend.config.delegated.json - Uses the delegated proxy template (proxylogin) while still validating tokens via Cognito.
- If
assembly.yamlprovidescompany, the generated delegated config uses it for:auth.totpAppNameauth.totpIssuer
Routes prefix & nginx proxy
The frontend config includes routesPrefix (default: /chatbot).
The wizard patches the runtime proxy config in config/ so nginx uses the
same prefix. This keeps /chatbot (or any custom prefix) consistent between UI and proxy.
If proxy.ssl: true and assembly.domain is set, the wizard also patches the
runtime nginx SSL config so YOUR_DOMAIN_NAME becomes the configured domain in:
server_name/etc/letsencrypt/live/<domain>/fullchain.pem/etc/letsencrypt/live/<domain>/privkey.pem
Secrets (third services tokens)
The wizard does not write OpenAI/Anthropic/Brave keys to .env files.
If you provide them during setup, they are injected at runtime into the
kdcube-secrets sidecar (in‑memory only) when assembly.yaml uses
secrets.provider: secrets-service. If you restart the stack, you’ll be
prompted again to re‑inject keys.
Order (automatic):
- Start
kdcube-secrets - Wait for it to be ready
- Inject keys
- Start/restart ingress + proc (they fetch secrets)
Manual re‑inject:
kdcube-setup --secrets-prompt --workdir ~/.kdcube/kdcube-runtime
Or pass explicit values:
kdcube-setup --secrets-set OPENAI_API_KEY=... --secrets-set ANTHROPIC_API_KEY=...
You can also override the git HTTPS token this way:
kdcube-setup --secrets-set GIT_HTTP_TOKEN=...
Note: re‑inject will restart kdcube-secrets, chat-ingress, and chat-proc
to refresh per‑run tokens (and the web proxy to keep upstreams in sync).
Per‑run tokens are generated by the CLI and are not stored in config/.
If you set LLM keys in env files (managed infra / custom setups), those env values still work and take precedence. The secrets sidecar is only used when env keys are missing.
Git HTTPS token (private bundles)
If you choose https-token auth for git bundles, the token is treated as a
secret and is not stored in .env.proc. It is injected at runtime (same
flow as LLM keys). You will be prompted again on the next run unless you pass
it via --secrets-set GIT_HTTP_TOKEN=....
More details: https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/ops/local/local-setup-README.md
Current scope: the wizard is optimized for docker‑compose (all‑in‑one).
It creates a workdir (default: ~/.kdcube/kdcube-runtime) and lets you:
- generate config/data/log folders
- choose where all artifacts come from (templates + images)
- start
docker compose(optional)
Install source menu (shown only when --path is not provided):
- upstream: clone/pull the repo into the workspace and build images locally
- release-latest: pull prebuilt images for the latest release
- release-tag: pull prebuilt images for a specific version (platform.ref)
- local: use a local repo path you provide (build locally)
- workspace: use the repo already cloned in the workspace (build locally)
Defaults:
- If the workspace repo exists → default is workspace
- If it does not exist → default is upstream
The workspace option only appears when a repo is already cloned there.
Only release-latest and release-tag pull images. All other choices build locally.
Tip: you can select the install source using the ↑/↓ arrow keys and Enter.
Example workdir layout:
~/.kdcube/kdcube-runtime
├─ config/
│ ├─ .env
│ ├─ .env.ingress
│ ├─ .env.proc
│ ├─ .env.metrics
│ ├─ .env.postgres.setup
│ ├─ .env.proxylogin
│ ├─ frontend.config.<mode>.json
│ ├─ nginx_ui.conf
│ └─ nginx_proxy*.conf
├─ data/
│ ├─ postgres/
│ ├─ redis/
│ ├─ kdcube-storage/
│ │ ├─ cb/
│ │ │ └─ tenants/<tenant>/projects/<project>/
│ │ │ ├─ conversation/<user>/<conversation>/<turn>/
│ │ │ └─ executions/<user>/<conversation>/<turn>/<exec_id>/
│ │ ├─ accounting/<tenant>/project/<YYYY.MM.DD>/<service>/<bundle_id>/
│ │ └─ analytics/<tenant>/project/accounting/{daily,weekly,monthly}/
│ ├─ exec-workspace/
│ └─ bundle-storage/
└─ logs/
├─ chat-ingress/
└─ chat-proc/
Advanced usage
Assembly descriptor (platform / frontend / infra)
You can point the CLI to an assembly descriptor YAML (assembly.yaml) that defines
platform metadata, frontend settings, auth, infra, and proxy defaults.
The wizard prompts for this as Assembly descriptor path. Wizard flow (descriptor usage):
- Provide the
assembly.yamlpath (defaults toworkdir/config/assembly.yaml). If you provide another path, the CLI copies it intoworkdir/config/assembly.yamland uses the copied file as the source of truth. - Choose whether to apply the Frontend section (build or image).
Repo field contract:
platform.repoandfrontend.build.reposhould use a cloneable repo spec:git@github.com:org/repo.githttps://github.com/org/repo.gitorg/repo
- older single-name values such as
kdcube-ai-appare still accepted for backward compatibility, but new descriptors should use one of the cloneable forms above
When an assembly descriptor is provided, the wizard writes non‑secret values back
into assembly.yaml (tenant/project, auth, infra, paths) and then renders .env*
from it. This makes assembly.yaml the source of truth for install‑time config.
Template:
app/ai-app/deployment/assembly.yaml(copied into the workdir if no path is provided)
References:
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/sdk/bundle/bundle-ops-README.md
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/service/cicd/assembly-descriptor-README.md
Bundles descriptor (optional)
You can provide a bundles descriptor (bundles.yaml) and an optional
bundles secrets file (bundles.secrets.yaml). This is the preferred way
to define bundles and their non‑secret config, with secrets kept separate.
If workdir/config/bundles.yaml already exists, the wizard pre-fills the prompt
with that path so it is reused on subsequent runs.
Note: secrets descriptors are not prefilled or cached.
The CLI stages bundles.yaml into the workdir and, when enabled:
- mounts
bundles.yamlas/config/bundles.yaml - sets
AGENTIC_BUNDLES_JSON=/config/bundles.yaml - enables bundle git resolution and env sync on startup
bundles.secrets.yaml is not copied into the workdir. It is read from the
path you provide and used only to inject secrets at runtime.
Example (bundles.yaml):
bundles:
version: "1"
default_bundle_id: "react@2026-02-10-02-44"
items:
- id: "react@2026-02-10-02-44"
name: "ReAct (example)"
repo: "git@github.com:kdcube/kdcube-ai-app.git"
ref: "v0.3.2"
subdir: "app/ai-app/src/kdcube-ai-app/kdcube_ai_app/apps/chat/sdk/examples/bundles"
module: "react@2026-02-10-02-44.entrypoint"
config:
embedding:
provider: "openai"
model: "text-embedding-3-small"
role_models:
solver.react.v2.decision.v2.strong:
provider: "anthropic"
model: "claude-sonnet-4-6"
Example (bundles.secrets.yaml):
bundles:
version: "1"
items:
- id: "react@2026-02-10-02-44"
secrets:
openai:
api_key: null
Templates:
References:
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/service/configuration/bundle-configuration-README.md
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/sdk/bundle/bundle-dev-README.md
Secrets descriptor (optional)
You can provide a secrets.yaml path in the wizard (or via KDCUBE_SECRETS_DESCRIPTOR_PATH).
The CLI does not copy this file into the workdir; it is used only to prefill runtime
secrets (OpenAI/Anthropic/Brave/Git HTTP token and delegated Cognito client secret).
Values are injected into the secrets sidecar at runtime and not written to .env.proc.
Secrets are keyed by dot‑path (e.g. services.openai.api_key).
Template:
Gateway config descriptor (optional)
You can provide a gateway.yaml path in the wizard (or via KDCUBE_GATEWAY_DESCRIPTOR_PATH).
The CLI loads it and replaces GATEWAY_CONFIG_JSON in .env.ingress, .env.proc,
and .env.metrics, then patches tenant and project from your prompts.
If workdir/config/gateway.yaml already exists, the wizard pre-fills the prompt
with that path so it is reused on subsequent runs.
Template:
References:
Custom UI via assembly descriptor (build or image)
If your assembly.yaml includes a frontend section, the CLI will switch to
custom‑ui‑managed‑infra compose mode.
Minimal example:
frontend:
build:
repo: "git@github.com:org/private-app.git"
ref: "ui-v2026.02.22"
dockerfile: "ops/docker/Dockerfile_UI"
src: "ui/chat-web-app"
image: "registry/private-app-ui:2026.02.22" # optional prebuilt UI image; if set, CLI writes KDCUBE_UI_IMAGE and skips the local web-ui build
frontend_config: "ops/docker/config.delegated.json" # optional
nginx_ui_config: "ops/docker/nginx_ui.conf" # optional
Frontend/runtime config behavior:
-
frontend.imageis optional. When present, the CLI writesKDCUBE_UI_IMAGEand treats the UI as a prebuilt image override. -
If
frontend.imageis omitted butfrontend.buildis present, the CLI clones/uses the frontend source repo and buildsweb-uilocally frombuild.repo,build.ref,build.dockerfile, andbuild.src. -
frontend.build.repoaccepts SSH URLs, HTTPS URLs, andowner/reposhorthand. -
frontend.build.image_nameis not used by the CLI installer. That field belongs to the ECS customer CI/CD flow, not the local docker-compose flow. -
If
frontend.frontend_configis provided, the CLI uses it as the template for the generated runtimeconfig.jsonand patches tenant/project/auth/routesPrefix values. -
If it is omitted, the CLI falls back to a built-in template by auth mode:
simple->config.hardcoded.jsoncognito->config.cognito.jsondelegated->config.delegated.json
-
If
frontend.nginx_ui_configis omitted, the CLI falls back to the built-innginx_ui.conf.
How to activate:
- Run
kdcube-setup - Choose Use an assembly descriptor → provide
assembly.yaml - Confirm Frontend usage when prompted.
- The CLI selects
deployment/docker/custom-ui-managed-infra/docker-compose.yaml.
Full details:
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/service/cicd/assembly-descriptor-README.md
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/service/cicd/custom-cicd-README.md
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/service/cicd/cli-README.md
Manual compose (advanced)
If you want to run compose manually, use the workdir env file:
docker compose --env-file ~/.kdcube/kdcube-runtime/config/.env up -d --build
Note: --env-file is a Docker Compose option (not a CLI flag).
Where data is stored
- Config:
workdir/config/(env files, nginx config, UI config) - Data:
workdir/data/(postgres/redis storage, bundle storage, exec workspace) - Logs:
workdir/logs/
Infra credentials (Postgres/Redis) are stored in config/.env* for local compose.
LLM keys are not stored in files; they live only in the secrets sidecar.
Compose usage (recommended)
- Run the wizard and choose a workdir (example:
/srv/kdcube-local). - It will generate:
/srv/kdcube-local/config/.env/srv/kdcube-local/config/.env.ingress/srv/kdcube-local/config/.env.proc/srv/kdcube-local/config/.env.metrics/srv/kdcube-local/config/.env.postgres.setup/srv/kdcube-local/config/.env.proxylogin/srv/kdcube-local/config/frontend.config.<mode>.json/srv/kdcube-local/config/nginx_ui.conf/srv/kdcube-local/config/nginx_proxy*.conf
- Start compose from
deployment/docker/all_in_one_kdcube:
docker compose --env-file /srv/kdcube-local/config/.env up -d --build
Open the UI:
http://localhost:${KDCUBE_UI_PORT}/chatbot/chat(via proxy, omit:${KDCUBE_UI_PORT}if it is80)
Notes
- The wizard does not overwrite existing config files in your workdir. It only fills placeholders in newly created files.
- Use
kdcube-setup --resetto re-enter values without deleting files. - Config upgrades/migrations will be added later when configs are versioned.
- The wizard auto‑saves after major sections, so if you exit early (Ctrl+C) most
values entered so far are preserved in
config/and will appear as defaults next run.
Tip: you can edit workdir/config/nginx_ui.conf and the selected workdir/config/nginx_proxy*.conf
without rebuilding images (they are mounted into the containers at runtime).
UI config source of truth
The web UI loads its runtime config from /config.json inside the web-ui
container. Docker compose mounts the host file defined by
PATH_TO_FRONTEND_CONFIG_JSON to:
/usr/share/nginx/html/config.json
Clean / reset
Clean local Docker cache and unused KDCube images:
kdcube-setup --clean
Reset prompts without deleting files:
kdcube-setup --reset
Full reset (delete workdir):
rm -rf ~/.kdcube/kdcube-runtime
If the UI is calling the wrong tenant/project, check:
PATH_TO_FRONTEND_CONFIG_JSONin the generated.envcurl http://localhost:<ui_port>/config.json
See the full local setup flow on GitHub: https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/ops/local/local-setup-README.md
More documentation:
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/service/cicd/assembly-descriptor-README.md
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/service/cicd/custom-cicd-README.md
- https://github.com/kdcube/kdcube-ai-app/blob/main/app/ai-app/docs/service/cicd/cli-README.md
License
MIT License. See app/ai-app/src/kdcube-ai-app/LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kdcube_cli-2026.3.31.203.tar.gz.
File metadata
- Download URL: kdcube_cli-2026.3.31.203.tar.gz
- Upload date:
- Size: 62.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
242c37a3888c6b9c49ef06bc7bbeda8872b507961284b26c787c22a5ff3c5020
|
|
| MD5 |
9c4b4f99d8679348252c0e295b62b21f
|
|
| BLAKE2b-256 |
bb408457d40d58caabf7d5f9f831e9f6cd2f80503235d69ad2c81913d160b12b
|
Provenance
The following attestation bundles were made for kdcube_cli-2026.3.31.203.tar.gz:
Publisher:
release-kdcube-platform.yml on kdcube/kdcube-ai-app
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kdcube_cli-2026.3.31.203.tar.gz -
Subject digest:
242c37a3888c6b9c49ef06bc7bbeda8872b507961284b26c787c22a5ff3c5020 - Sigstore transparency entry: 1201663774
- Sigstore integration time:
-
Permalink:
kdcube/kdcube-ai-app@08fb0da05d0e2846e271825ab876fa9cdfff03aa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kdcube
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-kdcube-platform.yml@08fb0da05d0e2846e271825ab876fa9cdfff03aa -
Trigger Event:
push
-
Statement type:
File details
Details for the file kdcube_cli-2026.3.31.203-py3-none-any.whl.
File metadata
- Download URL: kdcube_cli-2026.3.31.203-py3-none-any.whl
- Upload date:
- Size: 56.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
432e216ab1fae61b0dd5d87a8f8b4339c4bea11f2defc4e433e4825a67d73492
|
|
| MD5 |
e8875bf04d95ab9150bb65bbb374e85d
|
|
| BLAKE2b-256 |
0a3d177583464d16b680b4b7162d764b86c504f1d7eb7f47162e0860c1054c62
|
Provenance
The following attestation bundles were made for kdcube_cli-2026.3.31.203-py3-none-any.whl:
Publisher:
release-kdcube-platform.yml on kdcube/kdcube-ai-app
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kdcube_cli-2026.3.31.203-py3-none-any.whl -
Subject digest:
432e216ab1fae61b0dd5d87a8f8b4339c4bea11f2defc4e433e4825a67d73492 - Sigstore transparency entry: 1201663799
- Sigstore integration time:
-
Permalink:
kdcube/kdcube-ai-app@08fb0da05d0e2846e271825ab876fa9cdfff03aa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kdcube
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-kdcube-platform.yml@08fb0da05d0e2846e271825ab876fa9cdfff03aa -
Trigger Event:
push
-
Statement type: