CLI
Reference for the Swirls command line application.
Overview
The Swirls CLI ships as a single, dependency-free executable. You can install it via script or package manager across Linux and macOS.
The CLI is the authoring and management surface for Swirls Cloud: validate .swirls files, deploy projects, manage secrets and managed-database migrations, install registry integrations, generate TypeScript from project forms, and drive hosted workflow executions and agent chat sessions. Execution is hosted. Every runtime command is a client of the Swirls Cloud API.
Installation
curl -fsSL https://swirls.ai/install | bashnpm install -g @swirls/cliAfter installation, verify the CLI is available by running:
swirls --versionUpgrade
Once installed, the CLI can upgrade itself:
swirls upgradeThis command fetches the latest version, compares it to your current install, and prompts you before upgrading.
Uninstall
To remove the CLI from your system:
Remove the binary and, if desired, stored credentials:
rm -f ~/.local/bin/swirls
rm -rf ~/.config/swirlsnpm uninstall -g @swirls/cliCommand map
All commands are top-level. There is no cloud prefix.
| Command | Subcommands | What it does |
|---|---|---|
swirls add | Add registry integrations or import workflows from an API spec | |
swirls auth | login, logout | Authenticate with Swirls Cloud |
swirls deploy | Deploy the project to Swirls Cloud | |
swirls migrate | status, apply, new | Managed-database migrations |
swirls db | connections, connection | Managed-database named connections and connection strings |
swirls project | list, create | Manage projects in your account |
swirls configure | Write swirls.config.ts | |
swirls doctor | Validate and diagnose .swirls files | |
swirls outdated | Check installed registry items for updates | |
swirls secret | set, list, remove | Manage the project vault |
swirls workflow | execute, list | Run and list deployed workflows |
swirls form | generate | Generate TypeScript from project forms |
swirls chat | start, resume, send, list, show, rm | Hosted agent chat sessions |
swirls update | Update installed registry items | |
swirls upgrade | Upgrade the CLI binary |
Commands
add
swirls add
Add integration action blocks from the Swirls registry by provider key, or generate the same action artifacts from an OpenAPI or GraphQL spec URL.
swirls add slack
swirls add linear create_issue
swirls add https://api.linear.app/graphql --only viewer,mutation_issueCreate
swirls add https://api.example.com/openapi.json --type openapiRegistry installs are tracked in lockfile.items. URL imports write actions under swirls/integrations/<provider>/ (plus a one-time connection scaffold) and record lockfile.imports.
Flags:
| Flag | Type | Description |
|---|---|---|
--registry | string | Registry base URL or local path. Defaults to the Swirls registry. |
--force | boolean | Overwrite existing registry item or import files. |
--type | string | Spec type for URL imports: openapi or graphql. |
--name | string | Provider / import name for URL imports. Defaults to a catalog match or a name derived from the URL. |
--tag | string | Filter URL import operations by OpenAPI tag. |
--only | string | Comma-separated operation or registry item ids for non-interactive selection. |
--all | boolean | Add or import all operations or items without prompting. |
--header | string | HTTP header for the spec fetch, as Name:Value. |
--yes | boolean | Skip confirmation prompts for URL imports. |
auth
Authentication commands for Swirls Cloud.
swirls auth login
Log in with a device authorization flow. The CLI requests a device code, opens the verification page in your browser, and shows a short user code in the terminal. Confirm the code in the browser to approve the login. The CLI polls until you approve, stores the access token locally, and prompts you to select an active organization.
Run this command before any command that communicates with the API.
swirls auth loginswirls auth logout
Log out of the current account and delete locally stored credentials.
swirls auth logoutdeploy
swirls deploy
Compile every .swirls file in the project, validate the merged definition, and deploy it to Swirls Cloud as an immutable snapshot. On success the new deployment becomes the project's active deployment.
swirls deployThe target project comes from swirls.config.ts in the working directory. The deploy output includes the deployment name and ID, plus warnings for any missing vendor keys (with ready-to-run swirls secret set commands) and pending managed-database migrations.
Flags:
| Flag | Type | Description |
|---|---|---|
--name | string | Deployment name. Defaults to a fingerprint of the .swirls source files. |
--project | string | Project id or exact project name. Overrides swirls.config.ts. |
--create | boolean | Create the named project if it does not exist. |
You can also deploy with git push from a GitHub repository linked in the dashboard. No CI/CD pipeline required either way. See Swirls Cloud for both paths.
migrate
Manage schema and data migrations for the managed databases your project declares.
swirls migrate status
Show migration status for each managed database in the active deployment.
swirls migrate status [--project <id-or-name>]swirls migrate apply
Approve gated managed-database migrations.
swirls migrate apply [--database <name>] [--yes]Flags:
| Flag | Type | Description |
|---|---|---|
--database | string | Approve only this database. Defaults to every gated migration. |
--yes | boolean | Approve without prompting. Required in non-interactive runs. |
--project | string | Project id or exact project name. |
swirls migrate new
Scaffold a migration block for a managed database.
swirls migrate new <migration_name> --database <name> [--file <path>]Flags:
| Flag | Type | Description |
|---|---|---|
--database | string | Name of the database block the migration targets. |
--file | string | File to append the block to. Defaults to migrations.swirls. |
db
List and reveal the named connections declared inside database blocks: see Database.
swirls db connections
List the named connections provisioned for the project's managed databases.
swirls db connections [--database <name>] [--project <id-or-name>]Flags:
| Flag | Type | Description |
|---|---|---|
--database | string | Filter to one managed database block. Defaults to every database in the project. |
--project | string | Project id or exact project name. |
swirls db connection
Print the connection string for a named connection. The direct URL goes to stdout, and a pooled URL is shown when the database offers one. Treat the output like a password.
swirls db connection <connection_name> --database <name> [--rotate] [--project <id-or-name>]Flags:
| Flag | Type | Description |
|---|---|---|
--database | string | Managed database block name. Required. |
--rotate | boolean | Rotate credentials before printing, invalidating the previous connection string. |
--project | string | Project id or exact project name. |
project
Project management commands for your Swirls Cloud account.
swirls project create
Create a new project in your account. The CLI prompts you for a project name.
swirls project createswirls project list
List every project in your account.
Alias: swirls project ls
swirls project listconfigure
swirls configure
Configure an application powered by Swirls. Creates a swirls.config.ts file in the current directory. The CLI prompts you to select a project. If a config file already exists, the command exits without overwriting it.
Alias: swirls config
swirls configureThe generated config file:
import { defineConfig } from '@swirls/sdk/config'
export default defineConfig({
projectId: '<your-project-id>',
genPath: 'src/swirls.gen.ts',
})Configuration options:
| Option | Type | Description |
|---|---|---|
projectId | string | UUID of the Swirls project. |
genPath | string | File path for generated TypeScript code. Defaults to src/swirls.gen.ts. |
doctor
swirls doctor
Validate every .swirls file under the working directory. The command parses each file, builds a workspace-wide resource index, and reports errors, warnings, and summary counts.
Use swirls doctor as your primary troubleshooting tool when workflows are missing, when swirls workflow list shows fewer workflows than you expect, or when you see validation errors in the editor.
swirls doctorWhat it reports:
| Category | Examples |
|---|---|
| Errors (exit 1) | Parse failures. Duplicate resource names anywhere in the workspace, with peer locations. Skill blocks with an empty name, a missing or invalid tree, or executable content. |
| Warnings | Registry drift on installed items, with the swirls update command to run. SKILL.md frontmatter names that do not match the directory slug. |
| Summary counts | Per-primitive totals: workflows, triggers, forms, secrets, agents, skills, streams, and the rest. |
When the summary counts do not match the number of declarations you wrote, content is being silently dropped. See Common mistakes for the full list of causes and fixes.
Doctor is the author-time gate. Both deploy paths re-validate the definition server-side and fail closed, so a clean doctor run is a preview of a clean deploy.
outdated
swirls outdated
List installed registry items and whether local copies are up to date. Pass a provider key and item ids to narrow the check.
swirls outdated [provider] [items...]Flags:
| Flag | Type | Description |
|---|---|---|
--registry | string | Registry base URL or local path. Defaults to the Swirls registry. |
--check | boolean | Exit with code 1 when any installed item is outdated or missing. |
secret
The secret commands manage the project vault: the encrypted, project-scoped store that hosted executions read at runtime. Keys must be declared in a DSL secret block (including vendor API keys like OPENROUTER_API_KEY). Use type: managed in the DSL for Enterprise platform-supplied keys — those cannot be set via the CLI.
When a deploy reports missing vendor keys, executions for the affected nodes are held until the keys are declared and satisfiable.
swirls secret set
Store a secret value in the project vault for a declared (non-managed) secret block var. Values are stored as block::VAR.
swirls secret set OPENROUTER_API_KEY=sk-or-...
swirls secret set SMTP_PASSWORD=...
swirls secret set RESEND_API_KEY=re_... --project my-projectThe project comes from swirls.config.ts in the working directory; pass --project <id-or-name> to target another project.
swirls secret list
List the project's secret keys and whether a value is set. Values are never displayed.
Alias: swirls secret ls
swirls secret listswirls secret remove
Remove a stored secret value from the project vault.
Alias: swirls secret rm
swirls secret remove OPENROUTER_API_KEYworkflow
swirls workflow execute
Execute a deployed workflow by name in your hosted project. This requires a paid plan and is not available on the free inspection-only tier. If workflow_name is omitted, the CLI prompts you to select from available workflows. If --input is omitted, the CLI prompts for input based on the workflow's schema.
Alias: swirls workflow exec
swirls workflow execute [workflow_name]Flags:
| Flag | Type | Description |
|---|---|---|
--input | string | JSON object to pass as root input to the workflow. Omit to be prompted from the schema. |
--verbose | boolean | Print detailed execution output. |
Example:
swirls workflow execute my_workflow --input '{"query": "hello world"}'swirls workflow list
List available workflows in the current project.
Alias: swirls workflow ls
swirls workflow listform
swirls form generate
Generate application code and types from project forms. Reads swirls.config.ts, fetches all forms with schemas from the API, and writes the generated output to the path specified by genPath.
Alias: swirls form gen
swirls form generateThe generated file includes Zod schemas, a form registry, a registerForms() function, and module augmentation for full type safety. See TypeScript generation for details.
chat
The chat commands manage persistent hosted agent sessions when agent chat is enabled for your Swirls Cloud project. Sessions keep a full transcript between runs.
swirls chat start
Start a new hosted agent session. If agent_name is omitted, the CLI prompts you to select an agent from your project.
swirls chat start [agent_name] [--title <title>] [--input <json>] [--detached]Flags:
| Flag | Type | Description |
|---|---|---|
--title | string | Optional label for the session. |
--input | string | Initial JSON input to pass to the agent. |
--detached | boolean | Start the session without attaching to it interactively. |
swirls chat resume
Resume an existing interactive session by ID.
Alias: swirls chat talk
swirls chat resume <sessionId>swirls chat send
Send a single message to a session without entering interactive mode.
swirls chat send <sessionId> --message <text>Flags:
| Flag | Type | Description |
|---|---|---|
--message | string | The message text to send. Required. |
swirls chat list
List recent CLI chat sessions. Filter by agent name with --agent.
Alias: swirls chat ls
swirls chat list [--agent <name>]swirls chat show
Show the persisted transcript for a session.
swirls chat show <sessionId> [--json]Flags:
| Flag | Type | Description |
|---|---|---|
--json | boolean | Output the transcript as JSON. |
swirls chat rm
Delete a session and its messages.
swirls chat rm <sessionId>update
swirls update
Update installed registry items from the remote registry. Without arguments, everything outdated is updated. Pass a provider key and item ids to narrow the update.
swirls update [provider] [items...]Flags:
| Flag | Type | Description |
|---|---|---|
--registry | string | Registry base URL or local path. Defaults to the Swirls registry. |
--force | boolean | Overwrite locally modified files without confirmation. |
upgrade
swirls upgrade
Update the CLI to the latest version. Works with both the install-script and package-manager installations.
swirls upgradeNext steps
- TypeScript generation: Learn what code is generated and how to use it with the SDK.
- API reference: Interact with the Swirls API programmatically.
- SDK reference: Typed TypeScript client for the Swirls API.