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

# Gemini CLI

> One command connects Gemini CLI to her over MCP, and the terminal you already have open can put finished posts on your calendar

## Working with her in the terminal

The release is cut, the terminal is still open, and the only thing standing between you and the announcement is a browser tab you do not want to open. One line of setup later, Gemini CLI can see your channels, ask each one what it accepts and write the posts onto your calendar without you leaving the prompt.

Gemini CLI reads MCP servers from its `settings.json`, and she is already hosted at a URL, so nothing new runs on your machine. On connect it discovers her [11 tools](/mcp/tools) and reads their schemas, which is why you never type a tool call by hand.

Those 11 tools cover discovery, media and posting. They do not list, delete or reschedule posts that already exist, and there is no analytics tool among them. Both of those live on the calendar at [app.postqueen.ai](https://app.postqueen.ai) and in the [`postqueen` CLI](/cli/introduction), which Gemini CLI can run as a shell command like any other.

## Set up

One command, and the terminal you already have open can post:

```bash theme={"system"}
gemini mcp add --transport http postqueen https://api.postqueen.ai/mcp/YOUR_API_KEY
```

Your key comes from the app at [app.postqueen.ai](https://app.postqueen.ai), under
**Settings > Developers > Public API**. Then run `/mcp` inside Gemini CLI: `postqueen` should
show as connected with 11 tools.

<Card title="Full setup: Gemini CLI over MCP" icon="https://mintcdn.com/forceplay/3MbWAJB4xKJ_Rxe0/images/brand/icon-gemini-cli.svg?fit=max&auto=format&n=3MbWAJB4xKJ_Rxe0&q=85&s=1a8e58041a86b8c765f3e545f9412eaf" href="/mcp/clients/gemini-cli" width="30" height="30" data-path="images/brand/icon-gemini-cli.svg">
  Scope options, the `settings.json` block, the header variant, self-hosted URLs, and why an entry
  written with `url` instead of `httpUrl` connects to nothing
</Card>

<Warning>
  A project-level `.gemini/settings.json` carries your key into the repo. Use `--scope user` to
  write it to `~/.gemini/settings.json` instead and leave the project clean.
</Warning>

## 👑 Two posts about the release you just cut

Saved views went out this afternoon and the changelog entry is written. Ask in the same terminal:

> *"We shipped saved views today. Write a post for X and one for LinkedIn, generate an image for the X one, and schedule both for tomorrow at 9am."*

Four calls carry that sentence to your calendar:

1. `integrationList` returns every connected channel with its integration ID, so the agent knows which accounts exist before it writes anything.
2. `integrationSchema` asks each platform what it expects and gets back its rules, its `maxLength` and its required settings. This is why the LinkedIn post does not arrive written to X's character limit.
3. `generateImageTool` takes a prompt and returns an `id` with a hosted `path`. That `path` goes straight into `attachments`.
4. `integrationSchedulePostTool` writes the calendar entries, one item in `socialPost` per post:

```json theme={"system"}
{
  "socialPost": [
    {
      "integrationId": "your-x-integration-id",
      "isPremium": false,
      "date": "2026-08-01T09:00:00.000Z",
      "shortLink": false,
      "type": "schedule",
      "postsAndComments": [
        {
          "content": "<p>Saved views are live. Filter once, name it, and it is waiting for you tomorrow.</p>",
          "attachments": ["https://uploads.postqueen.ai/saved-views.png"]
        }
      ],
      "settings": [{ "key": "who_can_reply_post", "value": "everyone" }]
    }
  ]
}
```

Content is HTML with a short list of allowed tags, and every line is wrapped in `<p>`. The `settings` array carries whatever `integrationSchema` said that platform requires, which is `who_can_reply_post` on X. Both rules in full: [tool reference](/mcp/tools).

Not ready for one to go out? `type` takes `draft` instead of `schedule`. A draft is a post state, not a queue position: it lands on the calendar and stays there, unscheduled, until you publish it from the editor at [app.postqueen.ai](https://app.postqueen.ai). Her MCP tools carry no status change, so that switch happens on the calendar or from the CLI:

```bash theme={"system"}
postqueen posts:status <post-id> --status schedule
```

Everything you scheduled needs nothing further from you. It sits on the calendar where you can still edit or delete it, and at nine tomorrow morning it goes out on time.

## FAQ

<AccordionGroup>
  <Accordion title="Do I need Gemini CLI to use PostQueen?">
    No. She works on her own through the dashboard, the CLI and the public API. Gemini CLI is one of several ways to automate her, and a good pick when your day already happens at a prompt.
  </Accordion>

  <Accordion title="She never shows up in /mcp">
    The usual cause is the wrong config key. Streamable HTTP servers go under `httpUrl`, while `url` is for SSE. After that, check the API key was pasted in full with no stray whitespace, and that the entry is in the file you think it is: `gemini mcp add` writes into the project unless you pass `--scope user`.
  </Accordion>

  <Accordion title="What can she do from a Gemini CLI session?">
    Everything her 11 MCP tools cover. She lists your channels, reads what each platform accepts and schedules posts across your 30+ networks. Along the way she can fetch dynamic values like subreddit flairs, generate an image or build a video to attach.
  </Accordion>

  <Accordion title="Can it check how a post performed?">
    Not over MCP. There is no analytics tool in the set, and no tool for listing or deleting posts either. For those, use the calendar at [app.postqueen.ai](https://app.postqueen.ai) or the `postqueen` CLI, which carries `posts:list`, `posts:delete` and `analytics:platform`.
  </Accordion>

  <Accordion title="Can Gemini CLI use the CLI instead of MCP?">
    Yes. It runs shell commands, and every `postqueen` command takes flags and prints JSON, so nothing has to be scraped off the screen. The CLI is the wider surface of the two, and the one to reach for when you want listing, status changes or analytics. Installation and the full command set: [CLI introduction](/cli/introduction).
  </Accordion>

  <Accordion title="Does the integration cost extra?">
    <Snippet file="agent-plan-limits.mdx" />
  </Accordion>
</AccordionGroup>

## Learn more

<CardGroup cols={2}>
  <Card title="Gemini CLI over MCP" icon="plug" href="/mcp/clients/gemini-cli">
    The `settings.json` block, the Bearer variant and self-hosted URLs.
  </Card>

  <Card title="MCP tools" icon="wrench" href="/mcp/tools">
    All 11 tools Gemini discovers on connect, with every parameter.
  </Card>

  <Card title="CLI introduction" icon="terminal" href="/cli/introduction">
    The `postqueen` CLI, for the work MCP does not cover.
  </Card>

  <Card title="Agents overview" icon="compass" href="/agents/overview">
    Every way to put an agent in front of PostQueen, from coding assistants to chat apps.
  </Card>
</CardGroup>
