Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ kbagent workspace from-transformation --project ALIAS --component-id ID --config

kbagent data-app list [--project NAME ...] [--branch ID]
kbagent data-app detail --project NAME --app-id ID [--branch ID]
kbagent data-app create --project ALIAS --name NAME --slug SLUG (--git-repo URL | --use-managed-git-repo) [--description STR | --description-file PATH] [--git-branch main] [--git-public/--no-git-public] [--git-username USER] [--git-pat-env VAR | --git-pat-file PATH | --git-pat-encrypted KBC::Project...] [--auth password|public] [--size tiny|small|medium|large] [--auto-suspend SECONDS] [--type python-js|python|streamlit|r|...] [--workspace/--no-workspace] [--branch ID] [--no-deploy] [--wait] [--timeout SECONDS] [--keep-on-failure] [--dry-run]
kbagent data-app create --project ALIAS --name NAME --slug SLUG (--git-repo URL | --use-managed-git-repo) [--description STR | --description-file PATH] [--git-branch main] [--git-public/--no-git-public] [--git-username USER] [--git-pat-env VAR | --git-pat-file PATH | --git-pat-encrypted KBC::Project...] [--auth password|public] [--size tiny|small|medium|large] [--auto-suspend SECONDS] [--type python-js|python|streamlit|r|...] [--workspace/--no-workspace] [--branch ID] [--no-deploy] [--wait] [--timeout SECONDS] [--keep-on-failure] [--dry-run] [--copy] [--reveal]
# --workspace / --no-workspace (0.87.0+): DEFAULT ON. Writes runtime.workspace.enabled=true --
# the ONLY switch that makes the platform provision the ephemeral workspace and inject WORKSPACE_ID,
# QUERY_SERVICE_URL and KBC_WORKSPACE_MANIFEST_PATH. Every app that reads Storage needs it. Before
Expand All @@ -903,11 +903,27 @@ kbagent data-app create --project ALIAS --name NAME --slug SLUG (--git-repo URL
# deploy pins the LATEST configVersion when a git block is present and omits it for a PURE managed
# repo (deploys from managedGitRepoId). Use `data-app runs` to debug a deploy that reverts to
# stopped (setup-phase failures produce no container logs).
kbagent data-app deploy --project NAME --app-id ID [--config-version N] [--wait] [--timeout SECONDS] [--branch ID]
kbagent data-app deploy --project NAME --app-id ID [--config-version N] [--wait] [--timeout SECONDS] [--branch ID] [--copy] [--reveal]
kbagent data-app start --project NAME --app-id ID [--wait] [--timeout SECONDS]
kbagent data-app stop --project NAME --app-id ID [--wait] [--timeout SECONDS]
kbagent data-app delete --project NAME --app-id ID [--yes]
kbagent data-app password --project NAME --app-id ID
kbagent data-app password --project NAME --app-id ID [--copy] [--reveal] [--open]
# data-app password: never prints the password unless --reveal, so it does not go into an AI
# agent's context. Project token only (static or session) -- the Manage token and its prompt are
# gone. In a terminal (human mode) it waits for `c` to copy (Enter/Esc/q finishes, 120 s timeout);
# without a terminal or with --json only --copy copies. Nothing copied -> exit 0,
# password_delivered_to null, ui_url = the Keboola UI page that shows it. --reveal + --copy =
# INVALID_ARGUMENT. Refuses a non-password app (VALIDATION_ERROR) and a null password (NOT_FOUND).
# serve: GET /data-apps/{p}/{app}/password takes no X-Manage-Token; ?reveal=true adds `password`.
# create --wait / deploy --wait deliver the password the same way once the app runs (shared
# CopyOption / RevealOption + deliver_password in commands/_data_app_password.py); there
# --copy / --reveal need --wait and a deploy (else INVALID_ARGUMENT, exit 2, no API call;
# --dry-run applies the same rules and adds a `password_delivery` plan). Without a flag and
# without the terminal prompt nothing is read (output as before). With a flag, JSON adds only
# ui_url / password_delivered_to / password (--reveal); any failed read after the deploy is a
# warnings[] entry, exit 0. The serve create / deploy routes are unchanged. BREAKING: scripts
# reading `.data.password` from `data-app password` must add --reveal.
# Version gate + agent rules: gotchas.md / AGENT_CONTEXT.
kbagent data-app logs --project NAME --app-id ID [--lines N] [--since ISO8601]
kbagent data-app runs --project NAME --app-id ID [--limit N]
kbagent data-app secrets-set --project ALIAS --app-id ID --secret '#KEY=VALUE' [--secret ...] [--secrets-file PATH] [--branch ID] [--allow-plaintext-on-encrypt-failure] [--dry-run] [--no-hint-next]
Expand Down
22 changes: 12 additions & 10 deletions docs/TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -920,20 +920,22 @@ kbagent --json data-app create \

`--auth password` (the default) wraps the app in a simpleAuth gate. The
20-character hex password is auto-generated by the platform on first
deploy. To retrieve it:
deploy. The command above uses `--json`, so it never prompts; run it
without `--json` in a terminal and `--wait` asks you to press `c` to copy
the password as soon as the app runs (`deploy --wait` does the same). To
copy it later (the project token is enough):

```bash
# Manage API token: interactive prompt by default. For CI,
# add `--allow-env-manage-token` and set KBC_MANAGE_API_TOKEN in env.
kbagent --json data-app password \
--project prod --app-id 12345678 \
| jq -r '.data.password'
# <20-character hex password, e.g. a1b2c3d4e5f6a7b8c9d0>
kbagent data-app password --project prod --app-id 12345678
# Shows the app URL and the Keboola UI page, then: press c to copy the
# password, Enter to finish. The password is not printed.
```

The password cannot be rotated; to change it, delete and recreate the
app. (See [§3](#3-add-a-whole-organization) for `KBC_MANAGE_API_TOKEN`
setup -- it is the same Manage token `org setup` uses.)
Without a terminal (a script, or an AI agent running the command), add
`--copy` to copy it at once. `--reveal` prints it instead, for scripts and
CI only -- an AI agent that sees it puts it into the chat history. When
nothing was copied, `ui_url` in the output is the Keboola UI page that
shows the password. The Keboola UI can reset the password.

### 9.3 Roll out a new version: `data-app deploy` after `config update`

Expand Down
2 changes: 1 addition & 1 deletion docs/web-server-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Python/JS (default), Streamlit and R data apps -- create, deploy, start/stop, ma
| `POST` | `/data-apps/{project}/{app_id}/deploy` | Deploy a data app version |
| `POST` | `/data-apps/{project}/{app_id}/start` | Start a data app |
| `POST` | `/data-apps/{project}/{app_id}/stop` | Stop a data app |
| `GET` | `/data-apps/{project}/{app_id}/password` | Get data app access password |
| `GET` | `/data-apps/{project}/{app_id}/password` | Get data app password metadata (password only with reveal=true) |
| `GET` | `/data-apps/{project}/{app_id}/logs` | Tail data app container logs |
| `GET` | `/data-apps/{project}/{app_id}/secrets` | List data app secrets |
| `PUT` | `/data-apps/{project}/{app_id}/secrets` | Set data app secrets |
Expand Down
11 changes: 10 additions & 1 deletion plugins/kbagent/agents/keboola-expert.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ been retired, so its absence is NOT a promise (see §1 Rule 6).
| Bring a new data app online | `kbagent data-app create --project P --name N --slug S --git-repo URL [--git-pat-env VAR \| --git-public]` -- Storage access is ON by default on 0.87.0+ (`--no-workspace` opts out; on <= 0.86.0 patch `runtime.workspace.enabled` after create or it reads NOTHING) -- or `--use-managed-git-repo` for an empty Keboola-hosted repo (mutually exclusive; forces `--no-deploy`; then `git-credentials-create` + push + `deploy`). See [data-app-workflow.md](../skills/kbagent/references/data-app-workflow.md). **Authoring the repo itself is a different contract** (nginx `listen 8888`, no `[program:nginx]`, health check polls `GET /`) owned by Keboola's `dataapp-developer` skill in `keboola/ai-kit` -- read it before writing `keboola-config/`; `validate-repo` checks only a subset, so 0 BLOCKING does not promise the app starts | `config new --component-id keboola.data-apps` + `encrypt values` + raw `POST /apps`, only for custom shapes | `PATCH desiredState=running` without `configVersion` + `restartIfRunning` (pins to the v2 empty shell; errors `dataApp.git.repository is required`) |
| Roll out / wake / pause / tear down a data app | `data-app deploy --wait` after ANY config change (sends the `{desiredState, configVersion, restartIfRunning}` trio); `data-app start` wakes a parked app without bumping the version; `data-app stop` pauses; `data-app delete` is irreversible and cascades to the Storage config | -- | `config update` then `job run` (data apps are not jobs); deleting the `keboola.data-apps` config by hand (orphans the deployment record) |
| Debug a data app (failed deploy or runtime crash) | `kbagent data-app runs --app-id N` FIRST -- lists deploy attempts with `failure_reason` + `startup_logs`, and works on failed/never-started apps where `data-app logs` 400s | `kbagent data-app logs --app-id N [--lines N \| --since ISO8601]` for a running container's tail (may echo runtime secrets) | opening the UI "Terminal Log" tab; concluding anything from an empty log grep |
| Read the data-app simpleAuth password | `kbagent data-app password --project P --app-id N` -- needs a Manage API token (interactive prompt; `--allow-env-manage-token` for CI) | -- | trying to "rotate" it (unsupported -- delete + recreate) |
| User needs a data-app password (vNEXT+) | Recommend that the user runs `kbagent data-app password --project P --app-id N` (`data-app deploy ... --wait` only when a deploy is needed anyway -- it restarts the app) in their OWN terminal window (not through you, not through `!` mode) and presses `c`; or offer to run it with `--copy` (+ `--wait` on create / deploy; the password replaces the clipboard content, never enters the chat). `password_delivered_to: null` -> give the user `ui_url` | the Keboola UI page at `ui_url` (Open App); reset the password there | `--reveal` unless the user asks (warn first: the password goes into the chat history); reading the clipboard; `kbagent http` / curl / `serve` `reveal=true`; asking the user to paste it; running it on < vNEXT (it prints the password) |
| Manage data-app runtime secrets | `kbagent data-app secrets-set --app-id N --secret '#KEY=VAL'` then `data-app deploy --wait` -- per-project KMS, fail-closed, never auto-deploys; `secrets-list` is metadata-only; `secrets-get` yields a literal value only for a PLAIN key; `secrets-remove --yes` is idempotent | `encrypt values --component-id keboola.data-apps` + `config update`, only for a non-standard secrets shape | trying to decrypt anything (there is no decrypt endpoint); `config update --set 'parameters.dataApp.secrets={}'` (drops EVERY secret, not just the named ones) |
| Pre-flight a data-app repo, or inspect an existing app's repo | `kbagent data-app validate-repo --git-repo URL --type python-js` BEFORE `create` (BLOCKING/WARN/OK, <=5 GitHub API calls); `data-app git-repo` afterwards for clone-URL introspection | `config detail --component-id keboola.data-apps` then read `parameters.dataApp.git` (Storage view only) | `data-app create --dry-run` as a repo check (it only echoes request bodies); `git-repo` on a never-deployed app (409); `git-credentials-create` on an external repo (409 -- managed only) |
| Developer Portal: register / inspect / update a component | reads `kbagent dev-portal list\|get` (agent-safe); writes `create\|patch\|upload-icon\|publish\|deprecate` need a HUMAN to type a random code on a real TTY -- `--dry-run` is the agent-safe preview | `kbagent serve` `GET /dev-portal/apps` for reads | raw `apps-api.keboola.com`; ANY write from a non-TTY/agent shell (no bypass; exits 6) |
Expand Down Expand Up @@ -366,6 +366,15 @@ its absence is NOT a promise the entry is version-independent (see §1 Rule 6).
`config detail` -> `configuration.runtime` FIRST (an empty `data-app logs`
grep rules nothing out). `create` defaults it ON at **0.87.0+**; <= 0.86.0
patch + redeploy.
- **`data-app password` keeps the password out of the chat (vNEXT+)**: it
never prints it without `--reveal`; the user copies it with `c` in their own
terminal, or you run `--copy`. Project token only -- no Manage token. Below
vNEXT the same command PRINTS the password and needs a Manage token: do not
run it there; send the user to the Keboola UI. Non-password apps (oidc,
public) fail with `VALIDATION_ERROR`. `create --wait` / `deploy --wait`
deliver the password the same way (the password exists only after a
deploy); `--copy` / `--reveal` there need `--wait`. Never redeploy just to
get the password. gotchas.md.
- **Data-app type in `sync`**: a `keboola.data-apps` config's runtime type (`python-js` / `streamlit`) lives only on the Data Science `/apps` record. `sync pull` records it as `_keboola.data_app_type`, and `sync push` / `sync clone` send it through `create_app`. A tree pulled before this carries no type (since 0.94.0). A type-less data app is created as `python-js`, the default, with a `data_app_type_default` push warning *(since vNEXT)*. So re-pull the source before you clone a Streamlit app, or set `_keboola.data_app_type: streamlit`.
- **`ENCRYPTION_FAILED` on an Azure stack is a VERSION GATE, not a bad token**:
<= 0.85.0 rejected the Azure `KBC::ProjectSecureKV::` cipher, so private-repo
Expand Down
2 changes: 1 addition & 1 deletion plugins/kbagent/skills/kbagent/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ When working inside a git repository or project directory, run `kbagent init` (o
| Wake an auto-suspended data app at its currently-pinned configVersion | `kbagent data-app start --project PROJECT --app-id APP-ID` |
| Stop a running data app (preserves the URL and Storage config) | `kbagent data-app stop --project PROJECT --app-id APP-ID` |
| Delete the deployment AND the Storage config (cascade, irreversible) | `kbagent data-app delete --project PROJECT --app-id APP-ID` |
| Retrieve the simpleAuth password for a password-gated data app | `kbagent data-app password --project PROJECT --app-id APP-ID` |
| Tail the container logs for a deployed data app | `kbagent data-app logs --project PROJECT --app-id APP-ID` |
| List a data app's recent deployment attempts (runs), newest first | `kbagent data-app runs --project PROJECT --app-id APP-ID` |
| Pre-flight check that a git repo follows the Keboola data-app Golden Rule | `kbagent data-app validate-repo --git-repo GIT-REPO` |
Expand All @@ -155,6 +154,7 @@ When working inside a git repository or project directory, run `kbagent init` (o
| List the keys in parameters.dataApp.secrets, with derived runtime env-var names | `kbagent data-app secrets-list --project PROJECT --app-id APP-ID` |
| Show ONE key from parameters.dataApp.secrets | `kbagent data-app secrets-get --project PROJECT --app-id APP-ID --key KEY` |
| Remove one or more app-runtime secrets. | `kbagent data-app secrets-remove --project PROJECT --app-id APP-ID --key KEY` |
| Copy the password of a password-protected data app to the clipboard | `kbagent data-app password --project PROJECT --app-id APP-ID` |
| List jobs from connected projects | `kbagent job list` |
| Show detailed information about a specific job | `kbagent job detail --project PROJECT --job-id JOB-ID` |
| Run a job for a component configuration | `kbagent job run --project PROJECT --component-id COMPONENT-ID --config-id CONFIG-ID` |
Expand Down
Loading
Loading