PRDCT-490: new top-level CLI section — kbagent#1015
Conversation
…agent) New section for kbagent, Keboola's agent-friendly command-line interface (github.com/keboola/cli) — distinct from the legacy Keboola-as-Code kbc. Overview (what it is, why, who for, how it relates to MCP/AI Kit/Kai) and getting-started (install, connect single/org, doctor, first commands). Install + version + doctor output verified locally (v0.66.0). Nav: new top-level CLI group after Transformations. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- commands: the command groups (project/config/job/storage/flow/sync/ branch/workspace/agent/…) verified against v0.66.0 kbagent --help. - workflows: dev branches, GitOps sync, storage files, encryption, the --deny-writes/--deny-destructive firewall (verified), + real use cases. - for-agents: Claude Code plugin + /keboola subagent, read-only sandboxing, kbagent context, conversation ID. Facts not verifiable without auth flagged VERIFY(owner). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Point the overview 'Keboola CLI' section and the AI tooling pages at the new /cli/ section; keep the legacy Keboola-as-Code link (different tool). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Replaced illustrative examples with real read-only output captured against project 264 (L0 - Shopify), all via --deny-writes: - getting-started: connected doctor (all PASS), real job list, and the global-search-not-enabled -> --search-type config-based behavior. - commands: real config-based search result + a --json project list block showing machine output. Write/create commands (job run, workspace from-transformation) stay flagged VERIFY — not executed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Screenshots covering the key steps so a reader sees how kbagent works: - Terminal (real output rendered with charmbracelet/freeze, project 264): doctor-connected in getting-started, job list in getting-started, config-based search in commands. - New page cli/web-ui.md: the optional 'kbagent serve --ui' browser dashboard, with real screenshots (dashboard / configs / jobs) captured from the running Web UI against project 264. Nav entry added. All from the dummy-data demo project; no real-customer data. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Per review — pages were thin and the split wasn't cleanly Diátaxis. Restructured into a linear sequence, one type per page, each fuller: - Overview (hub + tool comparison + map) - Get Started (tutorial: numbered first run + multi-project/org) - How It Works (NEW concepts page: connection/config model, multi-project, dev-branch propagation, GitOps, permission firewall, agent-first design) - How-to Guides (recipe-structured: org onboard, dev branch, GitOps, audit, job monitor, CI/CD tokens, encrypt, safe/sandboxed run) - Use with AI Agents - Command Reference (fuller: global flags, every group + real subcommands verified against v0.66.0, error-code categories) - Web UI Each page ends with a Next/Related link so the set reads in order. Screenshots preserved. Nav reordered to match the sequence. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Overview: expanded from a stub into a real landing page (what you can do, in one minute, why a CLI vs the UI, section map). - Get started: per-OS install (macOS/Linux curl, Windows PowerShell uv, any-OS uv, uvx one-off) so Windows users aren't stuck; Windows/uvx lines flagged for owner confirmation. - For AI agents: Claude Code plugin install is now a prominent callout; noted it installs via marketplace command (not a downloadable file), and code blocks already have copy buttons. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Install step is now interactive macOS/Linux/Windows tabs (Starlight <Tabs syncKey='os'>) instead of stacked subsections — pick your OS, see the matching commands. Code blocks inside the tabs keep syntax highlighting + copy buttons. Enables MDX site-wide to allow the component: added @astrojs/mdx (already present transitively) after starlight() in astro.config so expressive-code still applies; getting-started.md -> .mdx with HTML comments converted to MDX. Build + audit clean; markdown-remark pin unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
padak
left a comment
There was a problem hiding this comment.
Review: CLI section vs. kbagent v0.66.1 source
I reviewed the rendered preview (Vercel) and cross-checked every factual claim against the actual kbagent source at keboola/cli HEAD (v0.66.1). Overall this is accurate and well-structured — the vast majority of claims check out against the code, including several the author flagged as unverified. Below: 4 factual fixes, answers to the open TODO(human-review) / VERIFY(owner) markers (most can now be resolved), and a few nits.
Factual fixes needed
-
web-ui.md— "kbagent prints the local URL (defaulthttp://127.0.0.1:8001/) and opens it"
kbagent serve --uidoes not auto-open a browser — there is nowebbrowsercall anywhere on the serve path (onlylineage serveropens a browser). The port, the HttpOnly session cookie, and localhost-only default are all correct. Fix: "…prints the local URL (defaulthttp://127.0.0.1:8001/) — open it in your browser." -
commands.md— "kbagent defines ~52 codes across 14 categories"
TheErrorCodeenum currently has 66 members; the linkeddocs/error-codes.mdlists 46 (it has drifted — we'll regenerate it on the CLI side, tracked separately). The 14 categories are right. Recommendation: drop the number entirely ("kbagent defines stable string codes across 14 categories … the full list is indocs/error-codes.md") so this page can't go stale the same way. -
getting-started.mdxStep 4 —kbagent config list # configurations in the default project
Without--project,config list(andjob list) fan out across all connected projects, not the default project —resolve_projects(None)returns every connection. With one project connected the output is identical, but the comment teaches the wrong mental model (and contradictsconcepts.md, which correctly says reads fan out). Suggest:# configurations across all connected projects. -
workflows.md"Work in a development branch" —kbagent sync branch-link --project analytics
branch-linkrequires a sync workspace initialized in git-branching mode; outside one it fails withGit-branching mode is not enabled. Run 'sync init --git-branching' first.Add the prerequisite (kbagent sync init --project analytics --git-branching, inside a git repo) or link the GitOps recipe. Bonus worth stating: with no--branch-id/--branch-name, it maps the current git branch name to a same-named Keboola branch, creating it if absent — that's the whole point and currently implicit.
Answers to the open TODO/VERIFY markers (verified against source)
- Plugin install string (
for-agents.md):/plugin install kbagent@keboola-agent-cliis correct — marketplace name iskeboola-agent-cli(.claude-plugin/marketplace.json), plugin namekbagent. The/keboola→keboola-expertsubagent description is accurate too. VERIFY(owner) can be removed. - Single-project token type (
getting-started.mdxStep 2): a Storage API token is correct and sufficient for browsing. Worth one added sentence: some commands need an admin (master) token — e.g.token createrequirescanManageTokens, and branch/workspace creation needs admin privileges. org setupflags (getting-started.mdx,workflows.md): all verified correct —--allow-env-manage-tokenis required to readKBC_MANAGE_API_TOKEN(default-deny since 0.29.0, not 0.28.0 as the hidden comment says), and--org-id/--project-ids/--yesare all real. Note--token-expires-inlives onproject refresh, not onorg setup.config searchflags (workflows.md):--query/--ignore-casecorrect; cross-project fan-out when--projectis omitted confirmed. VERIFY can be removed.token create/refresh(workflows.md): correct —--expires-inis seconds (omit = never expires), secret shown once,token refresh --token-idrotates. VERIFY can be removed.encrypt values(workflows.md): the required flags are--component-id IDand--input JSON|@file|-. Suggest completing the example:kbagent encrypt values --project prod --component-id keboola.ex-db-snowflake --input '{"#password": "secret"}'.branch create/branch merge(workflows.md): both claims verified correct —branch createauto-activates the new branch, andbranch mergegenerates the KBC UI merge URL (it also resets the active branch back to main afterwards, which might be worth a half-sentence).- uvx invocation (
getting-started.mdx):uvx --from 'git+https://github.com/keboola/cli' kbagentis the right form; the console entry point iskbagent. - Windows (
getting-started.mdx):install.shis bash-only, so the uv-in-PowerShell path is the right recommendation. TODO can be resolved. --versionoutput:kbagent v0.66.0format confirmed (typer.echo(f"kbagent v{__version__}")).
Verified correct (spot-checked against source — no action)
Global-flags table including the exact firewall semantics (--deny-writes spans write+destructive+admin; --deny-destructive deliberately leaves admin/write allowed — matches permissions.py); macOS config path via platformdirs and the .kbagent/ walk-up precedence; init --from-global --read-only (exists, and read-only also chmods the config); config delete (exists); search defaulting to Global Search with the --search-type config-based fallback; serve port 8001 / HttpOnly cookie / localhost-only; KBAGENT_CONVERSATION_ID → X-Conversation-ID header; doctor reporting plugin installation; the {"status": "ok", "data": …} JSON envelope and the project list example keys; the four example error codes; install.sh at repo root; the keboola-cli[server] extras install line (matches README; --force for reinstall is a good touch).
Nits
- Sidebar labels (
src/sidebar.mjs): entries are bare slugs, so Starlight falls back to full page titles — the sidebar reads "Get started with kbagent / How kbagent works / kbagent how-to guides / kbagent command reference / kbagent Web UI" (five "kbagent"s)._data/navigation.ymlalready defines the short titles (Get Started / How It Works / How-to Guides / …); adding matchinglabel:s insidebar.mjswould align the two. concepts.mdconfig path: only the macOS path is given. Add the Linux one (~/.config/keboola-agent-cli/config.json) or note thatkbagent doctorprints the active path.overview/index.md: the whole file shows as rewritten because of a CRLF→LF normalization; the only content change is the Keboola CLI subsection. Fine to keep, but worth one line in the PR description so reviewers don't hunt through 177 changed lines.getting-started.mdx"(auto-updates, version-pinnable)" next to the uv install: the auto-update is kbagent's own startup hook and applies toinstall.shinstalls equally — the parenthetical reads as a uv feature.commands.mdagentgroup: consider addingrun-detail,run-events, andprompt-improveto the list (all exist).
Nice work overall — especially the discipline of flagging unverified claims inline instead of shipping guesses; nearly all of them turned out to be correct.
Tone & positioning feedback (separate from the factual review above)The section is accurate and well-organized, but it reads as a reference, not as "I have to try this." The copy is safe — and it undersells the capabilities that are objectively unique. This isn't a request for marketing adjectives; the tone should stay sober (it's help docs). The opportunity is to surface the genuinely differentiating features, which are currently buried in lists. Ordered by impact: 1. The hero story is buriedThe overview opens with "one tool to manage all your Keboola projects from the terminal" — a generic CLI pitch. The actual differentiator appears halfway down the page: hand your whole org to an AI agent, safely. No other data-platform CLI is agent-first; that should be the first paragraph. Something like:
2. The coolest feature is one word in a bullet listThe 3. Lineage is a demo-able wow with six words of coverage
4. The recipes lack a story with scaleThe Goal → commands → Result format in
That's precisely the thing the UI can't do, and it justifies the whole section's existence. 5. Smaller opportunities
|
…c in check-error-codes (#490) docs/error-codes.md had drifted 20 codes behind the ErrorCode enum (missing all Data Apps, Developer Portal, Flow, serve-envelope, and newer Sync/Auth codes). The doc is publicly linked from the new help-docs CLI section (keboola/connection-docs#1015), so completeness now matters. - Add the 20 missing codes to their category sections; new sections: Flow, Data Apps, Developer Portal. DATA_APP_INVALID_REPO and DATA_APP_REPO_VALIDATION_BLOCKING are marked reserved (defined in the enum since 0.28.0 but not currently emitted; validate-repo signals via exit 1). - Extend scripts/check_error_codes.py (make check-error-codes) with an enum-vs-doc completeness check: every ErrorCode member must appear in the doc and vice versa, so the doc cannot silently drift again. --list now reuses the shared enum parser. - Tests: TestErrorCodesDocCompleteness in tests/test_integration.py (doc matches enum; missing-code and stale-code drift both detected).
…kers, tone pass Factual (per review 4734182992): serve --ui doesn't auto-open the browser; error-code count dropped (enum drifts); config list fans out across all connected projects; branch-link needs sync init --git-branching and maps the current git branch by default. VERIFY/TODO markers resolved per owner verification (plugin string, token types, org setup flags incl. 0.29.0 default-deny, config search, token create/refresh, encrypt values example, uvx, Windows). Only Jordan's legacy-CLI-timeline TODO remains. Tone (comment 5021425109): agent-first hero on the overview; new recipes — scheduled AI agents (cron), fix-a-config-everywhere capstone, workspace SQL debugging; lineage gets its own reference bullet; kai ask surfaced; "In one minute" ends on the result. Sidebar labels via frontmatter sidebar.label (survives gen:sidebar). New runnable examples fact-checked against keboola/cli source; required flags added (agent create --name, workspace --component-id/--workspace-id, kai ask -m). Lineage/GIF assets tracked as a follow-up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@padak thanks for the source-level review — applied in 27ec0d8. Rundown: Factual fixes (all 4):
Open markers: all VERIFY/TODO resolved per your verification (plugin string, token types + new admin-token sentence, org setup flags with the 0.29.0 correction, config search, token create/refresh, encrypt values completed with your example, uvx, Windows). Only Jordan's legacy-CLI-timeline TODO remains — that one's his call. Nits: sidebar labels fixed via frontmatter Tone comment — applied the text parts:
New runnable examples were fact-checked against the source before pushing — that pass added the required flags your review didn't cover verbatim: Follow-ups (not in this PR): lineage HTML-graph screenshot and an asciinema/GIF of Claude Code driving kbagent (needs a live run against the demo project) — will land as a separate PR; Build clean (265 pages), audit: 0 new broken links / 0 missing images. 🤖 Generated with Claude Code |
keboola-pr-reviewer-bot
left a comment
There was a problem hiding this comment.
Verdict: needs_human (risk 3/5) · profile docs
New CLI docs section that changes build config, site navigation, and makes many author-flagged-unverified product claims — needs human review.
Concerns:
astro.config.mjs: Build config changed: adds @astrojs/mdx integration affecting how the site builds._data/navigation.yml: Navigation/structure data changed: new top-level CLI group in nav and sidebar.mjs.src/content/docs/cli/getting-started.mdx: Unverified product-behaviour claims; author-flagged auth facts and command flags not confirmed.- + 1 more concern — see Check Run summary.
Suggested reviewers: @keboola/docs
Re-review of 27ec0d8 — all prior points addressed; 3 broken commands in the new agent recipeVerified the update against the preview and the CLI source again. All 4 factual fixes, the TODO/VERIFY resolutions, the nits (the frontmatter One new issue: the Schedule an AI agent recipe has three commands that exit 2 as written (
Corrected block: kbagent agent create --name "Weekend triage" --type ai_agent \
--cli claude --cron "0 6 * * 1" \
--prompt "Review the weekend's failed jobs and post a triage summary"
kbagent agent run <task-id> # run it once right now (create prints the ID)
kbagent agent list # what's scheduled
kbagent agent runs <task-id> # past runs (drill in with run-detail / run-events)One operational caveat worth a sentence in the recipe's result: scheduled firing requires Tiny follow-up on the error-codes paragraph in |
…eenshot agent create gets required --cli claude; agent test (ad-hoc only) replaced with agent run <task-id>; agent runs takes the task ID; result notes that scheduled firing needs kbagent serve running. Error-codes paragraph drops the category count too (17 incoming via keboola/cli#490). Adds the interactive lineage-browser screenshot (demo-project pipeline: extractor tables -> two transformations -> BDM outputs) to the lineage reference bullet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…CT-359-cli-section
|
@padak fixed in 39b761d — thanks for catching the agent recipe before a reader did:
Bonus in the same commit: the lineage browser screenshot you suggested is in — the demo project's pipeline (extractor tables → two transformations → BDM outputs, 15 nodes) on the Build clean, preview rebuilding. 🤖 Generated with Claude Code |
padak
left a comment
There was a problem hiding this comment.
Verified 39b761d against the CLI source and the rebuilt preview: the agent recipe now runs as written (--cli claude present, agent run/runs take the task ID, the kbagent serve requirement for scheduled firing is stated), the error-codes paragraph has no counts left to drift, and the lineage screenshot renders (HTTP 200 on the preview). All findings from the source-level review, the tone pass, and both delta re-reviews are addressed. Approving.
|
@padak - WDYT about figuring out how to keep the kbagent docs as the canonical source of truth? I.e. should we slightly modify the docs in your repo so we can borrow them more directly instead of duplicating them? My fear is that it will get outdated quickly. |
@claude - Can you review this PR from this perspective? What are our options to not be duplicating content? |
|
@jordanrburger Good instinct — the drift fear is justified (my review of this PR caught exactly that kind of drift in the other direction: the CLI repo's own
One honest correction to "borrow from the CLI repo"The CLI repo's docs ( Options considered
Proposed mechanismCLI side (keboola/cli — I'll file the issue and can build it):
Docs side (connection-docs):
What stays canonical where: the CLI repo remains canonical for facts (code, generated reference, error codes — updated in the same PR as the code, which is the whole point of keeping docs next to code); connection-docs remains canonical for the end-user narrative (concepts, recipes, positioning). Prose duplication between the two is fine when the audiences differ — it's only facts that must never be written twice, and the mechanism above makes every fact either generated or CI-checked. Near-term: I'd ship this PR as-is (approved) — it's accurate today and the freshness risk starts at the next CLI release, which is exactly when the generator + auto-PR loop should be in place. I'll open the keboola/cli issue for the generator and link it here. |
|
Generator issue filed as promised: keboola/cli#498 (introspect the Typer app → |
|
Update: the generator is implemented, not just filed — keboola/cli#500 (closes keboola/cli#498). It introspects the Typer command tree and the release workflow attaches |
…yper app (#498) (#500) * feat(release): generate command-reference.md release asset from the Typer app (#498) The CLI's command reference exists only as hand-maintained copies (kbagent context, CLAUDE.md, commands-reference.md, and now the help.keboola.com CLI section from keboola/connection-docs#1015) -- every one a documented silent-drift risk. This adds the zero-drift source: a generator that introspects the live Typer/Click command tree, so the output cannot disagree with the shipped CLI. - scripts/gen_command_reference.py: walks the command tree (duck-typed via commands/repl._is_group -- Typer >=0.25 vendors Click, so isinstance against plain click classes fails), emits deterministic markdown: global options, one section per group, per-command option tables with required markers. Hidden commands/aliases (sl) are skipped, matching check_command_sync.py. 238 commands / 27 groups at v0.70.1. - release.yml: after the wheel build, generate the reference FROM the built wheel (uv run --no-project --with dist/*.whl) and upload command-reference.md as a release asset next to the wheel, so consumers fetch it pinned to a released version. - Makefile: gen-command-reference target. - cli.py: fix --allow-env-manage-token help text: default-deny shipped in 0.29.0, not 0.28.0 (changelog is authoritative) -- this exact string was the source of a wrong version in the help-docs PR. - tests/test_gen_command_reference.py: determinism, completeness cross-checked against check_command_sync.collect_commands(), required markers, hidden-alias and --help exclusion, version header. Closes #498. * fix(release): address Devin review -- backfill-safe workflow + dataclass walker 1. release.yml: the job checks out the release tag, so a workflow_dispatch backfill of a tag predating scripts/gen_command_reference.py would fail the generation step and block the wheel upload (the documented purpose of the manual trigger). The step now skips cleanly when the script is absent, and command-reference.md uploads only when actually produced. 2. gen_command_reference.py: _walk returned a bare 3-tuple against the CONTRIBUTING.md multi-value-return rule; replaced with a frozen LeafCommand dataclass. Output byte-identical. 3. Test loader registers the script module in sys.modules before exec -- @DataClass under 'from __future__ import annotations' resolves its module namespace via sys.modules at class-creation time.
How the zero-drift loop works now that keboola/cli#500 is mergedFor @jordanrburger and @Iamfle4ka — here's exactly what happens per release and what this repo can wire against it. What the CLI side now does automatically (shipped)On every published release of keboola/cli, the release workflow checks out the exact tagged commit, builds the wheel, and runs the new generator against that built wheel — introspecting the same Typer command tree that renders
Content: global options, every visible command group (27 today), every command (238 today) with an option table incl. required markers. Hidden aliases are excluded. Output is deterministic, so diffs between releases read as clean changelogs ("v0.71.0 added What this repo can wire against it (proposed, not yet built)A scheduled action that keeps a committed copy in sync and opens a reviewable PR when a release changes it — no silent drift, no manual copying: # .github/workflows/sync-cli-reference.yml
name: Sync kbagent command reference
on:
schedule: [{ cron: "0 7 * * *" }]
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
permissions: { contents: write, pull-requests: write }
steps:
- uses: actions/checkout@v5
- name: Fetch latest released reference
run: |
curl -fsSL -o /tmp/command-reference.md \
https://github.com/keboola/cli/releases/latest/download/command-reference.md
- name: Open PR if changed
uses: peter-evans/create-pull-request@v7
with:
add-paths: <wherever the imported copy lives>
branch: sync/cli-command-reference
title: "sync: kbagent command reference from latest release"
commit-message: "sync: kbagent command reference from latest CLI release"Design decisions that are yours to make on this side:
What stays hand-written (deliberately)The narrative pages (overview, concepts, recipes, for-agents) — different audience, slow drift. The generated asset covers the one content class that drifts every release: command signatures. For the narrative pages the guard is the periodic fact-check (the thing this PR's review did manually); that can be a follow-up freshness job here or on the CLI side. Happy to draft the sync workflow as a PR against this repo once you pick option (a) or (b). |
|
First command reference https://github.com/keboola/cli/releases/tag/v0.71.0 |
- getting-started: inline token how-to (Project Settings -> API Tokens -> New Token) + live screenshot from demo project 264; tokens concept page demoted to a trailing details link (PRDCT-575) - new /cli/troubleshooting/ page: 10 likely failures, symptom -> cause -> fix, with --json error codes; wired into nav + cross-linked from getting-started and the commands error-codes section (PRDCT-576) - concepts: editable "how it works" SVG diagram (actors -> kbagent with config store and serve -> permission firewall -> stacks) (PRDCT-577) - install: curl script marked Recommended on macOS/Linux, uv on Windows; landing aligned; provisional pending Padak's canon call (PRDCT-578) All kbagent invocations pass the CLI reference gate (v0.76.1, 0 findings after it caught a missing required --project on sync init); fact-checked vs keboola/cli (29 claims confirmed, incl. serve powering cron agents). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Jerabek's review applied (
Item 1 of his review (per-command generated reference at Stripe/GitHub-CLI level) is tracked as PRDCT-557 — its own PR after this one merges, rendering the auto-synced Verified: build clean (266 pages); audit at baseline; every |
New section: the kbagent CLI
Adds a top-level CLI section for kbagent (
github.com/keboola/cli) — Keboola's agent-friendly command-line interface. Help docs previously had no CLI section, only outbound links to the legacy Keboola-as-Code CLI on developers.keboola.com. kbagent is a different, newer tool; the legacy links are kept (that tool is still supported).Pages (
src/content/docs/cli/)uv tool install), connect single project / whole org,doctor, first commands./keboolasubagent, read-only sandboxing,kbagent context, conversation ID.Verified live (locally, kbagent v0.66.0)
--version,--help(all command groups), per-group--help, anddoctor(pre-auth) — real output captured. The firewall flags (--deny-writes/--deny-destructive) and command-group structure are verified against v0.66.0.Flagged for owner review (
TODO(human-review)/VERIFY(owner))Auth-dependent facts (single-project token type, org-setup flags), exact flags on
job run/config search/workspace from-transformation, the plugin install string, and the legacy-CLI deprecation timeline. Real output of authenticated read-only commands (project/config/job list against a demo project) still to be captured — the CLI needs a token, which the author will supply locally.Nav
New top-level CLI group after Transformations. Section name "CLI" is a default — open for Jordan.
Verification
npm run buildclean (263 pages, +5);node scripts/audit-phase2.mjsMISSING IMAGES 0, no new broken links.Draft — do not merge.
🤖 Generated with Claude Code