Command-line interface for the Adapto CMS management API.
curl -sSL https://raw.githubusercontent.com/adaptocms/adapto-cms-cli/main/scripts/install.sh | bashgo install github.com/adaptocms/adapto-cms-cli@latestDownload the binary for your platform from GitHub Releases.
Set these environment variables:
| Variable | Description | Required |
|---|---|---|
ADAPTO_TOKEN |
Bearer token (from adapto auth login) |
Yes (for management commands) |
ADAPTO_API_URL |
API base URL (default: https://api.adaptocms.com) |
No |
ADAPTO_TENANT_ID |
Tenant ID for multi-tenant setups | No |
All variables can also be passed as flags: --token, --api-url, --tenant-id.
# Login (credentials are saved automatically)
adapto auth login --email you@example.com --password yourpassword
# List articles
adapto articles list
# Get JSON output
adapto articles list --json
# Create an article (interactive prompts for missing fields)
adapto articles create
# Create with flags
adapto articles create \
--title "My Article" \
--content "Hello world" \
--slug "my-article" \
--author "Jane" \
--language "en"Upload files directly from the CLI:
# Single-step upload (creates metadata + uploads content)
adapto files upload ./photo.jpg
# Two-step: create metadata first, then upload by ID
adapto files create-metadata --filename photo.jpg --content-type image/jpeg
adapto files upload-by-id FILE_ID ./photo.jpgArticles, pages, and collection items support attaching media (images, videos, embeds) via the --media-json flag on create, update, and create-translation commands:
adapto articles create \
--title "My Post" \
--content "<p>Hello</p>" \
--slug my-post \
--author "Jane" \
--language en \
--media-json '[{
"placement_key": "hero_image",
"media_object": {
"id": "m1",
"file_id": "FILE_ID",
"url": "https://cdn.example.com/photo.jpg",
"type": "image"
},
"alt_text": "Hero image"
}]'Each placement object supports:
placement_key— where the media goes (e.g.hero_image,body_image_1)media_object—id,file_id,url,type(image/video/audio/document/other/youtube/vimeo/tiktok/instagram_reel/instagram_post),title,descriptioncaption,alt_text,meta_data— optional metadata
The same --media-json flag works on adapto pages create/update and adapto collections items create/update.
adapto
├── version Print CLI version
├── llm-info Full CLI reference for LLM agents
├── auth
│ ├── login Login with email/password
│ ├── register Register new account
│ ├── logout Revoke refresh token
│ ├── refresh Refresh access token
│ ├── me Current user info
│ ├── change-password Change password
│ ├── request-password-reset Request reset email
│ ├── reset-password Reset with token
│ ├── activate Activate account
│ ├── resend-activation Resend activation email
│ ├── login-github GitHub OAuth
│ ├── callback-github GitHub OAuth callback
│ ├── login-google Google OAuth
│ ├── switch-tenant Switch active tenant
│ └── orgs List organizations/tenants
├── articles
│ ├── list List articles
│ ├── create Create article
│ ├── get <id> Get by ID
│ ├── get-by-slug <slug> Get by slug
│ ├── update <id> Update article
│ ├── delete <id> Delete article
│ ├── publish <id> Publish
│ ├── archive <id> Archive
│ ├── translations <id> List translations
│ ├── create-translation <id> Create translation
│ └── categories <id> List categories
├── categories
│ ├── list / create / get / update / delete
│ ├── get-by-slug / subcategories
│ ├── articles / add-article / remove-article
│ └── translations / create-translation
├── pages
│ ├── list / create / get / update / delete
│ ├── get-by-slug / publish / archive
│ └── translations / create-translation
├── collections
│ ├── list / create / get / update / delete
│ ├── get-by-slug
│ └── items
│ ├── list / create / get / update / delete
│ ├── create-batch / get-by-slug
│ ├── publish / archive
│ └── translations / create-translation
├── files
│ ├── list / get / update / delete
│ ├── create-metadata
│ ├── upload / upload-by-id
│ └── multipart-init / multipart-complete / multipart-abort
├── microcopy
│ ├── list / count / create / get / update / delete
│ ├── get-by-key / get-by-language
│ └── translations / create-translation
└── status
└── version API version info
By default, commands output formatted tables. Use --json for JSON output:
adapto articles list --json
adapto articles get abc123 --jsonWhen running in a terminal (TTY), missing required parameters will be prompted interactively. When piped or in scripts, missing parameters produce an error with usage hints.
# Build
make build
# Run tests
make test
# Regenerate API client from OpenAPI spec
make generateEvery push to main automatically bumps the patch version and creates a release. For intentional minor/major bumps, use make release:
make release # patch bump (v0.1.0 → v0.1.1)
make release BUMP=minor # minor bump (v0.1.1 → v0.2.0)
make release BUMP=major # major bump (v0.2.0 → v1.0.0)Releases are built for all platforms and published to GitHub Releases:
adapto-linux-amd64adapto-linux-arm64adapto-darwin-amd64adapto-darwin-arm64adapto-windows-amd64.exe
To give an LLM agent full knowledge of the CLI (for MCP/tool-use scenarios):
adapto llm-infoThis prints a comprehensive markdown reference of every command, flag, and workflow.
MIT