### Install Adapto CMS CLI from Source Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Installs the CLI by building from the Go source code. ```bash go install github.com/adaptocms/adapto-cms-cli@latest ``` -------------------------------- ### Install Adapto CMS CLI Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Installs the Adapto CMS CLI using a script for macOS/Linux or from source using Go. ```bash # Quick install (macOS / Linux) curl -sSL https://raw.githubusercontent.com/adaptocms/adapto-cms-cli/main/scripts/install.sh | bash ``` ```bash # From source go install github.com/adaptocms/adapto-cms-cli@latest ``` -------------------------------- ### Install Adapto CMS CLI (macOS/Linux) Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Installs the CLI using a curl script for macOS and Linux systems. ```bash curl -sSL https://raw.githubusercontent.com/adaptocms/adapto-cms-cli/main/scripts/install.sh | bash ``` -------------------------------- ### Create Article with Adapto CMS CLI Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Creates a new article. Interactive prompts will guide you for missing fields. Alternatively, provide all details using flags. ```bash adapto articles create ``` ```bash adapto articles create \ --title "My Article" \ --content "Hello world" \ --slug "my-article" \ --author "Jane" \ --language "en" ``` -------------------------------- ### Get LLM CLI reference Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Run 'adapto llm-info' to obtain a comprehensive markdown reference of all CLI commands, flags, and workflows, useful for LLM integration. ```bash adapto llm-info ``` -------------------------------- ### Get JSON output for articles list Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Use the --json flag to get command output in JSON format, useful for scripting and programmatic access. ```bash adapto articles list --json ``` -------------------------------- ### Get JSON output for a specific article Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Retrieve a specific article by its ID in JSON format by appending the --json flag to the get command. ```bash adapto articles get abc123 --json ``` -------------------------------- ### Build the Adapto CMS CLI Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Run the make build command to compile the CLI application. ```bash make build ``` -------------------------------- ### Full Article Publishing Workflow Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt This workflow outlines the steps for publishing an article: logging in, uploading media, creating the article with media attachments, categorizing it, creating translations, and finally publishing. ```bash # 1. Login adapto auth login --email editor@example.com --password secret # 2. Upload a hero image adapto files upload ./hero.jpg # Note the returned file ID: file-uuid # 3. Create draft article with hero image adapto articles create \ --title "2024 Year in Review" \ --content "
...
" \ --slug 2024-year-in-review \ --author "Editor" \ --language en \ --summary "Our highlights from 2024" \ --tags "review,2024" \ --media-json '[{"placement_key":"hero_image","media_object":{"id":"m1","file_id":"file-uuid","url":"https://cdn.example.com/hero.jpg","type":"image"},"alt_text":"Year in review"}]' # 4. Add to a category adapto categories add-article cat-uuid article-uuid # 5. Create a French translation adapto articles create-translation article-uuid \ --title "Bilan 2024" \ --content "...
" \ --slug bilan-2024 \ --author "Rédactrice" \ --language fr # 6. Publish both adapto articles publish article-uuid adapto articles publish fr-article-uuid ``` -------------------------------- ### Adapto CLI `auth orgs` Command Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Lists all organizations and their associated tenants that the current user has access to. ```bash adapto auth orgs # Organization: Acme Corp (org-111) # Tenant: Production (tenant-abc123) (active) [en fr de] # Tenant: Staging (tenant-def456) [en] ``` -------------------------------- ### Batch Populate Custom Collection Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt This workflow demonstrates creating a new collection, then populating it with multiple items in a batch using `--items-json`. Finally, it shows how to publish all items in the collection. ```bash adapto collections create \ --name "FAQ" --slug faq --description "Frequently Asked Questions" --language en adapto collections items create-batch col-uuid \ --items-json '[ {"title":"What is Adapto?","slug":"what-is-adapto","language":"en","data":{"answer":"A headless CMS."}}, {"title":"How do I install?","slug":"how-install","language":"en","data":{"answer":"Run the install script."}} ]' # Publish all items adapto collections items list col-uuid --json \ | jq -r '.items[].id' \ | xargs -I{} adapto collections items publish col-uuid {} ``` -------------------------------- ### Create an Article Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Creates a new article using provided metadata. Supports flags-only creation or inclusion of media objects like hero images via JSON. ```bash # Flags-only (non-interactive) adapto articles create \ --title "Getting Started with Adapto" \ --content "This is the body.
" \ --slug getting-started-with-adapto \ --author "Editorial Team" \ --language en \ --summary "An introduction to Adapto CMS" \ --status draft \ --tags "cms,tutorial" ``` ```bash # With a hero image (media object) adapto articles create \ --title "My Post" \ --content "Hello
" \ --slug my-post \ --author "Jane" \ --language en \ --media-json '[{ "placement_key": "hero_image", "media_object": { "id": "m1", "file_id": "file-uuid-here", "url": "https://cdn.example.com/photo.jpg", "type": "image" }, "alt_text": "Hero image" }]' # ID article-uuid # Title My Post # Slug my-post # Status draft # Language en # Author Jane ``` -------------------------------- ### List Articles with Adapto CMS CLI Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Retrieves a list of articles. Use the --json flag for machine-readable output. ```bash adapto articles list ``` ```bash adapto articles list --json ``` -------------------------------- ### Run tests for the Adapto CMS CLI Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Execute the make test command to run the test suite for the CLI. ```bash make test ``` -------------------------------- ### Adapto CLI Account Activation Commands Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Activates an account using an activation token or resends the activation email if needed. ```bash adapto auth activate --token ACTIVATION_TOKEN # Account activated successfully. ``` ```bash adapto auth resend-activation --email user@example.com ``` -------------------------------- ### Adapto CLI `auth login` Command Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Logs into Adapto CMS, saving credentials. Supports interactive prompts or non-interactive login with email and password. Can output credentials path and tenant ID in JSON format. ```bash # Login interactively (prompts for email and password if omitted) adapto auth login ``` ```bash # Non-interactive (useful in CI) adapto auth login --email user@example.com --password secret # Output: # Logged in. Credentials saved to /home/user/.config/adapto/credentials.json # Active tenant: tenant-abc123 ``` ```bash # View the stored credentials path (JSON output) adapto auth login --email user@example.com --password secret --json # { # "message": "Logged in successfully", # "credentials_path": "/home/user/.config/adapto/credentials.json", # "tenant_id": "tenant-abc123" # } ``` -------------------------------- ### List Articles with Filtering and Pagination Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Lists articles with options for filtering by status and language, and for pagination. Use the --json flag for machine-readable output. ```bash # List published English articles, newest 20 adapto articles list --status published --language en --limit 20 ``` ```bash # Filter by tag and category adapto articles list --tag golang --category cat-123 --page 2 --limit 10 ``` ```bash # JSON output for scripting adapto articles list --status published --json # { # "items": [...], # "total": 42, # "page": 1, # "pages": 3 # } ``` -------------------------------- ### Perform a patch release Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Execute 'make release' to automatically bump the patch version and create a new release. ```bash make release ``` -------------------------------- ### Adapto CLI `auth switch-tenant` Command Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Switches the active tenant for the current CLI session. Can be done interactively or by specifying the tenant ID. ```bash # Interactive picker (TTY) adapto auth switch-tenant ``` ```bash # Non-interactive adapto auth switch-tenant --tenant-id tenant-def456 # Switched to tenant: tenant-def456 ``` -------------------------------- ### Adapto CLI `auth register` Command Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Registers a new Adapto CMS account with email, password, first name, and last name. ```bash adapto auth register \ --email newuser@example.com \ --password mysecretpass \ --first-name Jane \ --last-name Doe # Registration successful. Check your email to activate your account. ``` -------------------------------- ### Retrieve Microcopy by Key or Language Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Use `get-by-key` to fetch a specific microcopy entry by its key and language. Use `get-by-language` to retrieve all entries for a given language. Append `--json` for structured output. ```bash adapto microcopy get-by-key nav.home --language en ``` ```bash adapto microcopy get-by-language fr ``` ```bash adapto microcopy get-by-language en --json ``` -------------------------------- ### Upload File with Adapto CMS CLI Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Uploads files to Adapto CMS. Supports a single-step upload or a two-step process involving metadata creation first. ```bash adapto files upload ./photo.jpg ``` ```bash adapto files create-metadata --filename photo.jpg --content-type image/jpeg ``` ```bash adapto files upload-by-id FILE_ID ./photo.jpg ``` -------------------------------- ### Perform a major release Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Run 'make release BUMP=major' to increment the major version and create a new release. ```bash make release BUMP=major ``` -------------------------------- ### Generate LLM CLI Reference Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt The `adapto llm-info` command generates a comprehensive markdown reference for all LLM agent commands, flags, and workflows within the CLI. ```bash # Prints a comprehensive markdown reference of every command, flag, and workflow adapto llm-info ``` -------------------------------- ### Create Microcopy Entries from JSON Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt This script reads a JSON array of microcopy entries and creates them using the Adapto CMS CLI. Ensure microcopy.json is correctly formatted. ```bash jq -c '.[]' microcopy.json | while IFS= read -r entry; do key=$(echo "$entry" | jq -r '.key') value=$(echo "$entry" | jq -r '.value') lang=$(echo "$entry" | jq -r '.language') adapto microcopy create --key "$key" --value "$value" --language "$lang" done ``` -------------------------------- ### Display CLI Version Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Use `adapto version` to display the current version of the Adapto CMS CLI. ```bash adapto version # adapto v0.2.1 ``` -------------------------------- ### Login to Adapto CMS CLI Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Authenticates with the Adapto CMS API. Credentials are automatically saved for subsequent commands. ```bash adapto auth login --email you@example.com --password yourpassword ``` -------------------------------- ### Adapto CLI `auth me` Command Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Retrieves information about the currently authenticated user. Supports both table and JSON output formats. ```bash adapto auth me # ID abc-123 # Email user@example.com # Status active # Verified true # First Name Jane # Last Name Doe ``` ```bash adapto auth me --json # {"user":{"id":"abc-123","email":"user@example.com","status":"active","is_email_verified":true,...}} ``` -------------------------------- ### Perform a minor release Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Use 'make release BUMP=minor' to increment the minor version and create a new release. ```bash make release BUMP=minor ``` -------------------------------- ### Article Lifecycle Commands Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Manages the lifecycle of an article, including publishing, archiving, and deleting. ```bash adapto articles publish article-uuid # Article published. ``` ```bash adapto articles archive article-uuid # Article archived. ``` ```bash adapto articles delete article-uuid # Article deleted. ``` -------------------------------- ### Attach Media to Article with Adapto CMS CLI Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Attaches media objects (images, videos, etc.) to articles using the --media-json flag. This flag is also compatible with page and collection item commands. ```bash adapto articles create \ --title "My Post" \ --content "Hello
" \ --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" }]' ``` -------------------------------- ### Manage Categories Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Lists existing categories, creates new ones, and supports creating sub-categories by specifying a parent ID. ```bash adapto categories list --language en --limit 50 ``` ```bash adapto categories create \ --name "Tutorials" \ --slug tutorials \ --language en \ --description "Step-by-step guides" ``` ```bash # Create a sub-category adapto categories create \ --name "Go Tutorials" \ --slug go-tutorials \ --language en \ --parent-id cat-tutorials-uuid ``` -------------------------------- ### GitHub OAuth Login and Callback Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Initiates the GitHub OAuth flow to obtain an authorization URL and completes the callback to exchange an authorization code for access tokens. ```bash adapto auth login-github --redirect-uri https://myapp.com/callback # {"auth_url": "https://github.com/login/oauth/authorize?..."} ``` ```bash adapto auth callback-github --code OAUTH_CODE --redirect-uri https://myapp.com/callback # {"access_token": "...", "refresh_token": "..."} ``` -------------------------------- ### Regenerate API client Source: https://github.com/adaptocms/adapto-cms-cli/blob/main/README.md Use make generate to regenerate the API client based on the OpenAPI specification. ```bash make generate ``` -------------------------------- ### Check API Health and Version Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Use `adapto status version` to check the health of the API. Appending `--json` provides the status information in a structured JSON format. ```bash adapto status version ``` ```bash adapto status version --json ``` -------------------------------- ### Manage Article Translations Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Lists all language variants of an article and creates new translations for existing articles. ```bash # List all language variants adapto articles translations article-uuid ``` ```bash # Create a French translation adapto articles create-translation article-uuid \ --title "Premiers pas" \ --content "Bienvenue.
" \ --slug premiers-pas \ --author "Équipe éditoriale" \ --language fr ``` -------------------------------- ### Adapto CLI Password Reset Commands Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Initiates the password reset flow by requesting a reset email and then performing the reset with a token. ```bash adapto auth request-password-reset --email user@example.com # Password reset email sent. Check your inbox. ``` ```bash adapto auth reset-password --token RESET_TOKEN --new-password newpass # Password reset successfully. ``` -------------------------------- ### Retrieve an Article by ID or Slug Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Retrieves a specific article using its unique identifier or its slug. Can output in JSON format. ```bash adapto articles get article-uuid ``` ```bash adapto articles get-by-slug getting-started-with-adapto ``` ```bash adapto articles get article-uuid --json ``` -------------------------------- ### Attach Media Objects to Articles Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Use the `--media-json` flag with `articles update` to attach media objects like images and videos to an article. The value must be a JSON array of placement objects, each specifying placement, media details, alt text, and caption. ```bash # Attach a hero image and an embedded YouTube video to an article adapto articles update article-uuid \ --media-json '[ { "placement_key": "hero_image", "media_object": { "id": "m1", "file_id": "file-uuid", "url": "https://cdn.example.com/hero.jpg", "type": "image", "title": "Hero banner" }, "alt_text": "Aerial view of our campus", "caption": "Our headquarters" }, { "placement_key": "intro_video", "media_object": { "id": "m2", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "type": "youtube", "title": "Introduction video" } } ]' ``` -------------------------------- ### Page Lifecycle Commands Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Manages the lifecycle of CMS pages, including publishing, retrieving by slug, and archiving. ```bash adapto pages publish page-uuid # Page published. ``` ```bash adapto pages get-by-slug about-us --json ``` ```bash adapto pages archive page-uuid ``` -------------------------------- ### Manage CMS Pages Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Commands for listing existing CMS pages and creating new ones, with support for various metadata fields. ```APIDOC ## `adapto pages list` / `create` — Manage CMS pages ### Description Manages CMS pages, allowing listing of existing pages and creation of new ones with specified properties. ### Method `adapto pages list [--statusWe are a team of developers.
" \ --slug about-us \ --language en \ --menu-label "About" \ --tags "company,about" ``` ``` -------------------------------- ### GitHub OAuth Authentication Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Commands for initiating GitHub OAuth flow and completing the callback. ```APIDOC ## `adapto auth login-github` / `callback-github` — GitHub OAuth ### Description Initiates the GitHub OAuth flow to authenticate users and handles the callback to exchange the authorization code for access tokens. ### Method `adapto auth login-github --redirect-uriThis is the body.
" \ --slug getting-started-with-adapto \ --author "Editorial Team" \ --language en \ --summary "An introduction to Adapto CMS" \ --status draft \ --tags "cms,tutorial" ``` ### Request Example (With Hero Image) ```bash adapto articles create \ --title "My Post" \ --content "Hello
" \ --slug my-post \ --author "Jane" \ --language en \ --media-json '[{ "placement_key": "hero_image", "media_object": { "id": "m1", "file_id": "file-uuid-here", "url": "https://cdn.example.com/photo.jpg", "type": "image" }, "alt_text": "Hero image" }]' ``` ### Response Example ``` ID article-uuid Title My Post Slug my-post Status draft Language en Author Jane ``` ``` -------------------------------- ### Adapto CLI `auth change-password` Command Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Changes the password for the currently authenticated user, requiring the current password. ```bash adapto auth change-password \ --current-password oldpass \ --new-password newpass # Password changed successfully. ``` -------------------------------- ### Translate Microcopy Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Use `create-translation` to add a translated version of an existing microcopy entry. You can specify the source microcopy ID, key, value, and target language. Use `translations` to list existing translations for an entry. ```bash # Translate an existing entry to French adapto microcopy create-translation SOURCE_MC_ID \ --key "nav.home" \ --value "Accueil" \ --language fr adapto microcopy translations SOURCE_MC_ID # ID Key Value Language # ... ``` -------------------------------- ### Translate Categories Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Creates translated versions of existing categories. ```bash adapto categories create-translation cat-uuid \ --name "Tutoriels" \ --slug tutoriels \ --language fr ``` -------------------------------- ### Manage CMS Pages Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Lists existing CMS pages with filtering options and creates new pages with specified content and metadata. ```bash adapto pages list --status published --language en ``` ```bash adapto pages create \ --title "About Us" \ --content "We are a team of developers.
" \ --slug about-us \ --language en \ --menu-label "About" \ --tags "company,about" ``` -------------------------------- ### Adapto CLI `auth logout` Command Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Logs out of Adapto CMS by revoking the current token and clearing stored credentials. ```bash adapto auth logout # Logged out successfully. Credentials cleared. ``` -------------------------------- ### Manage Categories Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Commands for listing existing categories and creating new ones, with support for sub-categories and language specification. ```APIDOC ## `adapto categories list` / `create` — Manage categories ### Description Manages categories, allowing listing of existing categories and creation of new ones, including sub-categories. ### Method `adapto categories list [--languageBienvenue.
" \ --slug premiers-pas \ --author "Équipe éditoriale" \ --language fr ``` ``` -------------------------------- ### Category Membership Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Commands to manage the association of articles with categories, including adding and removing articles, and listing articles within a category. ```APIDOC ## `adapto categories add-article` / `remove-article` — Category membership ### Description Manages the relationship between articles and categories, allowing articles to be added to or removed from categories, and listing articles within a category. ### Method `adapto categories add-article