Onboarding
Overview
Onboarding is the path Crewship takes a fresh installation through on its very first start — from an empty SQLite database to a single admin account, a configured LLM provider, and a ready-to-run first crew. It owns the moment betweencrewship start and the user’s first agent message, and is the only flow where most of Crewship’s safety rails (auth required, RBAC enforced, credentials encrypted at rest) get bootstrapped from defaults rather than from existing rows.
The flow is two-stage. Stage one is /bootstrap: a fresh instance redirects there from /login, and POST /api/v1/bootstrap creates the first admin user (idempotent — it refuses a second admin). The CLI equivalent is crewship init. Stage two is the wizard. Two surfaces drive it: the web wizard at /onboarding (app/(onboarding)/onboarding/page.tsx) is the default experience — a multi-step, auth-gated form that walks the (already-created) admin through workspace naming, LLM provider selection, and first-crew templating, shown as one setup card that widens for the crew step, where the Guide chat sits beside what has been built. The CLI mirror crewship setup (cmd/crewship/cmd_setup.go) covers headless installs and CI-driven provisioning, accepting the same inputs as flags and emitting the same final state.
Behind both surfaces the onboarding service (internal/api/onboarding.go and internal/services/onboarding.go) is the single funnel: it validates inputs, resolves the chosen LLM provider against the same resolveLLMProvider registry that the agents API uses (so a value accepted here cannot be rejected later when the first agent runs), encrypts and stores the supplied credential as an AI_CLI_TOKEN-typed credential (regardless of provider — see insertOnboardingCredential in internal/api/onboarding.go), creates the workspace + first crew rows transactionally (the admin user already exists from the /bootstrap stage), and marks setup complete.
Onboarding takes a CLI token, not a raw provider API key. For Anthropic it expects a Claude Code OAuth token (
sk-ant-oat…, produced by claude setup-token) and validateOnboardingCredential rejects a raw account key (sk-ant-api…) with a fix-it message, then probes api.anthropic.com to confirm the token works before completing. On the CLI, crewship setup takes this as --token (the older --api-key alias is deprecated)./onboarding and the bootstrap auth page redirect to the regular sign-in flow — the wizard is intentionally one-shot.
The three steps
The web wizard is one card under the Crewship lockup: the step’s title, a step bar naming the three things you decide about — Workspace, Model, Crew — the step itself, and a footer with Back, Skip setup and Continue (or Launch). ⌘↵ / Ctrl↵ continues. Each step persists what it collected before the next one opens, so a reload or re-login resumes where you left off; finished steps show as done in the step bar and can be clicked to go back. A token saved on the server is never shown again — the field reads Token saved with Replace.- Workspace — a name (at least two characters) and the language your agents reply in. A “Before you start” note tells you the two things you will need: a Claude Code CLI token from
claude setup-token, and Docker running on the server, whose check shows as a status pill (Docker detected, Docker not reachable or Checking…). - Model — the agent toolchain and its CLI token. Only Claude Code is fully supported today, so it is the one card shown; the other adapters (OpenCode, Codex CLI, Gemini CLI, Cursor CLI, Factory Droid) sit behind a “Show experimental toolchains” disclosure and cannot finish setup yet. The model list offers every curated model for the toolchain (from
config/models.json), with the catalog’s default marked recommended and older generations marked older. The token field says what you pasted before the server verifies it: ansk-ant-api…console key is flagged immediately, ansk-ant-oat…CLI token is confirmed on Continue. Also pair my CLI shows thecrewship login --paircommand with Copy and a countdown; a paired CLI that hands over the model token fills the field for you, and an expired code offers New code. Without a container runtime a banner at the top of the step blocks Continue and offers Check again. - Crew — the card widens; a conversation with Crewship Guide on the left and Built so far beside it (above it on a phone, folded). The chat opens with a short greeting and four starter prompts in your chosen language; pick one or describe the work in your own words, and the Guide proposes a crew. Nothing is created until you click Create on the proposal card. The card shows the crew’s icon and colour (the Guide picks them from the same set the crews page uses), one row per agent with its name, role and model, the extra container tools and the network access — never a summary in place of the rows. Pick a template instead is the escape hatch to the four built-in templates and Start blank; the picked template lists its agents and what it needs (the model token from step 2, the container runtime). After Launch the card shows what was built, with Go to dashboard and, when the first agent resolved, Start chatting.
Guards against dead ends
- A disabled Continue or Launch always says why, in one line beside the button (no workspace name, no container runtime, an experimental toolchain, no token, no crew yet).
- Skip setup asks first. The wizard is one-shot, so skipping lands on an empty dashboard; the confirmation says so and points at the dashboard checklist.
- If Crewship Guide cannot be reached, the Crew step switches to templates and says so, rather than showing templates with no explanation.
- The Guide is not a colleague. It lives in a crew of kind
setup, and both the crew and its agent are hidden from every roster —/crews,/agents, the chat column, the Agents facet, mention pickers and routine reach — so a fresh workspace’s/chatopens on nothing rather than on the Guide’s seeded conversation.GET /api/v1/agents?include_setup=1andcrewship agent list --include-setupare the explicit opt-in. - A reload after Create does not strand you. The “Built so far” panel reads the workspace’s real crews back; when one exists but the page no longer holds its proposal, Launch stays enabled and finishes setup through
POST /api/v1/onboarding/completewithout deploying a second crew. - Phones get the card full screen: the step bar reads “2 / 3”, the footer sticks to the bottom, every control meets the 44px touch target, and nothing scrolls horizontally.
- Loading never shows a spinner on the whole page: the card’s own skeleton appears after a second, and after ten seconds it says it is still loading and offers Retry. A failed restore shows an error card with Retry instead of a fresh wizard.
Related
- First Crew — what the wizard’s “first crew” step actually provisions.
- Credentials — how the CLI token entered during onboarding is encrypted and surfaced to agents.
- Installation — getting the binary onto the host before the wizard can run.