/selise-blocks:blocks-bootstrapfrom selise-blocks
Bootstraps a new SELISE Blocks user from zero to working setup using the blocks CLI. Detects auth/project state and routes to login, project selection, OIDC client setup, social IdP, user creation, or app scaffolding.
Ships in selise-blocks. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Every other Blocks skill assumes three things are already true: the blocks CLI is installed, the user is logged in, and a project is selected. This skill establishes those, then routes to whichever flow the user actually needs.
It ends at one user can log into the app. Ongoing user administration after that belongs to blocks-iam-users, blocks-iam-account, and blocks-iam-organizations.
Everything here goes through blocks. Never a raw fetch/curl against a Blocks API, and never a workaround that skips the CLI's confirmation and dry-run discipline.
not_logged_in, project_not_selected, api_auth_failed, or refresh_token_rejected.x-blocks-key and expects you to pick that project up.Once the CLI is logged in, a project is selected, and the user is asking for a specific capability (data schemas, localization, mail, storage, roles), that capability's own skill owns the work — hand off rather than continuing here.
Minimum CLI version: 0.11.0. Every Blocks skill is checked against this version of blocks or newer; an older CLI is missing commands and flags they cite.
Run all four before asking the user anything. None of them mutates, and none prints a token value. (npm view is a public registry lookup; if it fails offline, continue without the comparison.)
blocks --version
npm view @seliseblocks/cli-os version
blocks auth status --json
blocks doctor --json
auth status reports only existence and freshness — missing, expired, valid, or available (present, but with no recorded expiry) — for four tokens:
{ "accountAccessToken": "expired", "accountRefreshToken": "missing",
"projectAccessToken": "expired", "projectRefreshToken": "valid" }
The resolved account persists one exclusive mode: account AT+RT, or one project's AT+RT. Missing account tokens while the project pair is valid is normal project mode, not a broken login. Read it like this:
| Signal | State | Do this |
|---|---|---|
blocks --version fails with command not found | CLI not installed | Ask before installing npm install -g @seliseblocks/cli-os@latest, then re-probe |
blocks --version is below the minimum CLI version above | CLI too old for these skills | Tell the user both versions and ask confirmation to run npm install -g @seliseblocks/cli-os@latest; never update without a yes. If they decline, say plainly which skill steps may fail, and don't work around a missing command |
blocks --version is behind npm view @seliseblocks/cli-os version | CLI outdated | Tell the user both versions and ask confirmation to run npm install -g @seliseblocks/cli-os@latest; never update without a yes. If they decline, continue on the old version and expect missing commands/flags/defaults relative to these skills — name the gap instead of silently working around it |
All four tokens missing | No login in this resolved context | Local: blocks login --account <name>; Studio: report missing launcher bootstrap/context |
| Account AT and RT valid/available; project pair missing | Account mode | List/select a project or perform an account-only operation |
accountAccessToken expired, accountRefreshToken valid | Recoverable | blocks auth refresh --json, then re-probe |
| Project AT and RT valid/available; account pair missing | Project mode | Ready for project commands |
projectAccessToken expired, projectRefreshToken valid/available | Recoverable project mode | blocks auth refresh --project --json, then re-probe |
| An access token exists but its matching refresh token is missing | Non-refreshable session | Re-login locally; in Studio, report failed/expired bootstrap |
Any token available | Present, expiry unknown — treat as usable but unproven | Continue; on api_auth_failed, re-login explicitly locally or report Studio bootstrap failure |
| Account mode, no project selected | Needs a project | flows/project-selection.md |
| Project mode and intended project selected | Ready | Confirm the project with the user, then route below |
A selected project does not prove a usable session. Selection is metadata;
project mode is usable only when its project token pair is present. Do not
require an account pair simultaneously: impersonation replaces it, and
blocks deselect exchanges the project pair for a fresh account pair.
From CLI 0.3.2 onward, any command may print an Update available notice on stderr, and blocks doctor --json reports cliUpdateAvailable. Treat either exactly like the version comparison above: inform the user, ask for confirmation, and only then update.
Use blocks doctor --json when something looks broken rather than merely undone — it checks Node version, credential storage backend, account and project token freshness in one pass. Its detail fields include the paths of the CLI's config and secret files. That is diagnostic output, not an invitation: never open, read, print, or quote those files. Interact with them only through blocks commands.
If credential storage itself is unreadable or corrupted (machine migration,
Windows profile change, Keychain reset), run blocks auth remove <account>, then
blocks login --account <account> locally. Never copy credentials from another
account or config directory.
Do not set BLOCKS_CONFIG_DIR for ordinary local work. Reuse the user's normal
OS-scoped CLI context and interact with it only through blocks commands. Probe
first. If no account is active in a non-interactive run, ask which account to
use; never pick another configured account. Run device login yourself with an
explicit name, relay the verification URL/code, and keep the process running
while the user approves it:
blocks login --account <name>
blocks auth status --account <name> --json
If the user supplied a tenant, use it. Otherwise list projects and ask before
changing selection. Once known, AI automation should pass both contexts
explicitly even though interactive local use may rely on activeAccount:
blocks use <tenantId> --account <name>
blocks <command> --account <name> --project <tenantId> --json
Use a temporary BLOCKS_CONFIG_DIR only when the user explicitly asks to test
isolation or a package build. A new directory is intentionally unauthenticated;
never copy the user's normal tokens into it.
The launcher, not the agent, owns installation, isolation, and authentication
bootstrap. Never unset, replace, or guess BLOCKS_CONFIG_DIR. Start with
blocks auth status --json. If context/auth is missing, report that the Studio
session was not bootstrapped; do not fall back to OS state, inspect storage, or
copy credentials from another session. Device login is acceptable only when the
Studio product explicitly supports user approval for that isolated session.
Fully unattended Studio startup requires a launcher/backend bootstrap feature;
the current CLI does not provide one.
If the user has never used SELISE Blocks at all, they need an account before this will work. Send them to https://os.seliseblocks.com to sign up, wait for them to confirm the account exists, then log in. Do not run blocks login first and let them discover the problem at the verification page.
blocks login --account <name>
The CLI authenticates itself with no setup: there is nothing to register in a portal first, no client id or secret to collect from the user, and nothing about how it authenticates to look up or report. It prints a verification URL and user code, opens the browser to the verification page when it can, then polls until authorized and stores account tokens that refresh themselves afterwards.
Run it yourself rather than only telling the user to run it, so you can read the printed code and URL back to them and confirm the result. Verify with blocks auth status --json afterwards — do not assume it worked.
For "log me out of Blocks", run blocks logout for the resolved account. It revokes the current refresh token where possible and clears that account's local session data from the resolved config store. In automation, pass --account <name> explicitly; never log out a different configured account. Verify with blocks auth status --account <name> --json.
| Situation | Go to |
|---|---|
| No project selected — the user gave a key, needs to choose one, or has none yet | flows/project-selection.md |
| Project selected, and the user wants to know what is already set up in it | flows/existing-project.md |
| Nobody can log into the app — OIDC client, identity provider, or OIDC not enabled | flows/oidc-client.md |
| The user asked for Google, Microsoft, or other social sign-in | flows/social-idp.md |
| Login is configured but no end user exists yet | flows/first-user.md |
| Building a frontend from scratch | flows/new-web-app.md |
| An existing frontend needs to talk to Blocks | flows/existing-app.md |
A user starting from nothing usually walks it in this order: project selection → OIDC client (and social provider, if they want it) → new web app → first user. Someone handed a key and asking what exists starts at project selection, then the inventory flow, and goes wherever its gap list points.
Once one user can log in, bootstrap is over. Hand off to each capability's own skill for data, localization, mail, storage, IAM, and release work, and to blocks-iam-users/blocks-iam-account for further user work.
Two skills are deliberately not on the build path — blocks new web already wires both correctly, so loading them by default is wasted reading:
blocks-iam-sso-oidc-implementation — only when hosted login misbehaves, or the user is extending the scaffolded auth flow. A scaffold whose login works needs nothing from it.blocks-frontend-local-https — only when actually setting up the local HTTPS dev loop (hosts entry, cert, dev server).npm install -g on your own initiative.x-blocks-key, use it directly. Do not show a picker, and do not list projects to "confirm" a choice they already made.--dry-run before --yes on every cloud mutation. Show the user the exact action, then wait for approval. Never add --yes to a call they have not approved.errors array as a failure even when the HTTP status is 200.blocks --version against npm view @seliseblocks/cli-os version before working around it.auth_transition_busy.| Code | Fix |
|---|---|
not_logged_in, refresh_token_rejected | Local: blocks login --account <account>; Studio: require bootstrap or explicitly supported device approval |
account_not_configured | Run blocks login --account <account> in the same resolved config store; never borrow another account |
account_not_selected | Pass --account <account> or log in that named account; never choose one silently |
account_session_suspended | Run blocks deselect before the account-only operation, then reselect when needed |
auth_transition_busy | Wait for the other CLI process using this config directory, then retry sequentially |
device_login_denied | The user denied approval; start a new login only when they ask |
device_login_expired | Re-run blocks login --account <account> and complete approval before expiry |
device_login_failed | Correct the identity-provider reason reported in message, then retry |
device_login_network_error | Restore identity-provider connectivity, then restart login |
| unreadable or stale local auth storage | Local: blocks auth remove <account>, then blocks login --account <account>; Studio: replace/rebootstrap the isolated session |
project_not_selected | blocks use <x-blocks-key>, or --project <tenantId> for one command |
project_token_tenant_mismatch | The issued project session was for another tenant and was discarded unused. Run blocks login --account <account>, then blocks use <tenantId> |
project_refresh_token_missing | Run blocks login --account <account>, then select the project again |
missing_project_name | Pass a name: blocks projects create "<name>" |
invalid_project_name | Use a project name between 3 and 100 characters |
project_create_failed | Inspect message, then run blocks projects list --json before retrying |
no_tenant_group | Pass a known --repo-id to release builds list |
api_auth_failed | blocks auth status --json, then log in again |
impersonation_invalid_client | Not a stale token. Give an admin the CLI client id printed in the error and have them register that client for project impersonation. Re-login, reselect, and AuthController config changes will not fix it. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
selise-blocks, cli-bootstrap, project-setup, auth-setup, onboarding
npx claudepluginhub selisedigitalplatforms/blocks-skills --plugin selise-blocks25 skills in this plugin
/blocksStart here for any SELISE Blocks work. Routes a plain-language request — sign-in and projects, SSO, users, roles, MFA, data schemas and records, file storage, translations, mail, notifications, workflows, functions, proxies, secrets, deployments — to the right Blocks skill, and carries the rules every Blocks skill follows: the blocks CLI and @seliseblocks/client SDK only, never raw HTTP to the platform API; --dry-run before --yes; never read the CLI's credential files; when to report a finding. Use whenever work touches SELISE Blocks, the blocks CLI, or @seliseblocks/client./blocks-captchaConfigure the login captcha of a SELISE Blocks project through the blocks CLI ('captcha list/get/save/enable/disable/delete'): register a reCAPTCHA or hCaptcha site key and secret, switch it on or off, see which configuration blocks-iam actually enforces at login, and retire one. CLI-only, project-scoped; the captcha secret is stored server-side and never shown. Use for 'enable captcha on login', 'change the recaptcha keys', 'why is captcha not showing', 'turn captcha off'./blocks-data-gateway-configurationConfigure a SELISE Blocks project's data model via the blocks CLI — never raw fetch/curl against api.seliseblocks.com. Covers data-source config (data config get/create/update), schema authoring and push (data schema list/pull/push, plus granular get/fields/info/indexes commands), data-access policies (data rules pull/deploy/policy), field-level validation rules (data validation *), and reloading so changes go live (data reload, or the composed data sync). Use for defining, editing, securing, validating, or reloading a project's DATA MODEL — schema fields, access policies, and validation rules./blocks-data-gateway-crudImplement create/read/update/delete against a SELISE Blocks project's runtime Data Gateway using the @seliseblocks/client SDK. Use data.collection(schemaName) for straightforward per-item CRUD, data.graphql() for joins or custom query shapes, and data.schemas.*/data.validations.* for schema/validation metadata. Shows how to wire CRUD into the React 18 + Vite + TanStack Query app that blocks new web scaffolds. Use whenever the user wants to read or write actual records through a Blocks Data schema from app code./blocks-data-storageBuild file and document-management features on SELISE Blocks Data: upload/download, directory trees, cursor-paginated browsing and search, file versions, rename/move/copy, soft delete/trash/restore, sharing, access policies, and inheritance. Use for attachments, file browsers, folders, shared files, permissions, or version history. Use 'blocks data files *' for terminal/admin work and @seliseblocks/client data.files/data.directories/data.objects for app code./blocks-frontend-local-httpsRun a scaffolded (`blocks new web`) Blocks app locally over HTTPS on its real project domain — required for hosted IAM login, since plain HTTP or localhost never gets the session cookie. The scaffold already automates cert generation (npm run cert, no OpenSSL needed) and HTTPS serving via vite.config.ts. Covers running that flow, trusting the cert, the hosts-file entry, and troubleshooting. Use when running a scaffolded app over HTTPS, hitting 'SSO cookie not set' / Vite 'Blocked request' errors, trusting the dev cert, or asking why local login redirects back but doesn't stay signed in.Other plugins' skills for the same job