croct-use-cli skill
Use when driving the Croct CLI (`croct`, `npx croct@latest`): setting up Croct in a project with `croct init`, adding or removing slots and components (`croct add slot`, `croct add component`, `croct remove ...`), syncing generated types and fallback content (`croct install`, `croct update`, `croct upgrade`), editing `croct.json` or its version specifiers (`"home-hero": "1 - 3"`), authenticating (`croct login`, `croct logout`, `CROCT_API_KEY`, `CROCT_TOKEN`), running the CLI non-interactively in CI (`--no-interaction`, `--cwd`), creating API keys (`croct create api-key`), opening the admin (`croct admin`), deep links (`croct://...`, `croct open`, `enable deep-link`), or writing, testing, and publishing CLI templates (`template.json5`, `croct use`, `croct create template`, template actions such as `create-resource`, `add-slot`, `download`, expressions `${options.name}`). Also when the `SlotContent` type generated for the slot `home-hero@1` or `slots.d.ts` is stale, or default content is outdated.
- GitHub stars
- 6
- Files
- 4
- Last commit
- Nov 9, 2026
- License
- MIT
- Allowed tools
- —
What does the croct-use-cli skill do?
croct-use-cli uses when driving the Croct CLI (`croct`, `npx croct@latest`): setting up Croct in a project with `croct init`, adding or removing slots and components (`croct add slot`, `croct add component`, `croct remove ...`), syncing generated types and fallback content (`croct install`, `croct update`, `croct upgrade`), editing `croct.json` or its version specifiers (`"home-hero": "1 - 3"`), authenticating (`croct login`, `croct logout`, `CROCT_API_KEY`, `CROCT_TOKEN`), running the CLI non-interactively in CI (`--no-interaction`, `--cwd`), creating API keys (`croct create api-key`), opening the admin (`croct admin`), deep links (`croct://...`, `croct open`, `enable deep-link`), or writing, testing, and publishing CLI templates (`template.json5`, `croct use`, `croct create template`, template actions such as `create-resource`, `add-slot`, `download`, expressions `${options.name}`). Also when the `SlotContent` type generated for the slot `home-hero@1` or `slots.d.ts` is stale, or default content is outdated.
How to install the croct-use-cli skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the croct-use-cli skill in Plugin
/plugin marketplace add croct-tech/agent-skills /plugin install croct@croct-agent-skills
Install the croct-use-cli skill in Claude Code
~/.claude/skills/croct-use-cli/SKILL.md
$ npx degit croct-tech/agent-skills/skills/croct-use-cli ~/.claude/skills/croct-use-cliInstall the croct-use-cli skill in Claude Code (project)
.claude/skills/croct-use-cli/SKILL.md
$ npx degit croct-tech/agent-skills/skills/croct-use-cli .claude/skills/croct-use-cliInstall the croct-use-cli skill in Codex
~/.agents/skills/croct-use-cli/SKILL.md
$ npx degit croct-tech/agent-skills/skills/croct-use-cli ~/.agents/skills/croct-use-cliInstall the croct-use-cli skill in Gemini CLI
~/.gemini/skills/croct-use-cli/SKILL.md
$ npx degit croct-tech/agent-skills/skills/croct-use-cli ~/.gemini/skills/croct-use-cliInstall the croct-use-cli skill in Claude.ai
npx degit croct-tech/agent-skills/skills/croct-use-cli croct-use-cli && zip -r croct-use-cli.zip croct-use-cli # claude.ai → Customize → Skills → + → Create skill → Upload a skill → croct-use-cli.zip
SKILL.md
View on GitHubDrive the Croct CLI
The CLI configures a project (croct.json), installs the SDK, keeps generated type
definitions and fallback content in sync with the workspace, and runs templates
(JSON5 automation scripts). For Croct concepts (slot, component, workspace) see the
croct-use-croct skill; for rendering content in code see croct-integrate-sdk.
Running it
- Prefer the project's own runner. Without a global install, the docs run every command as
npx croct@latest <command>(equivalents:pnpm dlx croct@latest,yarn dlx croct@latest,bunx --bun croct@latest). Add--yestonpxto skip npm's install confirmation, as the docs do foropen:npx --yes croct@latest open '<url>'. - Global install:
npm install -g croct(orpnpm add -g croct,yarn global add croct,bun add -g croct). Verify withcroct --version. - Run from the project root, or pass
--cwd <path>. - Global options go between
croctand the command, never after it:croct --cwd ./app --no-interaction install, notcroct install --no-interaction.
Running without prompts
Every argument a command needs and you omit becomes an interactive prompt you cannot answer.
- Pass every value as an argument or flag (
croct add slot hero-banner@1, notcroct add slot). Commands whose positional list is optional (add/remove slot|component) prompt for a selection when it is empty. - Add
--no-interactionfor CI or scripted runs. Add--dnd(orCROCT_DND) for minimal interruption,--stateless(orCROCT_STATELESS) to store nothing locally (no config, no tokens),-q/--quietto silence output,--debugwhen a command fails. - For templates, pass every option as a flag (
croct use template.json5 --name my-app --no-typescript). Prompts in the template fall back to theirdefaultwhen running non-interactively.
The docs do not say what happens when a required value is missing under --no-interaction;
assume the command fails and supply everything up front.
| Global option | Env var | Purpose |
|---|---|---|
--cwd <path> |
Working directory | |
--api-key <key> |
CROCT_API_KEY |
Authenticate with an API key |
--token <token> |
CROCT_TOKEN |
Authenticate with a token |
--registry <url> |
Custom template registry | |
--no-interaction |
Non-interactive mode | |
--config <path> |
Config file path (new projects are initialized there) | |
--stateless |
CROCT_STATELESS |
Save no state locally |
--dnd |
CROCT_DND |
Minimal interaction and interruption |
--quiet, -q |
Disable output | |
--debug |
Debug mode |
Authentication
- Session-based commands use a login that lasts 7 days and renews on every CLI run.
- Never ask the user for their email, password, API key, or token, and never type them into a
command yourself. When a command needs a session, ask the user to run
croct login(ornpx croct@latest login) in their own terminal, then retry. croct login credentials --username <email> --password <pw>exists for the user's own scripts. Do not construct it with real credentials.croct initcreates an account if the user has none, so a new user can start there.croct logoutends the session and deletes stored tokens.- CI: the user provides
CROCT_API_KEYorCROCT_TOKENas secrets in the environment. The docs do not list which commands accept API-key or token auth, nor how to obtain a CLI token; checkhttps://docs.croct.com/reference/cli/global-options.mdor ask the user.
Pick the command
| Goal | Command |
|---|---|
| Integrate Croct into a project (account, org, workspace, apps, SDK, API key) | croct init |
| Same, non-interactively | croct --no-interaction init --sdk next --org acme --wor default --dev-app my-app-dev --prod-app my-app |
Regenerate all types and fallback content from croct.json (fresh clone, CI) |
croct install |
| Pull latest schemas/content at the same major versions | croct update |
| Move slots/components to newer major versions | croct upgrade [--slots a b] [--components c] |
| Start using a slot that exists in the workspace | croct add slot <id>[@version] [--example] |
| Start using a component | croct add component <id>[@version] |
| Stop using slots/components | croct remove slot <ids...> / croct remove component <ids...> |
| Create an API key | croct create api-key --name "<name>" --env dev|prod --permissions resource_read_access[,token_issue,data_export] [--copy] |
| Apply a template | croct use <file|url|npm://pkg|croct://path> [--option value] |
| Export workspace resources to a template / scaffold one | croct create template [path] / croct create template --empty |
| Open the admin (magic link, no manual login) | croct admin [page] e.g. croct admin workspace settings |
| Allow browser "Run" buttons to drive the CLI | croct enable deep-link / croct disable deep-link |
Execute a croct:// deep link |
croct open '<croct://...>' |
Full flags, arguments, and deep-link URL syntax: references/commands.md.
init essentials
- Interactive walkthrough: organization, workspace, development and production applications,
SDK installation, API key. Auto-detects the SDK; force it with
--sdk javascript|react|vue|next|nuxt. - Existing config is never overwritten unless
--override/-o.--new org|workspace|appprovisions new remote resources instead of reusing configured ones. - For Next.js and Nuxt it generates an API key and writes it to environment variables. Skip with
--skip-api-key-setup(orCROCT_SKIP_API_KEY_SETUP) when the user manages keys manually.
Keeping a project in sync
Types and fallback content are generated from the workspace for the versions listed in
croct.json. Admin changes never break the project: schemas are versioned and nothing changes
locally until you sync.
| Situation | Run |
|---|---|
| Fresh clone or reinstall, no postinstall hook | croct install |
| Default content changed in the admin | croct update |
| Schema changed in the admin (new field, etc.) at the same major version | croct update |
| New major version published and you want it | croct upgrade, then bump IDs in code (home-hero@1 -> home-hero@2) |
| Need a slot/component not yet in the project | croct add slot <id>@<version> / croct add component <id>@<version> |
TypeScript says a slot ID or SlotContent<'x@1'> does not exist |
Check croct.json lists it with a matching version specifier, then croct update |
installregisters a postinstall hook (SDK-dependent) so a dependency install also runscroct install.add slot <id>without a version takes the latest. The docs do not say which specifier it writes tocroct.json, nor whetheradd slot <id>@2replaces an existing entry. To pin or move a slot, edit the specifier ("home-hero": "2"), runcroct update, then bump the ID in code.
CI recipe
Built only from documented flags; gaps are marked.
# CROCT_API_KEY is provided by the user as a CI secret
npx --yes croct@latest --no-interaction install
- The docs do not say whether
installacceptsCROCT_API_KEY/CROCT_TOKENor which API-key permission it needs. If it fails on auth, ask the user. - The docs do not say whether the postinstall hook runs non-interactively during
npm ci. Committing the generated types (slots.d.ts) avoids depending on it for builds. - Commit the generated types file (for TypeScript,
slots.d.ts, auto-registered intsconfig.json): not required, but recommended so builds do not fetch definitions from the API. - Do not hand-edit generated types or fallback files; change the workspace or
croct.jsonand re-run the CLI.
croct.json essentials
{
"$schema": "https://schema.croct.com/json/v1/project.json",
"organization": "acme",
"workspace": "default",
"applications": {"development": "my-app-dev", "production": "my-app"},
"defaultLocale": "en",
"locales": ["en", "pt-br"],
"slots": {"home-hero": "1 - 3", "banner": "2"},
"components": {"card": "1"},
"paths": {"source": "src", "components": "src/components"}
}
slots/componentsmap IDs to major-version specifiers: exact"3", range"1 - 3", set"1, 3, 5". The CLI manages them onadd/remove/upgrade; if you edit them by hand, runcroct updateafterwards.pathsis optional and auto-detected;paths.contentsets where fallback content and type definitions are written (default: project root).
Full schema, type-generation usage per SDK, and fallback hierarchy: references/configuration.md.
Templates in one screen
A template is a JSON5 file with title, description, optional typed options, and an ordered
actions list. Values support ${...} expressions with options, this (variables set by
define or action results), project, and packageManager.
// template.json5
{
"$schema": "https://schema.croct.com/json/v1/template.json",
"title": "Quick start",
"description": "Sets up the project with the Croct SDK.",
"options": {
"typescript": {"type": "boolean", "description": "Whether to use TypeScript.", "default": true}
},
"actions": [
{"name": "check-dependency", "dependencies": [{"name": "next"}]},
{"name": "install"},
{"name": "integrate-croct"},
{"name": "print", "semantics": "success", "message": "You're all set!"}
]
}
- Test locally with
croct use template.json5; share by file, URL, GitHub blob URL,npm://<package>(template at the root of the package's GitHub repo), or the catalog (croct://...). create-resourceonly provisions resources in the workspace; follow it withadd-slot/add-componentto bring them into the project, using IDs captured in itsresult.- A value that is exactly one
${...}keeps its type (number, boolean, object); anything else becomes a string.
Format, every action, options, expressions, variables, functions, sources, registries, and publishing: references/templates.md.
Pitfalls
- Do: put global options before the command. Don't:
croct init --cwd app. - Do: give slot IDs with versions when it matters (
hero-banner@1). Bare IDs take the latest. - Don't run
croct admin,croct open, orenable deep-linkunprompted: they open the browser or register an OS URL handler on the user's machine. --sdkaccepts onlyjavascript,react,vue,next,nuxt. For other stacks, omit it and letinitauto-detect: the PHP, Laravel, Symfony, Drupal, and Hydrogen integration pages all recommendcroct init. Fall back to the SDK's manual steps (seecroct-integrate-sdk) only if detection fails.- After
upgrade, update versioned IDs in code; the CLI only changescroct.jsonand generated files. - The first CLI run without deep links enabled asks whether to enable them; expect that prompt in interactive sessions.
Live docs
- Command reference:
https://docs.croct.com/reference/cli/commands.md - Any page as markdown: append
.md(e.g.https://docs.croct.com/reference/cli/configuration.md) - Index:
https://docs.croct.com/llms.txt; search:https://docs.croct.com/api/search.md?term=<terms>
Files in this skill
4croct-use-cli skill questions
How do I install the croct-use-cli skill in Claude Code?
Run npx degit croct-tech/agent-skills/skills/croct-use-cli ~/.claude/skills/croct-use-cli. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the croct-use-cli skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.