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

# Social Media CLI

> Mallary CLI is a social media command line tool for developers, operators, CI pipelines, and AI agents. Use it to publish, inspect jobs, read post analytics and audience counts, manage webhooks, and work with connected platforms.

Mallary CLI is a social media command line interface for the Mallary publishing platform. It serves developers, operators, automation scripts, CI jobs, and AI agents.

If you want a social media CLI, Mallary gives you a direct command-line client for the public Mallary platform. Use it to upload media, create posts, schedule content, and read job status. You can also read post analytics and audience counts, list connected platforms, manage webhooks, and update brand settings.

Plans start at $15/month for 5 total social media accounts. Pro includes 15 for $29, and Business includes 100 for \$95. Posts are unlimited. Scheduling, analytics, and AI auto-replies are included. X publishing and comments use credits at cost; analytics and account lookups do not use credits. See [pricing](https://docs.mallary.ai/home/pricing.md). Existing customers keep their current terms.

## Start here

> [card] [CLI Overview](https://docs.mallary.ai/cli-reference/introduction.md)
>
> Start with what the CLI covers, who it is for, and how it maps to the
> Mallary platform.

> [card] [Install](https://docs.mallary.ai/cli-reference/install.md)
>
> Install, update, or remove the Mallary CLI with npm or npx.

> [card] [Quickstart](https://docs.mallary.ai/cli-reference/quickstart.md)
>
> Run your first health check, upload, post creation, and job lookup commands.

> [card] [Automation](https://docs.mallary.ai/cli-reference/automation.md)
>
> Use the CLI in scripts, CI pipelines, and AI-driven automation flows.

## What the Mallary CLI does

With the CLI you can:

* upload local media files
* create and schedule posts
* list comments and post supplied replies on published posts
* read publishing jobs, including platform post IDs and URLs when available
* list grouped posts
* read post analytics and follower or subscriber counts
* create, list, and delete webhooks
* update settings for brand and auto-reply behavior
* list connected platforms
* disconnect platforms

## Who the Mallary CLI is for

Mallary CLI is useful for:

* developers who want quick local testing
* operators who prefer shell workflows over dashboards
* CI pipelines that need social publishing steps
* scripts that automate content workflows
* AI agents that need a stable command interface

## How Mallary CLI works

Mallary CLI is a direct client for the public Mallary API.

It does not bypass:

* plan limits
* feature gates
* platform rules

The CLI is a convenient interface over the same underlying Mallary system used by the dashboard, REST API, and MCP server.

## Authentication

For interactive use, sign in with browser-based OAuth:

```bash theme={null}
mallary auth login
mallary auth status
```

One OAuth login gives access to view data, publish posts, reply to comments, and manage settings and connections. Users do not choose OAuth scopes. The CLI stores credentials outside your project by default and refreshes access automatically. `MALLARY_API_KEY` remains available as an optional environment override for CI or other non-interactive environments.

## Installation

Install globally:

```bash theme={null}
npm install -g @mallary/cli
```

Run without a global install:

```bash theme={null}
npx @mallary/cli --help
```

## Common commands

Examples:

```bash theme={null}
mallary health
mallary upload ./launch.mp4
mallary posts create --message "Hello from Mallary" --platform facebook
mallary posts create --message "A new Story" --platform facebook --platform instagram --post-type story --media ./story.mp4
mallary posts create --message "Hello from another profile" --platform facebook --profile-id AbC123xYz90
mallary posts list
mallary posts get 123 --json
mallary posts edit 123 --message "Updated text" --target-profile-id AbC123xYz90
mallary comments list --post-id 123
mallary comments reply --post-id 123 --comment-id "1789..." --message "Thanks for checking this out."
mallary jobs get 123
mallary analytics list
mallary analytics posts --sort views --limit 25
mallary audience list
mallary profiles list
mallary webhooks list
mallary settings get
mallary platforms list
mallary platforms disconnect facebook
```

## Media handling

Mallary CLI handles media uploads for local and scripted workflows.

Current behavior is:

* Mallary uploads local files automatically
* Mallary rejects external remote media URLs
* Mallary accepts existing `https://files.mallary.ai/...` URLs

Many downstream social platforms expect trusted hosted media URLs.

## Posting and scheduling

Mallary CLI supports both simple and advanced post creation flows.

You can:

* create posts from flags
* create posts from JSON payload files
* schedule posts
* schedule local wall-clock times with `--scheduled-timezone`
* attach media
* add follow-up comments on supported platform/format combinations
* enable per-post AI auto reply
* use platform-specific payloads in file mode
* choose one shared format in flag mode with `--post-type`

The CLI can test the same post payloads that you plan to send from automation or backend systems.

For scheduling, you can either send an absolute timestamp with `--scheduled-at 2026-04-06T18:30:00Z`, or pair a local `--scheduled-at 2026-04-06T14:30` with `--scheduled-timezone America/New_York`.

## Supported platform-specific payload areas

The current CLI README documents platform-specific payload examples for:

* Facebook
* Instagram
* Threads
* LinkedIn
* YouTube
* TikTok
* Pinterest
* Reddit
* Bluesky
* X

For the exact supported `platform_options` structure and field names by platform, use the API reference here:

[Platform options reference](https://docs.mallary.ai/api-reference/endpoint/create.md#body-platform-options)

Mallary CLI also inherits the same per-platform media rules as the API.

For read-only format discovery, `mallary platforms list` returns the exact selectable `post_types` for each destination. If every selected platform should use the same type, pass `--post-type`. Use file mode when different destinations need different types.

Examples:

* Threads supports `platform_options.threads.post_type` with `text`, `image`, `video`, or `carousel`.
* YouTube requires exactly one video.
* YouTube file mode supports tags, playlist placement, and realistic AI-content disclosure through `platform_options.youtube`.
* Facebook supports `platform_options.facebook.post_type` with `feed`, `story`, or `reel`. Reels use one 9:16 MP4 or MOV video that is 3 to 90 seconds long.
* Instagram supports `platform_options.instagram.post_type` with `feed`, `story`, `reel`, or `carousel`. For a Reel, `shareToFeed` controls profile feed placement. Add `trialParams.graduationStrategy` in file mode to publish a Trial Reel. With a Facebook Login connection, file mode also supports `isPaidPartnership` and up to two `brandedContentSponsors` on feed posts, Reels, and carousels. Stories support captions through `--message` or `platform_options.instagram.message` in file mode. To place styled text on the image or video, add it to the media before upload. Stories do not support follow-up comments.
* TikTok video posts require one video, and TikTok photo posts support up to 35 JPEG/WebP images.
* TikTok defaults to `DIRECT_POST`, which publishes through Mallary. Set `platform_options.tiktok.post_mode = MEDIA_UPLOAD` only when you want to finish the post in the TikTok app. Inbox uploads stay `action_required` until you add the final TikTok post URL.
* Pinterest requires exactly one image or GIF, or exactly one video. Mallary shortens Pin descriptions longer than 800 characters so they can publish.
* X allows up to 4 images, or 1 video, or 1 GIF.

To add an AI label in file mode, send a JSON boolean (`true` or `false`) in the matching platform options:

* Instagram, including Reels: `platform_options.instagram.is_ai_generated`
* Facebook Reels: `platform_options.facebook.is_ai_generated`, with `platform_options.facebook.post_type` set to `reel`
* X: `platform_options.x.made_with_ai`; `platform_options.twitter.made_with_ai` also works

Set a field to `true` to disclose AI-made content. Leave it out to send no AI label choice. The fields stay with drafts and scheduled posts. They do not change posts that are already live. X first replies do not inherit the label.

For the full matrix, see:

[Platform-specific media rules](https://docs.mallary.ai/api-reference/endpoint/create.md#platform-specific-media-rules)

## JSON output and automation

Mallary CLI supports `--json` output for scripting and automated workflows.

This output format is a good fit for:

* shell scripts
* GitHub Actions
* CI jobs
* agent toolchains
* local testing before integrating with the raw API

## Accounts and access

Use `mallary profiles list` to find the random public profile ID for a non-default profile. Pass `--profile-id` when posting, listing posts, reading analytics or settings, listing platforms, or disconnecting an account in that profile.

Your account allowance is shared across platforms and profiles. See [pricing](https://docs.mallary.ai/home/pricing.md) for total account counts and X credits. Existing customers keep their current terms.

## Good fit for the Mallary CLI

Mallary CLI is a strong fit if you want:

* the fastest way to test Mallary without building an API client
* shell-first social media automation
* a CI-friendly publishing interface
* a command surface for AI agents or local scripts
* easy local-media-to-post workflows

## Saved Drafts

Saved drafts are available to all users. Save unfinished posts without a publish date or a publishing job. Read, edit, or delete them, then publish or schedule when ready. A request to save a draft does not authorize publishing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.