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

# Why agents love her

> Why an AI agent can drive her without guesswork: flag-driven commands, JSON results and one skill file that teaches the rules.

Her command line was shaped for something that reads flags and parses output, not for a person with
a mouse. That happens to be what your assistant does best.

## No prompts, no screen-scraping

Your agent writes the whole call up front, positional arguments and flags on one line, and sends it.
Nothing pauses halfway to wait for a keystroke. A run that fires at four in the morning, with nobody
awake to answer a prompt, still gets to the end.

<Frame>
  <img src="https://mintcdn.com/forceplay/3MbWAJB4xKJ_Rxe0/images/brand/terminal-claude.svg?fit=max&auto=format&n=3MbWAJB4xKJ_Rxe0&q=85&s=aecc600b13cc3b3c90a60c759ba34e28" alt="An agent composes the whole postqueen command up front, flags and all, then reads the JSON that comes back" width="620" height="418" data-path="images/brand/terminal-claude.svg" />
</Frame>

```bash theme={"system"}
postqueen posts:create \
  -c "We just shipped dark mode 🌙" \
  -s "2026-08-01T09:00:00Z" \
  -i "your-integration-id"
```

Your agent gets JSON back, behind a single human-readable header line, so it reads a field by name
instead of guessing at wording on a screen. Drop the header with `tail -n +2` before piping into
`jq`:

```bash theme={"system"}
REDDIT_ID=$(postqueen integrations:list | tail -n +2 | jq -r '.[] | select(.identifier=="reddit") | .id')
```

Failures are just as easy to detect, so a script or an agent loop can branch on the result without
parsing prose.

| Outcome | Exit code | Where the answer goes                      |
| ------- | --------- | ------------------------------------------ |
| Success | `0`       | JSON on stdout, behind the one-line header |
| Failure | `1`       | A readable message on stderr               |

<Warning>
  `auth:status` is the one exception. It is a human-readable report rather than a JSON command, and it
  exits `0` whether or not the key is valid. Read its output for the `✅ Credentials are valid` line
  rather than branching on the exit code.
</Warning>

Discovery closes the loop. An agent that has met a channel for the first time can still post to it
correctly, because it asks her instead of assuming.

| Command                 | What it answers                                                               |
| ----------------------- | ----------------------------------------------------------------------------- |
| `integrations:settings` | What a channel accepts, including character limits and required fields        |
| `integrations:trigger`  | Values that cannot be hardcoded, such as subreddit flairs or Pinterest boards |

## 👑 One command teaches your agent

If your agent supports the `skills` registry, a single command hands it her whole playbook:

```bash theme={"system"}
npx skills add GkhanKINAY/postqueen-agent
```

What lands is her `SKILL.md`:

| In the file | What it says                                                                                                   |
| ----------- | -------------------------------------------------------------------------------------------------------------- |
| Name        | It registers as `postqueen`                                                                                    |
| Tools       | `Bash(postqueen:*)`, the only one it needs                                                                     |
| First line  | The npm install command, so an agent that finds the CLI missing can put it in place before doing anything else |

Nobody has to point at it. Your agent picks the skill up on its own when the task looks like posting
work, and arrives already knowing the discovery flow, the flags on `posts:create` and the media rule
it has to respect. You do not paste command syntax into a chat window to get started.

<Note>
  The skill is plain Markdown over a plain CLI, so no model has an advantage. Claude and GPT read the
  same file as Gemini or an open-source model on your own machine, and they all type the same
  commands. If a thing can run a shell command, it can run your social media.
</Note>

<Tip>
  Prefer tool calls to shell commands? Connect over MCP and you get the same capabilities as 11 tools,
  with no local install. Setup: [MCP setup](/mcp/setup).
</Tip>

## Two hard rules

Her skill file leads with these two, because almost every failed agent run traces back to one of
them.

<Warning>
  **Rule 1: authenticate first.** Commands fail without valid credentials. Export your key before anything else, then confirm with `postqueen auth:status`.

  ```bash theme={"system"}
  export POSTQUEEN_API_KEY=your_api_key
  postqueen auth:status
  ```

  Your key lives in the app at [app.postqueen.ai](https://app.postqueen.ai): open **Settings > Developers > Public API** and click **Reveal**. Treat it like a password, since it grants full access to your account.
</Warning>

<Warning>
  **Rule 2: upload media before attaching it.** Every value passed to `-m`, or to an `image` field in JSON mode, has to be a URL returned by `postqueen upload`. She rejects raw local paths like `photo.jpg` and external links like `https://example.com/photo.jpg`, and providers such as TikTok, Instagram and YouTube only accept a PostQueen-verified URL.

  ```bash theme={"system"}
  IMAGE_URL=$(postqueen upload photo.jpg | tail -n +2 | jq -r '.path')
  postqueen posts:create \
    -c "Today's special" \
    -m "$IMAGE_URL" \
    -s "2026-08-01T12:00:00Z" \
    -i "your-integration-id"
  ```
</Warning>

<Note>
  `postqueen auth:login` runs an OAuth2 device flow against `cli-auth.postqueen.ai` unless you point it elsewhere with `--auth-server` or `POSTQUEEN_AUTH_SERVER`. That host is not serving yet, so on the hosted service the API key is the route to take today, and self-hosters can run the auth server themselves in the meantime.
</Note>

## The core workflow

Every agent session follows the same seven beats, whether it is a coding assistant on your laptop or
a job that wakes up at four in the morning.

<Steps>
  <Step title="Authenticate">
    Set the key, then verify it before spending a single API call on a real post.

    ```bash theme={"system"}
    export POSTQUEEN_API_KEY=your_api_key
    postqueen auth:status
    ```

    <Check>
      `✅ Credentials are valid` in that output means the key works and the rest of the loop can run.
    </Check>
  </Step>

  <Step title="Discover">
    List the connected channels and read what each one accepts.

    ```bash theme={"system"}
    postqueen integrations:list
    postqueen integrations:settings <integration-id>
    ```
  </Step>

  <Step title="Fetch dynamic data">
    Pull the values that only the platform knows, such as flairs, playlists or company pages.

    ```bash theme={"system"}
    postqueen integrations:trigger <integration-id> <method> -d '{"key":"value"}'
    ```
  </Step>

  <Step title="Prepare media">
    Send each file through upload and keep the returned `path`. The `tail -n +2` drops the header line, which is not JSON.

    ```bash theme={"system"}
    IMAGE_URL=$(postqueen upload image.jpg | tail -n +2 | jq -r '.path')
    ```
  </Step>

  <Step title="Post">
    Schedule it. The `-s` date is required and takes ISO 8601, and `-t draft` saves the post without scheduling it instead.

    ```bash theme={"system"}
    postqueen posts:create \
      -c "Content" \
      -m "$IMAGE_URL" \
      -s "2026-08-01T09:00:00Z" \
      -i "<integration-id>"
    ```
  </Step>

  <Step title="Analyze">
    Ask how it landed, per channel or per post. `-d` is the number of days to look back.

    ```bash theme={"system"}
    postqueen analytics:platform <integration-id> -d 30
    postqueen analytics:post <post-id> -d 7
    ```
  </Step>

  <Step title="Resolve">
    If `postqueen analytics:post` returns `{"missing": true}`, the post published but the platform withheld its ID. List the provider's recent content and link the right one.

    ```bash theme={"system"}
    postqueen posts:missing <post-id>
    postqueen posts:connect <post-id> --release-id "<content-id>"
    ```
  </Step>
</Steps>

That is the whole loop. An agent that follows it runs your calendar on its own, and every step it
takes stays a normal command with a result you can read.

## Next steps

<CardGroup cols={2}>
  <Card title="Agents overview" icon="robot" href="/agents/overview">
    The three ways in and a setup guide for each agent she works with.
  </Card>

  <Card title="Install the skill" icon="download" href="/agents/skill-install">
    The API key, the CLI, self-hosted setup, and what goes wrong with each fix.
  </Card>

  <Card title="Command reference" icon="terminal" href="/cli/command-reference">
    Every command and flag, with the exact syntax an agent needs.
  </Card>

  <Card title="MCP setup" icon="plug" href="/mcp/setup">
    Connect an MCP client to her 11 hosted tools in one line.
  </Card>
</CardGroup>
