CLI Reference
The @useacms/cli package provides command-line tools for development, deployment, and schema management. All commands are run via acms (or npx acms).
acms dev
Section titled “acms dev”Start the local development server.
acms devacms dev -p 3002 # Custom portWhat it does:
- Starts an Express API server on port 3001 (default)
- Serves the REST API for field registration and content management
- Automatically generates
acms.d.tswith TypeScript definitions - Watches
acms.jsonfor changes and regenerates types (300ms debounce) - Provides Server-Sent Events (SSE) for live dashboard updates
- Tracks field access timestamps in metadata
- Loads environment variables from
.env
Options:
| Flag | Description | Default |
|---|---|---|
-p, --port <number> | Port for the dev server | 3001 |
acms push
Section titled “acms push”Push your local schema to the production storage adapter.
acms pushacms push --force # Skip confirmation promptReads acms.json and uploads it to the production adapter defined in acms.config.ts. By default, prompts for confirmation before overwriting remote content.
Options:
| Flag | Description |
|---|---|
--force | Skip the confirmation prompt |
acms pull
Section titled “acms pull”Pull schema from the production storage adapter to your local acms.json.
acms pullDownloads the schema from the production adapter and writes it to acms.json. Overwrites local content with the remote version.
acms sync
Section titled “acms sync”Bi-directional sync between local and remote schemas.
acms syncacms sync --resolve remote # Use remote values for conflictsacms sync --resolve local # Use local values for conflictsCompares local acms.json with the remote schema and merges them. New fields from either side are added. Conflicting values require a resolution strategy.
Options:
| Flag | Description |
|---|---|
--resolve <strategy> | Conflict resolution: local or remote |
acms status
Section titled “acms status”Check the sync status between local and remote schemas.
acms statusShows which fields exist locally but not remotely, which exist remotely but not locally, and which have conflicting values.
acms generate-types
Section titled “acms generate-types”Generate TypeScript definitions from the current schema.
acms generate-typesacms types # AliasReads acms.json and generates acms.d.ts in the project root. This file provides module augmentation for @useacms/client, giving you full IDE autocomplete and type checking.
acms purge
Section titled “acms purge”Remove unused fields based on lastAccessed timestamps in metadata.
acms purgeacms purge --max-age 60 # Fields unused for 60+ daysacms purge --dry-run # Preview without deletingacms purge -v # Verbose outputFields that haven’t been accessed within the specified time period are removed from acms.json. The default threshold is 30 days.
Options:
| Flag | Description | Default |
|---|---|---|
--max-age <days> | Days since last access before purging | 30 |
--dry-run | Show what would be purged without deleting | false |
-v, --verbose | Show detailed output | false |
acms --help
Section titled “acms --help”Show help for all commands.
acms --helpacms <command> --help # Help for a specific commandacms -v
Section titled “acms -v”Show the CLI version.
acms -vGlobal Options
Section titled “Global Options”These options are available for all commands:
| Flag | Description |
|---|---|
--help | Show help information |
-v, --version | Show version number |
Example Workflow
Section titled “Example Workflow”A typical development workflow looks like:
# Start developmentacms dev
# In another terminal, start your appnpm run dev
# Work on your app, fields are auto-registered...
# Generate types manually (if needed)acms generate-types
# Check what's different from productionacms status
# Pull latest production contentacms pull
# Push local changes to productionacms push
# Clean up unused fieldsacms purge --dry-run # Preview firstacms purge # Then purge for realNext Steps
Section titled “Next Steps”- Learn about the REST API provided by the dev server
- Set up TypeScript support
- Choose a Storage Adapter for production