> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmaito.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands

> Complete command reference for the Maito CLI with examples for every exposed command.

Every command supports `--json` unless noted otherwise. Commands that call the API also support API-key auth with `--api-key` or `MAITO_API_KEY`.

## Auth

| Command                    | Use                                                           | Example                                         |
| -------------------------- | ------------------------------------------------------------- | ----------------------------------------------- |
| `maito login`              | Sign in.                                                      | `maito login`                                   |
| `maito logout`             | Remove the saved sign-in session.                             | `maito logout`                                  |
| `maito auth status`        | Show sign-in, stored API-key, and environment API-key status. | `maito auth status --json`                      |
| `maito auth use-api-key`   | Store an API key.                                             | `maito auth use-api-key --api-key maito_sk_123` |
| `maito auth clear-api-key` | Remove the stored API key.                                    | `maito auth clear-api-key`                      |

## API Keys

Sign in before using these commands. API keys cannot manage API keys.

| Command                 | Use                      | Example                                                            |
| ----------------------- | ------------------------ | ------------------------------------------------------------------ |
| `maito api-keys list`   | List API keys.           | `maito api-keys list --json`                                       |
| `maito api-keys create` | Create an API key.       | `maito api-keys create --name "ci-import" --expiration 90d --json` |
| `maito api-keys revoke` | Revoke an API key by ID. | `maito api-keys revoke --api-key-id key_123`                       |

Supported expiration values are `never`, `1d`, `7d`, `30d`, `60d`, `90d`, and `180d`.

## Posts

Post commands work with X and LinkedIn posts.

| Command                  | Use                                        | Example                                                                                                |
| ------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `maito posts list`       | List posts.                                | `maito posts list --limit 20`                                                                          |
| `maito posts get`        | Get a post by ID.                          | `maito posts get --post-id post_123 --json`                                                            |
| `maito posts archive`    | Archive a post.                            | `maito posts archive --post-id post_123`                                                               |
| `maito posts create`     | Create a post from flags.                  | `maito posts create --body "Launch post" --platform linkedin`                                          |
| `maito posts create`     | Create a post from JSON.                   | `maito posts create --payload-json '{"body":"Short post","platform":"x","metadata":{"source":"cli"}}'` |
| `maito posts revise`     | Create a new post revision.                | `maito posts revise --post-id post_123 --body "Revised post" --platform linkedin --base-revision 1`    |
| `maito posts schedule`   | Schedule a post.                           | `maito posts schedule --post-id post_123 --scheduled-for 2026-07-01T14:00:00.000Z --platform linkedin` |
| `maito posts publish`    | Publish a post immediately.                | `maito posts publish --post-id post_123 --platform linkedin`                                           |
| `maito posts unschedule` | Remove a scheduled post for a destination. | `maito posts unschedule --post-id post_123 --destination-id connection_123`                            |

`--platform` must be `x` or `linkedin`.

## Account Sets

Account sets group publishing context and connected social accounts.

| Command                                     | Use                                      | Example                                                                                                                                     |
| ------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `maito account-sets list`                   | List account sets.                       | `maito account-sets list --is-active true`                                                                                                  |
| `maito account-sets switcher`               | Get switcher data for account sets.      | `maito account-sets switcher --json`                                                                                                        |
| `maito account-sets create`                 | Create an account set.                   | `maito account-sets create --name "Founder" --description "Founder voice"`                                                                  |
| `maito account-sets update`                 | Update account-set fields.               | `maito account-sets update --account-set-id aset_123 --name "Founder Notes"`                                                                |
| `maito account-sets archive`                | Archive an account set.                  | `maito account-sets archive --account-set-id aset_123`                                                                                      |
| `maito account-sets set-active`             | Make an account set active.              | `maito account-sets set-active --account-set-id aset_123`                                                                                   |
| `maito account-sets set-default-account`    | Set or clear the default social account. | `maito account-sets set-default-account --account-set-id aset_123 --social-account-id connection_123`                                       |
| `maito account-sets accounts`               | List social accounts in an account set.  | `maito account-sets accounts --account-set-id aset_123`                                                                                     |
| `maito account-sets profile-context`        | Get profile context for an account set.  | `maito account-sets profile-context --account-set-id aset_123 --json`                                                                       |
| `maito account-sets update-profile-context` | Update profile context from JSON.        | `maito account-sets update-profile-context --account-set-id aset_123 --payload-json '{"headline":"Founder writing about owned audience."}'` |

## Social

| Command                     | Use                                 | Example                                                  |
| --------------------------- | ----------------------------------- | -------------------------------------------------------- |
| `maito social destinations` | List connected social destinations. | `maito social destinations --json`                       |
| `maito social providers`    | List supported social providers.    | `maito social providers`                                 |
| `maito social disconnect`   | Disconnect a social destination.    | `maito social disconnect --connection-id connection_123` |

## Queue

| Command                | Use                             | Example                                                                                  |
| ---------------------- | ------------------------------- | ---------------------------------------------------------------------------------------- |
| `maito queue list`     | List publish queue items.       | `maito queue list --status failed --platform linkedin --limit 20`                        |
| `maito queue retry`    | Retry a queue item.             | `maito queue retry --queue-item-id queue_123`                                            |
| `maito queue retry`    | Retry with a JSON payload.      | `maito queue retry --queue-item-id queue_123 --payload-json '{"reason":"manual_retry"}'` |
| `maito queue delete`   | Delete a queue item.            | `maito queue delete --queue-item-id queue_123`                                           |
| `maito queue attempts` | List attempts for a queue item. | `maito queue attempts --queue-item-id queue_123 --json`                                  |

## Billing

| Command                          | Use                              | Example                                                                                                                                              |
| -------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `maito billing status`           | Get billing status.              | `maito billing status --json`                                                                                                                        |
| `maito billing checkout-session` | Create a checkout session.       | `maito billing checkout-session --payload-json '{"plan":"pro","successUrl":"https://example.com/success","cancelUrl":"https://example.com/cancel"}'` |
| `maito billing change-plan`      | Change the current plan.         | `maito billing change-plan --payload-json '{"plan":"pro"}'`                                                                                          |
| `maito billing portal-session`   | Create a billing portal session. | `maito billing portal-session --payload-json '{"returnUrl":"https://example.com/settings"}'`                                                         |

## Calendar

| Command                            | Use                         | Example                                                                                        |
| ---------------------------------- | --------------------------- | ---------------------------------------------------------------------------------------------- |
| `maito calendar time-slots`        | Get calendar time slots.    | `maito calendar time-slots --json`                                                             |
| `maito calendar get-time-slots`    | Alias for `time-slots`.     | `maito calendar get-time-slots --json`                                                         |
| `maito calendar update-time-slots` | Update calendar time slots. | `maito calendar update-time-slots --payload-json '{"timezone":"America/New_York","slots":[]}'` |

## Feature Requests

| Command                         | Use                       | Example                                                                                                                      |
| ------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `maito feature-requests create` | Create a feature request. | `maito feature-requests create --payload-json '{"title":"Add saved views","description":"Let me save subscriber filters."}'` |

## Media

| Command                    | Use                                | Example                                                                                                                   |
| -------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `maito media upload`       | Upload a batch of media from JSON. | `maito media upload --payload-json '{"files":[{"filename":"hero.png","contentType":"image/png","base64":"..."}]}' --json` |
| `maito media upload-batch` | Alias for `upload`.                | `maito media upload-batch --payload-file media.json --json`                                                               |

## Tools

| Command                                         | Use                                  | Example                                                                                                                                         |
| ----------------------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `maito tools linkedin-video resolve`            | Resolve LinkedIn video metadata.     | `maito tools linkedin-video resolve --payload-json '{"url":"https://www.linkedin.com/posts/..."}' --json`                                       |
| `maito tools linkedin-headlines generate`       | Generate LinkedIn headline options.  | `maito tools linkedin-headlines generate --payload-json '{"profile":"Founder building newsletter software."}' --json`                           |
| `maito tools personal-brand-statement generate` | Generate a personal brand statement. | `maito tools personal-brand-statement generate --payload-json '{"background":"Founder and publisher","audience":"newsletter creators"}' --json` |

## Newsletter Settings

| Command                                           | Use                                       | Example                                                                                                             |
| ------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `maito newsletter settings get`                   | Get newsletter settings.                  | `maito newsletter settings get --json`                                                                              |
| `maito newsletter settings update`                | Update newsletter settings.               | `maito newsletter settings update --payload-json '{"publicationName":"Maito Weekly"}'`                              |
| `maito newsletter email-provider-settings get`    | Get email provider settings.              | `maito newsletter email-provider-settings get --json`                                                               |
| `maito newsletter email-provider-settings update` | Update email provider settings.           | `maito newsletter email-provider-settings update --payload-file email-provider.json`                                |
| `maito newsletter admin operations-dashboard`     | Get newsletter operations dashboard data. | `maito newsletter admin operations-dashboard --json`                                                                |
| `maito newsletter sender-verification request`    | Request sender verification.              | `maito newsletter sender-verification request --json`                                                               |
| `maito newsletter sender-verification check`      | Check sender verification.                | `maito newsletter sender-verification check --json`                                                                 |
| `maito newsletter social-embed-preview create`    | Create a social embed preview.            | `maito newsletter social-embed-preview create --payload-json '{"url":"https://www.linkedin.com/posts/..."}' --json` |

## Newsletter Domains

| Command                                    | Use                                   | Example                                                                                    |
| ------------------------------------------ | ------------------------------------- | ------------------------------------------------------------------------------------------ |
| `maito newsletter domains list`            | List newsletter domains.              | `maito newsletter domains list --json`                                                     |
| `maito newsletter domains upsert-web`      | Create or update the web domain.      | `maito newsletter domains upsert-web --payload-json '{"domain":"newsletter.example.com"}'` |
| `maito newsletter domains upsert-redirect` | Create or update the redirect domain. | `maito newsletter domains upsert-redirect --payload-json '{"domain":"go.example.com"}'`    |
| `maito newsletter domains check`           | Check DNS status for a domain.        | `maito newsletter domains check --domain-id domain_123 --json`                             |
| `maito newsletter domains delete`          | Delete a domain.                      | `maito newsletter domains delete --domain-id domain_123`                                   |

## Newsletter Subscribers

| Command                                      | Use                              | Example                                                                                                             |                                                      |
| -------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `maito newsletter subscribers list`          | List subscribers.                | `maito newsletter subscribers list --query alice --limit 25 --json`                                                 |                                                      |
| `maito newsletter subscribers create`        | Create a subscriber.             | `maito newsletter subscribers create --payload-json '{"email":"reader@example.com","name":"Reader"}'`               |                                                      |
| `maito newsletter subscribers import`        | Import subscribers.              | \`cat subscribers.json                                                                                              | maito newsletter subscribers import --stdin --json\` |
| `maito newsletter subscribers block`         | Block a subscriber.              | `maito newsletter subscribers block --subscriber-id sub_123`                                                        |                                                      |
| `maito newsletter subscribers delete`        | Delete a subscriber.             | `maito newsletter subscribers delete --subscriber-id sub_123`                                                       |                                                      |
| `maito newsletter subscribers update-tags`   | Update subscriber tags.          | `maito newsletter subscribers update-tags --subscriber-id sub_123 --payload-json '{"tagIds":["tag_123"]}'`          |                                                      |
| `maito newsletter subscribers update-fields` | Update subscriber custom fields. | `maito newsletter subscribers update-fields --subscriber-id sub_123 --payload-json '{"fields":{"company":"Acme"}}'` |                                                      |

List filters include `--status`, `--query`, `--tag`, `--source`, `--limit`, and `--offset`.

## Newsletter Segments

| Command                                   | Use                                         | Example                                                                                                        |
| ----------------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `maito newsletter segments list`          | List segments.                              | `maito newsletter segments list --json`                                                                        |
| `maito newsletter segments create`        | Create a segment.                           | `maito newsletter segments create --payload-json '{"name":"Active readers","rules":[]}'`                       |
| `maito newsletter segments get`           | Get a segment.                              | `maito newsletter segments get --segment-id seg_123 --json`                                                    |
| `maito newsletter segments update`        | Update a segment.                           | `maito newsletter segments update --segment-id seg_123 --payload-json '{"name":"Updated segment","rules":[]}'` |
| `maito newsletter segments delete`        | Delete a segment.                           | `maito newsletter segments delete --segment-id seg_123`                                                        |
| `maito newsletter segments preview`       | Preview an unsaved segment.                 | `maito newsletter segments preview --payload-json '{"rules":[]}' --json`                                       |
| `maito newsletter segments preview-saved` | Preview a saved segment.                    | `maito newsletter segments preview-saved --segment-id seg_123 --json`                                          |
| `maito newsletter segments subscribers`   | List subscribers in a segment.              | `maito newsletter segments subscribers --segment-id seg_123 --limit 25 --json`                                 |
| `maito newsletter segments explain`       | Explain why a subscriber matches a segment. | `maito newsletter segments explain --segment-id seg_123 --subscriber-id sub_123 --json`                        |

## Newsletter Subscriber Metadata

| Command                                     | Use                               | Example                                                                                                       |
| ------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `maito newsletter subscriber-tags list`     | List subscriber tags.             | `maito newsletter subscriber-tags list --json`                                                                |
| `maito newsletter subscriber-tags create`   | Create a subscriber tag.          | `maito newsletter subscriber-tags create --payload-json '{"name":"VIP"}'`                                     |
| `maito newsletter subscriber-tags delete`   | Delete a subscriber tag.          | `maito newsletter subscriber-tags delete --tag-id tag_123`                                                    |
| `maito newsletter subscriber-fields list`   | List subscriber custom fields.    | `maito newsletter subscriber-fields list --json`                                                              |
| `maito newsletter subscriber-fields create` | Create a subscriber custom field. | `maito newsletter subscriber-fields create --payload-json '{"name":"Company","key":"company","type":"text"}'` |
| `maito newsletter subscriber-fields delete` | Delete a subscriber custom field. | `maito newsletter subscriber-fields delete --field-id field_123`                                              |

## Newsletter Issues

| Command                                    | Use                       | Example                                                                                               |
| ------------------------------------------ | ------------------------- | ----------------------------------------------------------------------------------------------------- |
| `maito newsletter issues list`             | List newsletter issues.   | `maito newsletter issues list --status draft --limit 20 --json`                                       |
| `maito newsletter issues get`              | Get an issue by ID.       | `maito newsletter issues get --issue-id issue_123 --json`                                             |
| `maito newsletter issues get-by-slug`      | Get an issue by slug.     | `maito newsletter issues get-by-slug --issue-slug weekly-update --json`                               |
| `maito newsletter issues create`           | Create an issue.          | `maito newsletter issues create --payload-file issue.json --json`                                     |
| `maito newsletter issues update`           | Update an issue.          | `maito newsletter issues update --issue-id issue_123 --payload-json '{"subject":"Updated subject"}'`  |
| `maito newsletter issues delete`           | Delete an issue.          | `maito newsletter issues delete --issue-id issue_123`                                                 |
| `maito newsletter issues send-test`        | Send a test issue.        | `maito newsletter issues send-test --issue-id issue_123 --payload-json '{"email":"you@example.com"}'` |
| `maito newsletter issues audience-preview` | Preview send audience.    | `maito newsletter issues audience-preview --issue-id issue_123 --json`                                |
| `maito newsletter issues send`             | Send an issue.            | `maito newsletter issues send --issue-id issue_123 --payload-json '{"confirm":true}' --json`          |
| `maito newsletter issues analytics`        | Get issue analytics.      | `maito newsletter issues analytics --issue-id issue_123 --json`                                       |
| `maito newsletter issues link-analytics`   | Get issue link analytics. | `maito newsletter issues link-analytics --issue-id issue_123 --json`                                  |

## Newsletter Analytics

| Command                                  | Use                                | Example                                                       |
| ---------------------------------------- | ---------------------------------- | ------------------------------------------------------------- |
| `maito newsletter analytics overview`    | Get newsletter analytics overview. | `maito newsletter analytics overview --json`                  |
| `maito newsletter analytics sources`     | Get subscriber source analytics.   | `maito newsletter analytics sources --source linkedin --json` |
| `maito newsletter analytics attribution` | Get attribution analytics.         | `maito newsletter analytics attribution --json`               |

## Compatibility Aliases

| Alias                           | Preferred command           | Example                                              |
| ------------------------------- | --------------------------- | ---------------------------------------------------- |
| `maito calendar get-time-slots` | `maito calendar time-slots` | `maito calendar get-time-slots --json`               |
| `maito media upload-batch`      | `maito media upload`        | `maito media upload-batch --payload-file media.json` |
