Command Reference
This page documents every command group available in the Foir CLI. Commands follow a consistent foir <group> <action> pattern. All commands support the global --json, --jsonl, --quiet, and --project flags described in the CLI Overview.
Authentication & Setup
login
Authenticate the CLI via browser-based OAuth. Opens your default browser to sign in and writes a session token to ~/.foir/credentials.json once you complete the flow. Run this first on any new machine.
foir loginThe login flow:
- Opens your default browser at the Foir sign-in page.
- You sign in (or pick an existing session).
- The browser hands a short-lived authorization code back to the CLI listening on a local port.
- The CLI exchanges the code for a session token and saves it to
~/.foir/credentials.json.
No subcommands or flags — foir login is one-shot. If your browser doesn’t open automatically, the CLI prints a URL you can paste.
logout
Clear stored credentials. Removes ~/.foir/credentials.json and any cached session state.
foir logoutwhoami
Show the current authentication status — which user is signed in, which tenant + project are active, and which credentials file is in use.
foir whoamiUseful for confirming you’re operating on the project you think you are before running a destructive command. Combine with --json to script against the output.
select-project
Pick the active project for subsequent CLI calls. Lists every project your session has access to and writes the selection to ~/.foir/credentials.json so later commands don’t need a --project flag.
foir select-project [options]| Option | Description |
|---|---|
--project-id <id> | Skip the interactive picker and select a project directly. |
--save-as <name> | Save the selection as a named profile (see foir profiles). |
Examples
# Interactive picker
foir select-project
# Switch without the prompt
foir select-project --project-id prj_abc123
# Save the selection as a profile so you can switch back later
foir select-project --project-id prj_abc123 --save-as stagingprofiles
Manage named project profiles — bookmarks for tenant/project combinations so you can switch between environments (dev, staging, prod) without re-running select-project each time. Each profile is just a saved { tenantId, projectId } pair pinned to a name.
| Command | Description |
|---|---|
foir profiles list | List all saved profiles |
foir profiles show [name] | Show details of a profile (or the active one if no name) |
foir profiles default [name] | Show or set the default profile |
foir profiles delete <name> | Delete a named profile |
| Option | Applies to | Description |
|---|---|---|
--confirm | delete | Skip confirmation prompt. |
Activate a saved profile with the global --project <name> flag (see CLI Overview).
Examples
# List profiles
foir profiles list
# Inspect the active profile
foir profiles show
# Set the default profile so naked CLI calls use staging
foir profiles default staging
# Remove a profile
foir profiles delete old-tenant --confirmContent Management
records
Manage content records within a model.
| Command | Description |
|---|---|
foir records list <modelKey> | List records for a model |
foir records get <id> | Get a record by ID or natural key |
foir records create <modelKey> | Create a record |
foir records update <modelKey> <id> | Update a record |
foir records delete <id> | Delete a record |
foir records publish <versionId> | Publish a record version |
foir records unpublish <id> | Unpublish a record |
foir records duplicate <modelKey> <id> | Duplicate a record |
foir records versions <parentId> | List versions for a record |
foir records variants <recordId> | List variants for a record |
foir records create-version | Create a new version |
foir records create-variant | Create a variant |
foir records cancel-schedule <versionId> | Cancel a scheduled publish or unpublish |
Examples
# List published records with sorting
foir records list blog-post --filter "status=published" --sort "createdAt:desc" --limit 10
# Get a record by natural key (requires --model-key)
foir records get hello-world --model-key page
# Create a record from a JSON file and publish it
foir records create page --file page.json --publish
# Publish using a natural key instead of version ID
foir records publish my-page --model-key page
# List all versions of a record
foir records versions clx1234567890models
Manage content models (schemas).
| Command | Description |
|---|---|
foir models list | List all models |
foir models get <key> | Get a model by key |
foir models create | Create a model |
foir models update <key> | Update a model |
foir models delete <id> | Delete a model |
foir models versions <modelId> | List schema versions for a model |
Examples
# List all models
foir models list
# Create a model from a JSON file
foir models create --file blog-post-model.json
# Create models from all files in a directory, updating if they already exist
foir models create --dir ./models --upsert
# View schema version history
foir models versions clx1234567890locales
Manage locales for content localization.
| Command | Description |
|---|---|
foir locales list | List all locales |
foir locales get <idOrCode> | Get a locale by ID or code |
foir locales default | Get the default locale |
foir locales create | Create a locale |
foir locales update <id> | Update a locale |
foir locales delete <id> | Delete a locale |
Examples
# List all locales
foir locales list
# Get a locale by code
foir locales get en-US
# Get the default locale
foir locales default
# Create a new locale
foir locales create --data '{"locale":"fr-FR","displayName":"French","nativeName":"Francais"}'media
Upload and manage media files. The media group handles file uploads via the storage service, while file metadata commands are available through the dynamic files group.
| Command | Description |
|---|---|
foir media upload <filepath> | Upload a file |
foir media list | List files |
foir media get <id> | Get file details |
foir media update <id> | Update file properties |
foir media update-metadata <id> | Update alt text, caption, description |
foir media delete <id> | Delete a file |
foir media restore <id> | Restore a deleted file |
foir media usage | Get storage usage stats |
Examples
# Upload a file to a specific folder
foir media upload ./images/hero.jpg --folder banners
# List files filtered by folder
foir media list --folder banners
# Search for files
foir media list --search "hero"
# Update file metadata
foir media update-metadata clx123 --alt-text "Hero banner image" --caption "Welcome banner"
# Check storage usage
foir media usage
# Permanently delete a file (cannot be restored)
foir media delete clx123 --confirm --permanentfiles
Inspect and manage files in the media library. For uploads use foir media upload; this group covers everything after upload — listing, renaming, tagging, moving between folders, editing alt text and captions, and reporting storage usage.
| Command | Description |
|---|---|
foir files list | List files |
foir files get <id> | Get a file by ID |
foir files usage | Storage usage statistics |
foir files update <id> | Update file properties (filename, folder, tags) |
foir files update-metadata <id> | Update alt text, caption, description |
foir files delete <id> | Delete a file |
| Option | Applies to | Description |
|---|---|---|
--folder <folder> | list, update | Filter by folder / move to folder. |
--mime-type <type> | list | Filter by MIME type. |
--search <term> | list | Search by filename. |
--limit <n> | list | Max results. Default: 50. |
--offset <n> | list | Skip results. Default: 0. |
--filename <name> | update | New filename. |
--tags <tags> | update | Comma-separated tags. |
--alt-text <text> | update-metadata | Alt text. |
--caption <text> | update-metadata | Caption. |
--description <text> | update-metadata | Description. |
--confirm | delete | Skip confirmation prompt. |
Examples
# List images in the /banners folder
foir files list --folder banners --mime-type image/jpeg
# Search by filename
foir files list --search hero
# Move a file to a different folder
foir files update clx123 --folder archive
# Tag a file
foir files update clx123 --tags "homepage,launch,q2"
# Add alt text + caption for accessibility / SEO
foir files update-metadata clx123 \
--alt-text "A woman walking through a field of barley at sunrise" \
--caption "Spring '26 campaign"
# Storage usage summary
foir files usage --jsonsearch
Search across all records globally.
foir search <query> [options]| Option | Description |
|---|---|
--models <keys> | Filter to specific model keys (comma-separated) |
--limit <n> | Maximum number of results (default: 20) |
Examples
# Search across all content
foir search "getting started"
# Search within specific models
foir search "pricing" --models page,blog-post --limit 5
# Output as JSON for scripting
foir search "hello" --jsonrollouts
Manage rollouts — bulk scheduled-publishing batches that promote a mixed set of records, models, operations, auth providers, and other publishable resources together at a chosen time. The admin equivalent is Scheduled Publishing → Rollouts; see Scheduled Publishing for the feature overview.
| Command | Description |
|---|---|
foir rollouts list | List rollouts |
foir rollouts get <id> | Get a rollout (with its items) |
foir rollouts create | Create a rollout |
foir rollouts update <id> | Update name, description, or scheduledAt |
foir rollouts delete <id> | Delete a rollout before it runs |
foir rollouts trigger <id> | Trigger a rollout immediately (ignore its scheduled time) |
foir rollouts pause <id> | Pause an in-flight rollout |
foir rollouts resume <id> | Resume a paused rollout |
foir rollouts retry <id> | Retry failed items in a rollout |
foir rollouts rollback <id> | Roll back a completed rollout |
foir rollouts add-items <id> | Add items (records / models / operations / etc.) to a rollout |
foir rollouts remove-items <id> | Remove items from a rollout |
| Option | Applies to | Description |
|---|---|---|
--status <status> | list | Filter by status. |
--limit <n> | list | Maximum results. Default: 50. |
--offset <n> | list | Pagination offset. |
-d, --data <json> | create, update, add-items, remove-items | Payload as a JSON string. |
--file <path> | create, update, add-items, remove-items | Payload from a JSON file. |
--preview | rollback | Preview the rollback without executing — useful for confirming scope. |
--confirm | delete, rollback | Skip confirmation prompt. |
Note on lifecycle: use
deletefor rollouts that haven’t been triggered yet,rollbackfor ones that have. The CLI rejects mixing these.
Examples
# Create a rollout scheduled for next Monday
foir rollouts create --data '{
"name": "Weekly Release",
"scheduledAt": "2026-05-19T09:00:00Z",
"items": [
{ "kind": "record", "versionId": "ver_abc123" },
{ "kind": "record", "versionId": "ver_def456" }
]
}'
# Inspect the rollout, including its items
foir rollouts get rollout_abc123 --json
# Add more items to a draft rollout
foir rollouts add-items rollout_abc123 --file ./additional-items.json
# Trigger immediately, skipping the scheduled time
foir rollouts trigger rollout_abc123
# Pause while it runs, then resume
foir rollouts pause rollout_abc123
foir rollouts resume rollout_abc123
# Retry items that failed during the run
foir rollouts retry rollout_abc123
# Preview a rollback before committing
foir rollouts rollback rollout_abc123 --preview
# Execute the rollback
foir rollouts rollback rollout_abc123 --confirm
# Delete a rollout that never ran
foir rollouts delete rollout_abc123 --confirmCustomers and Targeting
customers
Manage customer accounts.
| Command | Description |
|---|---|
foir customers list | List customers |
foir customers get <idOrEmail> | Get a customer by ID or email |
foir customers create | Create a customer |
foir customers delete <id> | Delete a customer |
Examples
# List all customers
foir customers list
# Get a customer by email
foir customers get user@example.com
# Create a customer
foir customers create --data '{"email":"new@example.com","name":"New User"}'customer-profiles
Manage customer profile schemas and data.
| Command | Description |
|---|---|
foir customer-profiles schema | Get the customer profile schema |
foir customer-profiles update-schema | Update the profile schema |
foir customer-profiles get <customerId> | Get a customer’s profile data |
foir customer-profiles set <customerId> | Set a customer’s profile data |
Examples
# View the current profile schema
foir customer-profiles schema --json
# Update the profile schema
foir customer-profiles update-schema --file profile-schema.json
# Set profile data for a customer
foir customer-profiles set clx123 --data '{"preferences":{"theme":"dark"}}'segments
Define and manage customer segments with rule-based targeting.
| Command | Description |
|---|---|
foir segments list | List segments |
foir segments get <idOrKey> | Get a segment by ID or key |
foir segments create | Create a segment |
foir segments update <id> | Update a segment |
foir segments delete <id> | Delete a segment |
foir segments preview | Preview segment rules against sample data |
foir segments test <segmentId> <customerId> | Test if a customer matches a segment |
Examples
# List active segments
foir segments list
# Preview rules before saving
foir segments preview --file segment-rules.json
# Test a segment against a specific customer
foir segments test clx_seg_123 clx_cust_456variant-catalog
Manage the variant catalog for content personalization.
| Command | Description |
|---|---|
foir variant-catalog list | List variant catalog entries |
foir variant-catalog get <idOrKey> | Get an entry by ID or key |
foir variant-catalog create | Create a variant catalog entry |
foir variant-catalog update <id> | Update a variant catalog entry |
foir variant-catalog delete <id> | Delete a variant catalog entry |
Examples
# List all variant catalog entries
foir variant-catalog list
# Get a variant by key
foir variant-catalog get premium-users
# Create a new variant catalog entry
foir variant-catalog create --data '{"key":"mobile","name":"Mobile Users","isActive":true}'context
Manage context dimensions used for targeting and personalization.
| Command | Description |
|---|---|
foir context list | List context dimensions |
foir context get <idOrKey> | Get a context dimension by ID or key |
foir context create | Create a context dimension |
foir context update <id> | Update a context dimension |
foir context delete <id> | Delete a context dimension |
Examples
# List all context dimensions
foir context list
# Get a context dimension by key
foir context get device-type
# Create a new context dimension
foir context create --data '{"key":"region","name":"Region"}'Automation
operations
Manage server-side operations (custom endpoints).
| Command | Description |
|---|---|
foir operations list | List operations |
foir operations get <key> | Get an operation by key |
foir operations create | Create an operation |
foir operations update <key> | Update an operation |
foir operations delete <key> | Delete an operation |
foir operations execute | Execute an operation |
foir operations stats | Get execution statistics |
foir operations dead-letters | List failed (dead letter) operations |
foir operations retry-dead-letter <id> | Retry a failed operation |
foir operations dismiss-dead-letter <id> | Dismiss a failed operation |
Examples
# List all operations
foir operations list
# Execute an operation with input data
foir operations execute --data '{"key":"send-welcome-email","input":{"userId":"clx123"}}'
# View dead letter queue
foir operations dead-letters
# Retry a failed operation
foir operations retry-dead-letter clx_dl_456hooks
Manage lifecycle hooks — webhooks that fire on platform events (record.published, record.deleted, etc.). Hooks can also be declared in foir.config.ts and reconciled with foir push; this group is for one-off CRUD and for inspecting delivery history that lives outside the config file.
| Command | Description |
|---|---|
foir hooks list | List hooks |
foir hooks get <keyOrId> | Get a hook by key or ID |
foir hooks create | Create a hook |
foir hooks update <id> | Update a hook |
foir hooks delete <id> | Delete a hook |
foir hooks deliveries <hookId> | List recent deliveries for a hook |
foir hooks retry-delivery <deliveryId> | Retry a failed delivery |
foir hooks test <hookId> | Send a test delivery |
| Option | Applies to | Description |
|---|---|---|
--event <event> | list | Filter by event name. |
--active | list, update | List only active hooks / activate a hook. |
--inactive | list | List only inactive hooks. |
--no-active | update | Deactivate a hook. |
--limit <n> | list, deliveries | Maximum results. Default: 50. |
--offset <n> | list, deliveries | Pagination offset. |
--status <status> | deliveries | Filter deliveries by status (success, failed, pending). |
-d, --data <json> | create, update, test | Payload as a JSON string. |
--file <path> | create, update, test | Payload from a JSON file. |
--confirm | delete | Skip confirmation prompt. |
Examples
# List active hooks for a specific event
foir hooks list --event record.published --active
# Create a hook from a JSON file
foir hooks create --file ./hooks/on-publish.json
# Inline create
foir hooks create --data '{"key":"on-publish","name":"On Publish","event":"record.published","url":"https://example.com/webhook"}'
# Deactivate without removing
foir hooks update hook_abc123 --no-active
# Recent failed deliveries for a hook
foir hooks deliveries hook_abc123 --status failed --limit 20
# Send a synthetic delivery to verify the receiver
foir hooks test hook_abc123 --data '{"message":"test"}'
# Retry one failed delivery
foir hooks retry-delivery del_456schedules
Manage scheduled tasks with cron expressions.
| Command | Description |
|---|---|
foir schedules list | List schedules |
foir schedules get <key> | Get a schedule by key |
foir schedules create | Create a schedule |
foir schedules update <key> | Update a schedule |
foir schedules trigger <key> | Trigger a schedule immediately |
foir schedules pause <key> | Pause a schedule |
foir schedules resume <key> | Resume a paused schedule |
foir schedules delete <key> | Delete a schedule |
Examples
# List all schedules
foir schedules list
# Create a scheduled task
foir schedules create --file daily-sync.json
# Trigger a schedule immediately (outside its cron)
foir schedules trigger daily-sync
# Pause a schedule
foir schedules pause daily-syncAdministration
settings
Manage project settings.
| Command | Description |
|---|---|
foir settings list | List all settings |
foir settings get <key> | Get a setting by key |
foir settings set | Set a setting value |
foir settings delete <key> | Delete a setting |
Examples
# List all settings
foir settings list
# Get a specific setting
foir settings get site.name
# Set a setting value
foir settings set --data '{"key":"site.name","value":"My Site"}'design-tokens
Manage the project’s design tokens document.
| Command | Description |
|---|---|
foir design-tokens get | Print the current document |
foir design-tokens apply <path> | Apply a W3C-formatted JSON document from disk |
foir design-tokens publish | Promote draft → published |
foir design-tokens unpublish | Remove the published snapshot |
foir design-tokens status | Show draft / published version status |
| Option | Applies to | Description |
|---|---|---|
--channel <draft|published> | get | Channel to read. Default: draft. |
--resolved | get | Print the server-resolved view (typed arrays, references expanded) instead of the raw W3C document. |
--publish | apply | Also publish after applying. |
Examples
# Print the draft document as JSON
foir design-tokens get
# Print the resolved view (groups expanded into flat arrays)
foir design-tokens get --resolved
# Diff what the storefront is serving against the draft
foir design-tokens get --channel published > published.json
foir design-tokens get --channel draft > draft.json
diff published.json draft.json
# Apply a hand-authored or generated tokens document
foir design-tokens apply ./tokens.json
# Apply and publish in one step
foir design-tokens apply ./tokens.json --publish
# Promote the current draft to published
foir design-tokens publish
# Check whether draft and published are in sync
foir design-tokens statusTip: For projects that track tokens in
foir.config.ts, usefoir push --publishinstead — it applies models, operations, and design tokens (and publishes them) in one step.
secrets
Manage vault secrets — opaque references your app code resolves to plaintext at runtime. Plaintext values never leave your machine; the CLI stores only encrypted blobs on the platform.
| Command | Description |
|---|---|
foir secrets put | Store a new secret and print its ref |
foir secrets list | List secret metadata (no plaintext) |
foir secrets rotate <ref> | Replace plaintext for an existing ref; returns a new ref |
foir secrets delete <ref> | Soft-delete a secret (recoverable until purged) |
foir secrets restore <ref> | Undo a soft-delete (only valid before the purge window passes) |
foir secrets push | Reconcile a foir.secrets.ts declaration file with the vault |
foir secrets purge | Drop every soft-deleted secret past its TTL |
| Option | Applies to | Description |
|---|---|---|
--label <label> | put | Optional human-readable label. |
--app <name> | put, list | Owner: app name. Default: project-owned. |
--file <path> | put, rotate | Read plaintext from file (binary-safe). |
--value <plaintext> | put, rotate | Plaintext value (string only; prefer --file for binary). |
--include-soft-deleted | list | Include soft-deleted entries. |
--config <path> | push | Path to foir.secrets.ts (default: auto-discover). |
--plaintext <path> | push | Path to local.foir.secrets.ts (default: auto-discover). |
--rotate | push | Rotate plaintext for secrets that already exist. |
--dry-run | push | Show what would change without writing. |
--confirm | rotate, delete, purge | Skip confirmation prompt. |
Examples
# Store a new secret from a file (binary-safe)
foir secrets put --file ./stripe.key --label "Stripe API key"
# Store a string value
foir secrets put --value "sk_test_..." --label "Stripe (test)"
# List project-owned secrets
foir secrets list
# Reconcile a declarative secrets file
foir secrets push --config foir.secrets.ts --plaintext local.foir.secrets.ts
# Rotate (returns a new ref — update your app code)
foir secrets rotate vault:abc123 --file ./new-stripe.key
# Soft-delete and undo
foir secrets delete vault:abc123 --confirm
foir secrets restore vault:abc123api-keys
Manage API keys for programmatic access.
| Command | Description |
|---|---|
foir api-keys list | List API keys |
foir api-keys create | Create an API key |
foir api-keys rotate <id> | Rotate an API key |
foir api-keys revoke <id> | Revoke an API key |
Examples
# List all API keys
foir api-keys list
# Create a new API key
foir api-keys create --data '{"name":"CI Pipeline"}'
# Rotate an existing key (requires confirmation)
foir api-keys rotate clx123 --confirm
# Revoke a key
foir api-keys revoke clx123 --confirmauth-providers
Manage customer authentication providers (OAuth, SAML, etc.).
| Command | Description |
|---|---|
foir auth-providers list | List customer auth providers |
foir auth-providers get <id> | Get an auth provider |
foir auth-providers create | Create an auth provider |
foir auth-providers update <id> | Update an auth provider |
foir auth-providers delete <id> | Delete an auth provider |
Examples
# List configured auth providers
foir auth-providers list
# Create a Google OAuth provider
foir auth-providers create --file google-auth.jsonauth
Inspect customer-auth configuration and verify customer tokens. Distinct from auth-providers, which manages the OAuth/OIDC providers themselves — this group is about the project’s overall customer-auth settings and the tokens those providers issue.
For end-user auth concepts see Customer Authentication.
| Command | Description |
|---|---|
foir auth config | Print the project’s customer-auth configuration |
foir auth verify-token <token> | Verify a customer JWT and print its claims |
verify-token calls the platform — the same code path the admin app uses. Useful for diagnosing token issues from CI or a local shell without writing client code.
Examples
# Show the active customer-auth configuration
foir auth config --json
# Verify a JWT carried in a request header during local debugging
foir auth verify-token "eyJhbGciOi..."notifications
Manage platform notifications.
| Command | Description |
|---|---|
foir notifications list | List notifications |
foir notifications read <id> | Mark a notification as read |
foir notifications read-all | Mark all notifications as read |
Examples
# List unread notifications
foir notifications list
# Mark all as read
foir notifications read-allnotes
Manage notes attached to entities (records, models, etc.).
| Command | Description |
|---|---|
foir notes list | List notes |
foir notes get <id> | Get a note |
foir notes create | Create a note |
foir notes resolve | Resolve a note |
foir notes delete <noteId> | Delete a note |
Examples
# Create a note on a record
foir notes create --data '{"entityType":"record","entityId":"clx123","content":"Needs review before publishing"}'
# Resolve a note
foir notes resolve --data '{"id":"clx_note_456"}'
# Delete a note
foir notes delete clx_note_456 --confirmApps
apps
Install and manage apps — pluggable units delivered by manifest URL.
| Command | Description |
|---|---|
foir apps list | List installed apps |
foir apps get <name> | Get an installed app by name |
foir apps install <manifestUrl> | Install an app from a manifest URL |
foir apps update <name> | Check for updates and apply if no rejected changes |
foir apps uninstall <name> | Uninstall (runs __uninstall first if declared) |
foir apps trigger <appName> <operationKey> | Trigger an app-owned operation |
foir apps validate <manifestUrl> | Dry-run validation of a manifest URL |
Examples
# List installed apps
foir apps list
# Install with inline mappings (ad-hoc)
foir apps install https://shopify.apps.foir.io/manifest.json \
--source-map '{"product":{"toModel":"product","naturalKey":"handle","fields":{"title":"title","handle":"handle"}}}'
# Install via foir.config.ts (golden path) — declare apps.<name> and run:
foir push
# Check for updates with a diff
foir apps update redirector --dry-run
# Apply updates (only safe-auto changes apply automatically; rejected changes block)
foir apps update redirector
# Trigger a specific operation on an installed app
foir apps trigger redirector deploy-worker --data '{"force":true}'
# Force-uninstall (skip middleware __uninstall, remove platform state regardless)
foir apps uninstall redirector --force
# Validate a manifest before installing
foir apps validate https://my-app.example.com/manifest.jsonThe CLI namespaces app-owned operation keys as <appName>/<operationKey> when storing them, but foir apps trigger accepts the bare key form too.
Scaffolding
create-config
Scaffold a new app or extension project — a Vite UI + Hono API monorepo wired up for Foir’s scoped-token verification.
npx @eide/foir-cli create-config <name> [options]| Option | Description |
|---|---|
--type <type> | Project type: custom-editor, workflow, or widget |
Examples
# Custom editor placement (UI + middleware)
npx @eide/foir-cli create-config my-editor --type custom-editor
# Pure backend operation (no UI)
npx @eide/foir-cli create-config my-summarizer --type workflow
# Static iframe (no middleware)
npx @eide/foir-cli create-config color-picker --type widgetSee Building an App and Building Operations for end-to-end walkthroughs.
init
Generate starter files for a project — a fresh foir.config.ts, a single model definition, or a tree of seed records for existing models. Run from inside a project that already has a foir.config.ts.
| Command | Description |
|---|---|
foir init | Generate a starter foir.config.ts in the current directory |
foir init model <key> | Generate a starter model definition file |
foir init records | Generate seed files for one or more existing models (interactive picker) |
| Option | Applies to | Description |
|---|---|---|
-o, --output <dir> | model, records | Output directory. Default: models for model, seed for records. |
--ts | model, records | Emit TypeScript (.ts) instead of JSON. |
Examples
# Scaffold a fresh foir.config.ts in this folder
foir init
# Create a starter model file at ./models/blog-post.ts
foir init model blog-post --ts
# Generate seed records into ./seed/ for models you pick interactively
foir init records --tscreate-extension
Legacy alias for the extension scaffolder. New projects should use create-config.
Config Management
configs
Manage platform configs (bundles of models, operations, hooks, and schedules).
| Command | Description |
|---|---|
foir configs list | List all configs |
foir configs get <idOrKey> | Get a config by ID or key |
foir configs register | Register a new config |
foir configs apply | Apply a config |
foir configs uninstall <id> | Unregister a config and its resources |
foir configs sync <configId> | Trigger a config data sync |
Examples
# List all configs
foir configs list
# Get a config by key
foir configs get my-blog-config
# Apply a config
foir configs apply --file config.json
# Trigger a sync
foir configs sync clx123pull
Export the current platform state of a config back into a local foir.config.ts file. Inverse of push — useful when an admin edited models or operations in the dashboard and you want those changes back in source control.
foir pull [options]| Option | Description |
|---|---|
--key <configKey> | Config key to export (default: auto-discover from the current foir.config.ts) |
--out <path> | Output file (default: foir.config.ts next to the current one) |
--force | Overwrite an existing file without prompting |
Examples
# Pull the current project's config into ./foir.config.ts
foir pull
# Pull a named config and write to a different file
foir pull --key my-blog-config --out ./configs/blog.config.ts
# Overwrite without prompt (useful in CI / pre-commit hooks)
foir pull --forcepush
Push a local foir.config.ts file to the platform. This registers or updates a config and all its associated resources.
foir push [options]| Option | Description |
|---|---|
--config <path> | Path to config file (default: auto-discovers foir.config.ts) |
--force | Overwrite platform state on three-way-merge conflicts with admin-UI edits |
--publish | Promote updated models, operations, auth providers, profile schema, and design tokens to the published channel after the push. New resources auto-publish; this flag covers updates, which are otherwise left as drafts. |
--rotate-keys | Rotate existing API keys and rewrite their values in .env |
--env <path> | Path to .env file (default: .env) |
Examples
# Push the config file in the current directory
foir push
# Push a specific config file
foir push --config ./configs/blog.config.ts
# Apply and publish in one step — including design tokens
foir push --publish
# Overwrite admin-UI edits when the three-way merge reports conflicts
foir push --forceremove
Remove a config and all its provisioned resources (models, operations, hooks, schedules).
foir remove <key> [options]| Option | Description |
|---|---|
--force | Skip the confirmation prompt |
Examples
# Remove a config (with confirmation prompt)
foir remove my-blog-config
# Remove without confirmation
foir remove my-blog-config --forceEmbeddings and AI
embeddings
Manage vector embeddings for semantic search and similarity. Pairs with the AI & Search feature; the embedding pipeline runs on the platform but the CLI is how you trigger writes, deletes, and ad-hoc searches outside the admin app.
| Command | Description |
|---|---|
foir embeddings write | Write an embedding vector for a record |
foir embeddings delete <recordId> | Delete the embedding for a record |
foir embeddings search | Search by vector similarity |
foir embeddings list <recordId> | List embeddings stored for a record |
foir embeddings stats [modelKey] | Embedding statistics, optionally scoped to a model |
foir embeddings similar <recordId> | Find records similar to the given record |
| Option | Applies to | Description |
|---|---|---|
-d, --data <json> | write, search | Input payload as a JSON string. |
--file <path> | write, search | Input payload from a JSON file. |
--confirm | delete | Skip confirmation prompt. |
--model-key <key> | similar | Limit matches to a specific model. |
--limit <n> | similar | Maximum results. Default: 10. |
Examples
# Write an embedding from a file
foir embeddings write --file embeddings.json
# Semantic search (JSON payload describes the query)
foir embeddings search --data '{"query":"machine learning","modelKey":"article","limit":10}'
# Find similar records, scoped to a model
foir embeddings similar clx123 --model-key article --limit 5
# Embedding statistics for a single model
foir embeddings stats article --json
# Project-wide stats (no model key)
foir embeddings stats --json
# Delete the embedding attached to a record
foir embeddings delete clx123 --confirm