Skip to content

feat(cube-cli): Add onboarding command with step-by-step setup instructions - #12408

Open
paveltiunov wants to merge 2 commits into
masterfrom
pavel-claude/sweet-brahmagupta-of13m7
Open

paveltiunov wants to merge 2 commits into
masterfrom
pavel-claude/sweet-brahmagupta-of13m7

Conversation

@paveltiunov

@paveltiunov paveltiunov commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Check List

  • Tests have been run in packages where changes have been made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Description of Changes Made

Adds cube onboarding, which prints the order of operations for setting up a Cube Cloud account with the CLI: authenticate, create a deployment, connect the data source, add a data model (CLI upload, GitHub, dbt, or the data model Git workflow), build and validate, then mint an API token and connect the Cube MCP server.

The Cube Cloud "Get Started" page (cubedevinc/cubejs-enterprise#17069) hands coding agents a prompt that only says "Install Cube CLI https://docs.cube.dev/reference/cli#installation and configure our Cube account". This command is where the agent learns the steps without reverse-engineering --help.

  • The guide fills in the tenant URL whenever one is known: a saved context, --api-url or CUBE_API_URL. It skips the login step only when a token is present too, through the new Ctx::credentials(), which Ctx::api also uses. An unknown --context fails the same way it does in every other command.
  • The data model Git workflow path ends with merge-to-default and exit-dev-mode, so the build and validate step checks the deploy branch that actually got the model.
  • The GitHub path notes creationMethod: github, matching the documented flow.
  • --json returns { "url", "guide" }.
  • Every command in the guide was checked against the current clap definitions.
  • Docs: a new "Onboarding" section and command-table row in docs-mintlify/reference/cli.mdx.

Verified with cargo build, a clean cargo clippy --all-targets, and cargo test (150 passing, 5 of them for onboarding). I also ran cube onboarding with an empty config, with only CUBE_API_URL set, and with an unknown --context.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TH2SATgmsCV5uMyXhT8HaR

…ctions

`cube onboarding` prints the order of operations for configuring a Cube
Cloud account (login, deployment, data source, data model, build, MCP),
so a coding agent told to install the CLI and configure the account can
follow it instead of reverse-engineering --help.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TH2SATgmsCV5uMyXhT8HaR
@paveltiunov
paveltiunov requested a review from keydunov as a code owner October 24, 2026 02:40
@mintlify

mintlify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
cubed3 🟢 Ready View Preview Oct 24, 2026, 2:47 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions github-actions Bot added docs Issues that require a documentation improvement rust Pull requests that update Rust code labels Oct 24, 2026
@claude

claude Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @paveltiunov's task in 1m 58s —— View job


Review: changes requested. 0 high, 2 medium, 3 low. Two problems would mislead an agent that follows the guide literally.

Details

Findings (inline)

Severity Location Issue
medium rust/cube-cli/src/commands/onboarding.rs:19 The guide says "already logged in" based on the URL alone. With CUBE_API_URL or --api-url set and no token, it still says so and drops the login steps.
medium rust/cube-cli/src/commands/onboarding.rs:88 Path 4d stops at data-model commit on the dev branch and never merges. Step 5's validate then checks the deploy branch, which doesn't have the change, while build-status checks the dev branch.
low rust/cube-cli/src/commands/onboarding.rs:79 Path 4b connects GitHub to a scaffolded deployment. The documented flow creates it with creationMethod: github (docs-mintlify/reference/cli.mdx:153).
low rust/cube-cli/src/commands/onboarding.rs:117 An unknown --context silently falls back to the placeholder. Other commands bail with "context not found".
low rust/cube-cli/src/commands/onboarding.rs:6 The Args doc comment is 5 lines; the repo limit is 3.

Verified

  • Every command in the guide matches the current clap definitions: regions, deployments create --name/--region, deployments update -d, variables set ID KEY=VAL…, deploy --directory -m, github connect ID REPO --installation --branch, positional branch for data-model dev-mode, data-model put --file, validate --dev-mode, data-model commit -m, build-status --wait, deployments token, spec [PATTERN].
  • {{ escaping produces valid JSON, and a test covers it.
  • Docs: the new command is documented in docs-mintlify/reference/cli.mdx (Onboarding section plus a command-table row), so the docs requirement is met.
  • Security and performance: nothing to flag. The command is a static string plus a config read.

Testing

The 3 unit tests cover the guide() text. The URL and login resolution in command() has no tests, which is where the first and fourth findings live. A test for "URL set but no token" would have caught the first.

I did not build or run anything; this review is from reading the code.

Review threads

The listing returned 0 of my own threads, so there was nothing to resolve or re-affirm. All 5 findings were posted as new threads.

Progress

  • Read diff
  • Verify guide commands against clap definitions
  • Check review threads
  • Post review

Comment thread rust/cube-cli/src/commands/onboarding.rs Outdated
Comment thread rust/cube-cli/src/commands/onboarding.rs
Comment thread rust/cube-cli/src/commands/onboarding.rs
Comment thread rust/cube-cli/src/commands/onboarding.rs Outdated
Comment thread rust/cube-cli/src/commands/onboarding.rs Outdated
…erge, GitHub path

- Count as logged in only with both a URL and a token (shared Ctx::credentials),
  and fail on an unknown --context like every other command.
- Path 4d merges the dev branch to the deploy branch and exits dev mode, so
  step 5 checks the branch that got the model.
- Note creationMethod github for the GitHub import path; trim the Args doc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TH2SATgmsCV5uMyXhT8HaR
@claude

claude Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @paveltiunov's task in 56s —— View job


LGTM: 0 high, 0 medium, 0 low. All five fixes from the earlier review are in f10d121, and I found no new issues.

Review details
  • Read diff and changed files
  • Check guide commands against clap definitions
  • Handle prior review threads
  • Post review

Verified

  • Commands match the CLI. Every command in the guide matches its clap definition:
    • data-model dev-mode DEPLOYMENT BRANCH takes the branch as a positional argument.
    • merge-to-default -m and exit-dev-mode DEPLOYMENT take the arguments the guide gives them.
    • deployments create -d accepts the body, and --data overrides the flags, so creationMethod reaches the request.
    • build-status --wait and validate --dev-mode both exist.
  • Login state. guide now reports "already logged in" only when both a URL and a token are present (rust/cube-cli/src/commands/onboarding.rs:16). A bare CUBE_API_URL still prints the login steps and fills in the tenant URL.
  • --context check. Ctx::credentials() goes through selected_context() (rust/cube-cli/src/main.rs:79), so cube onboarding --context typo fails with the same error as every other command. Ctx::api behaves as before: a context's own token still auto-refreshes, and an explicit token still does not.
  • Docs. The new "Onboarding" section and the command-table row in docs-mintlify/reference/cli.mdx cover the command, the tenant-URL fill-in and the --json shape.

Notes (not posted inline)

  • Ctx::api now calls selected_context() twice, once directly and once through credentials(). It's a harmless config lookup.
  • Path 4d hard-codes master as the dev-mode base branch. That fits the starter project; on a deployment whose default branch is main, the user has to change it.

Tests

Not run: running cargo test needed an approval this job couldn't get. The PR description reports a clean cargo test onboarding, and the branch now has 5 unit tests.

Review threads

The listing returned 0 of my own threads, so none were resolved and none re-affirmed.

This branch was successfully deployed

1 active deployment
staging - docs-mintlify — f10d1218 Deployed Oct 24, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Issues that require a documentation improvement rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants