### 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 "

What a year!

...

" \ --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 "

Quelle année!

...

" \ --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 "

Welcome

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 [--status ] [--language ] adapto pages create --title --content <content> --slug <slug> --language <language> [--menu-label <menu_label>] [--tags <tags>]` ### Parameters #### `list` - **`--status`** (string) - Optional - Filters pages by their status (e.g., `published`, `draft`). - **`--language`** (string) - Optional - Filters pages by language code (e.g., `en`). #### `create` - **`--title`** (string) - Required - The title of the page. - **`--content`** (string) - Required - The HTML content of the page. - **`--slug`** (string) - Required - A URL-friendly identifier for the page. - **`--language`** (string) - Required - The language code of the page (e.g., `en`). - **`--menu-label`** (string) - Optional - The label for the page in navigation menus. - **`--tags`** (string) - Optional - Comma-separated list of tags for the page. ### Request Example (List) ```bash adapto pages list --status published --language en ``` ### Request Example (Create) ```bash adapto pages create \ --title "About Us" \ --content "<p>We are a team of developers.</p>" \ --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-uri <uri>` `adapto auth callback-github --code <oauth_code> --redirect-uri <uri>` ### Parameters #### `login-github` - **`--redirect-uri`** (string) - Required - The URI to redirect to after successful GitHub authentication. #### `callback-github` - **`--code`** (string) - Required - The authorization code received from GitHub. - **`--redirect-uri`** (string) - Required - The URI used during the login initiation. ### Response Example (login-github) ```json { "auth_url": "https://github.com/login/oauth/authorize?..." } ``` ### Response Example (callback-github) ```json { "access_token": "...", "refresh_token": "..." } ``` ``` -------------------------------- ### Create Article Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Creates a new article with various metadata fields, including title, content, slug, author, language, summary, status, and tags. Supports media attachments. ```APIDOC ## `adapto articles create` — Create an article ### Description Creates a new article with specified metadata. Can be used interactively or with all flags provided. ### Method `adapto articles create --title <title> --content <content> --slug <slug> [--author <author>] [--language <language>] [--summary <summary>] [--status <status>] [--tags <tags>] [--media-json <media_json>]` ### Parameters - **`--title`** (string) - Required - The title of the article. - **`--content`** (string) - Required - The HTML content of the article. - **`--slug`** (string) - Required - A URL-friendly identifier for the article. - **`--author`** (string) - Optional - The author of the article. - **`--language`** (string) - Optional - The language code of the article (e.g., `en`). - **`--summary`** (string) - Optional - A brief summary or excerpt of the article. - **`--status`** (string) - Optional - The publication status of the article (e.g., `draft`, `published`). - **`--tags`** (string) - Optional - Comma-separated list of tags for the article. - **`--media-json`** (string) - Optional - A JSON string representing media attachments, specifying placement, media object details, and alt text. ### Request Example (Flags-only) ```bash adapto articles create \ --title "Getting Started with Adapto" \ --content "<h1>Welcome</h1><p>This is the body.</p>" \ --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 "<p>Hello</p>" \ --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 "<p>We are a team of developers.</p>" \ --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 [--language <language>] [--limit <limit>] adapto categories create --name <name> --slug <slug> [--language <language>] [--description <description>] [--parent-id <parent_id>]` ### Parameters #### `list` - **`--language`** (string) - Optional - Filters categories by language code (e.g., `en`). - **`--limit`** (integer) - Optional - Limits the number of categories returned. #### `create` - **`--name`** (string) - Required - The name of the category. - **`--slug`** (string) - Required - A URL-friendly identifier for the category. - **`--language`** (string) - Optional - The language code for the category (e.g., `en`). - **`--description`** (string) - Optional - A description for the category. - **`--parent-id`** (string) - Optional - The ID of the parent category to create a sub-category. ### Request Example (List) ```bash adapto categories list --language en --limit 50 ``` ### Request Example (Create) ```bash adapto categories create \ --name "Tutorials" \ --slug tutorials \ --language en \ --description "Step-by-step guides" ``` ### Request Example (Create Sub-category) ```bash adapto categories create \ --name "Go Tutorials" \ --slug go-tutorials \ --language en \ --parent-id cat-tutorials-uuid ``` ``` -------------------------------- ### Adapto CLI `auth refresh` Command Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Refreshes the access token for the current Adapto CMS session and updates stored credentials. ```bash adapto auth refresh # Token refreshed. Credentials updated. ``` -------------------------------- ### Enable JSON Output Mode Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Append `--json` to any command to receive structured JSON output, ideal for scripting and automation. This allows easy parsing with tools like `jq`. ```bash # Pipe article list into jq to extract IDs adapto articles list --status published --language en --limit 100 --json \ | jq -r '.items[].id' ``` ```bash # Get a single article as JSON adapto articles get article-uuid --json ``` ```bash # Capture file URL after upload FILE_URL=$(adapto files upload ./hero.jpg --json | jq -r '.url') echo "Uploaded to: $FILE_URL" ``` -------------------------------- ### List Article Categories Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Retrieves a list of categories associated with a specific article. ```bash adapto articles categories article-uuid # Category ID # cat-abc # cat-def ``` -------------------------------- ### List Articles Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Lists articles with support for pagination, filtering by status, language, tags, and categories. Can output in a formatted table or JSON. ```APIDOC ## `adapto articles list` — List articles ### Description Lists articles with pagination and filtering capabilities. The output can be a formatted table or JSON. ### Method `adapto articles list [--status <status>] [--language <language>] [--tag <tag>] [--category <category_id>] [--page <page_number>] [--limit <items_per_page>] [--json]` ### Parameters - **`--status`** (string) - Optional - Filters articles by their status (e.g., `published`, `draft`). - **`--language`** (string) - Optional - Filters articles by language code (e.g., `en`). - **`--tag`** (string) - Optional - Filters articles by a specific tag. - **`--category`** (string) - Optional - Filters articles by category ID. - **`--page`** (integer) - Optional - Specifies the page number for pagination. - **`--limit`** (integer) - Optional - Specifies the number of items per page. - **`--json`** - Optional - Outputs the result in JSON format. ### Request Example ```bash # List published English articles, newest 20 adapto articles list --status published --language en --limit 20 # Filter by tag and category, with pagination adapto articles list --tag golang --category cat-123 --page 2 --limit 10 # JSON output for scripting adapto articles list --status published --json ``` ### Response Example (JSON) ```json { "items": [...], "total": 42, "page": 1, "pages": 3 } ``` ``` -------------------------------- ### Article Lifecycle Commands Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Commands to manage the lifecycle of an article, including publishing, archiving, and deleting. ```APIDOC ## `adapto articles publish` / `archive` / `delete` — Lifecycle commands ### Description Commands to change the status or remove articles. ### Method `adapto articles publish <article_id> adapto articles archive <article_id> adapto articles delete <article_id>` ### Parameters - **`article_id`** (string) - Required - The unique ID of the article to act upon. ### Request Example ```bash adapto articles publish article-uuid # Article published. adapto articles archive article-uuid # Article archived. adapto articles delete article-uuid # Article deleted. ``` ``` -------------------------------- ### Google OAuth Login Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Authenticates with Google OAuth using an ID token to obtain access and refresh tokens. ```bash adapto auth login-google --credential GOOGLE_ID_TOKEN # {"access_token": "...", "refresh_token": "..."} ``` -------------------------------- ### Manage Category Membership Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Adds or removes articles from categories and lists articles within a category. ```bash adapto categories add-article cat-uuid article-uuid # Article added to category. ``` ```bash adapto categories remove-article cat-uuid article-uuid # Article removed from category. ``` ```bash adapto categories articles cat-uuid # Article ID # article-abc ``` -------------------------------- ### Google OAuth Authentication Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Command for authenticating using Google OAuth with an ID token. ```APIDOC ## `adapto auth login-google` — Google OAuth ### Description Authenticates the user using a Google ID token and returns access and refresh tokens. ### Method `adapto auth login-google --credential <google_id_token>` ### Parameters - **`--credential`** (string) - Required - The Google ID token for authentication. ### Response Example ```json { "access_token": "...", "refresh_token": "..." } ``` ``` -------------------------------- ### Page Lifecycle Commands Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Commands to manage the lifecycle of a CMS page, including publishing and archiving. Also includes retrieving a page by its slug. ```APIDOC ## `adapto pages publish` / `archive` / `get-by-slug` — Page lifecycle ### Description Manages the lifecycle of CMS pages, including publishing, archiving, and retrieving pages by their slug. ### Method `adapto pages publish <page_id> adapto pages archive <page_id> adapto pages get-by-slug <page_slug> [--json]` ### Parameters #### `publish` / `archive` - **`page_id`** (string) - Required - The unique ID of the page. #### `get-by-slug` - **`page_slug`** (string) - Required - The slug of the page to retrieve. - **`--json`** - Optional - Outputs the page details in JSON format. ### Request Example (Publish) ```bash adapto pages publish page-uuid # Page published. ``` ### Request Example (Archive) ```bash adapto pages archive page-uuid # Page archived. ``` ### Request Example (Get by Slug) ```bash adapto pages get-by-slug about-us --json ``` ``` -------------------------------- ### List Child Categories Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Retrieves a list of sub-categories for a given category. ```bash adapto categories subcategories cat-uuid # ID Name Language Slug # ... ``` -------------------------------- ### Translate Categories Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Commands for creating translated versions of categories. ```APIDOC ## `adapto categories translations` / `create-translation` — Translate categories ### Description Manages translations for categories, allowing the creation of new translated versions. ### Method `adapto categories create-translation <category_id> --name <name> --slug <slug> --language <language>` ### Parameters - **`category_id`** (string) - Required - The ID of the category to translate. - **`--name`** (string) - Required - The name of the translated category. - **`--slug`** (string) - Required - The slug for the translated category. - **`--language`** (string) - Required - The language code for the translation (e.g., `fr`). ### Request Example ```bash adapto categories create-translation cat-uuid \ --name "Tutoriels" \ --slug tutoriels \ --language fr ``` ``` -------------------------------- ### Update an Article Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Updates an existing article. Only the fields specified via flags will be modified; omitted fields remain unchanged. ```bash adapto articles update article-uuid \ --title "Updated Title" \ --status published \ --tags "cms,updated" ``` -------------------------------- ### Retrieve Article Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Retrieves a specific article either by its unique ID or by its slug. Can output in JSON format. ```APIDOC ## `adapto articles get` / `get-by-slug` — Retrieve an article ### Description Retrieves a single article using its unique identifier or slug. Supports JSON output for programmatic use. ### Method `adapto articles get <article_id> [--json] adapto articles get-by-slug <article_slug> [--json]` ### Parameters - **`article_id`** (string) - Required - The unique ID of the article to retrieve. - **`article_slug`** (string) - Required - The slug of the article to retrieve. - **`--json`** - Optional - Outputs the article details in JSON format. ### Request Example ```bash adapto articles get article-uuid adapto articles get-by-slug getting-started-with-adapto adapto articles get article-uuid --json ``` ``` -------------------------------- ### Article Translations Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Commands for managing multilingual versions of articles, including listing existing translations and creating new ones. ```APIDOC ## `adapto articles translations` / `create-translation` — Multilingual articles ### Description Manages translations for articles, allowing listing of all language variants and creation of new translations. ### Method `adapto articles translations <article_id> adapto articles create-translation <article_id> --title <title> --content <content> --slug <slug> [--author <author>] [--language <language>]` ### Parameters #### `translations` - **`article_id`** (string) - Required - The ID of the article for which to list translations. #### `create-translation` - **`article_id`** (string) - Required - The ID of the base article for which to create a translation. - **`--title`** (string) - Required - The title of the translated article. - **`--content`** (string) - Required - The HTML content of the translated article. - **`--slug`** (string) - Required - The slug for the translated article. - **`--author`** (string) - Optional - The author of the translated article. - **`--language`** (string) - Required - The language code for the new translation (e.g., `fr`). ### Request Example (List Translations) ```bash adapto articles translations article-uuid ``` ### Request Example (Create Translation) ```bash adapto articles create-translation article-uuid \ --title "Premiers pas" \ --content "<p>Bienvenue.</p>" \ --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 <category_id> <article_id> adapto categories remove-article <category_id> <article_id> adapto categories articles <category_id>` ### Parameters #### `add-article` / `remove-article` - **`category_id`** (string) - Required - The ID of the category. - **`article_id`** (string) - Required - The ID of the article. #### `articles` - **`category_id`** (string) - Required - The ID of the category whose articles are to be listed. ### Request Example (Add Article) ```bash adapto categories add-article cat-uuid article-uuid # Article added to category. ``` ### Request Example (Remove Article) ```bash adapto categories remove-article cat-uuid article-uuid # Article removed from category. ``` ### Request Example (List Articles in Category) ```bash adapto categories articles cat-uuid ``` ### Response Example (List Articles) ``` Article ID article-abc ``` ``` -------------------------------- ### List Article Categories Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Retrieves a list of categories associated with a specific article. ```APIDOC ## `adapto articles categories` — List article categories ### Description Lists all categories that a specific article belongs to. ### Method `adapto articles categories <article_id>` ### Parameters - **`article_id`** (string) - Required - The ID of the article whose categories are to be listed. ### Request Example ```bash adapto articles categories article-uuid ``` ### Response Example ``` Category ID cat-abc cat-def ``` ``` -------------------------------- ### Update or Delete Microcopy Entries Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Use the `update` command to modify the value of a microcopy entry identified by its UUID. Use the `delete` command to remove an entry. A confirmation message is displayed upon successful deletion. ```bash adapto microcopy update mc-uuid --value "Go Home" adapto microcopy delete mc-uuid # Micro copy entry deleted. ``` -------------------------------- ### Update Article Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Updates an existing article. Only the fields specified in the command are modified; omitted fields remain unchanged. ```APIDOC ## `adapto articles update` — Update an article ### Description Updates an existing article by providing new values for specified fields. Fields not included in the command remain unchanged. ### Method `adapto articles update <article_id> [--title <title>] [--content <content>] [--slug <slug>] [--author <author>] [--language <language>] [--summary <summary>] [--status <status>] [--tags <tags>]` ### Parameters - **`article_id`** (string) - Required - The unique ID of the article to update. - **`--title`** (string) - Optional - The new title for the article. - **`--content`** (string) - Optional - The new HTML content for the article. - **`--slug`** (string) - Optional - The new slug for the article. - **`--author`** (string) - Optional - The new author for the article. - **`--language`** (string) - Optional - The new language code for the article. - **`--summary`** (string) - Optional - The new summary for the article. - **`--status`** (string) - Optional - The new status for the article. - **`--tags`** (string) - Optional - A new comma-separated list of tags for the article. ### Request Example ```bash adapto articles update article-uuid \ --title "Updated Title" \ --status published \ --tags "cms,updated" ``` ``` -------------------------------- ### List Subcategories Source: https://context7.com/adaptocms/adapto-cms-cli/llms.txt Retrieves a list of direct child categories for a given category. ```APIDOC ## `adapto categories subcategories` — List child categories ### Description Lists the direct subcategories of a specified category. ### Method `adapto categories subcategories <category_id>` ### Parameters - **`category_id`** (string) - Required - The ID of the parent category. ### Request Example ```bash adapto categories subcategories cat-uuid ``` ### Response Example ``` ID Name Language Slug ... ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.