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

# AIsa Twitter Command Center

> Search and publish on X/Twitter through one approved workflow.

[View on GitHub ->](https://github.com/AIsa-team/agent-skills/tree/main/aisa-twitter-command-center)

**A command center for X/Twitter work.** Search profiles, tweets, trends, lists, communities, and Spaces, then publish through OAuth when approved.

## Install

First, install the AIsa CLI if you have not already:

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

Then install the skill:

```bash theme={null}
aisa skills install aisa-twitter-command-center
```

## What can agents do with it?

<CardGroup cols={2}>
  <Card title="Search and monitor" icon="magnifying-glass">
    Search users, tweets, trends, lists, and communities.
  </Card>

  <Card title="Publish posts" icon="pen">
    Draft and publish X posts after account authorization.
  </Card>

  <Card title="Engagement actions" icon="thumbs-up">
    Like, follow, reply, and manage social workflows.
  </Card>

  <Card title="DM context" icon="message-circle">
    Review and use direct-message context in workflows.
  </Card>
</CardGroup>

## When to use

* The user wants Twitter/X research, monitoring, or content discovery.
* The user wants to inspect profiles, timelines, mentions, trends, replies, quotes, lists, communities, or Spaces.
* The user wants to draft or publish posts after explicit OAuth approval without sharing passwords.

## When NOT to use

* The user needs password-based login, cookie extraction, or browser credential scraping.
* The workflow must avoid relay-based calls to `api.aisa.one`.
* The request is for unsupported engagement actions not covered by this package.

## Quick Reference

* Required environment variable: `AISA_API_KEY`
* Read client: `scripts/twitter_client.py`
* OAuth and posting client: `scripts/twitter_oauth_client.py`
* Posting guide: `references/post_twitter.md`

## Setup

```bash theme={null}
export AISA_API_KEY="your-key"
```

All network calls go to `https://api.aisa.one/apis/v1/...`.

## Capabilities

* Read user data, timelines, mentions, followers, followings, and related profile information.
* Search tweets and users, inspect replies, quotes, retweeters, thread context, trends, lists, communities, and Spaces.
* Publish text, image, and video posts after explicit OAuth approval.
* Return an authorization link when posting access has not been approved yet.

## Common Commands

```bash theme={null}
python3 scripts/twitter_client.py user-info --username elonmusk
python3 scripts/twitter_client.py search --query "AI agents" --type Latest
python3 scripts/twitter_client.py trends --woeid 1
python3 scripts/twitter_oauth_client.py status
python3 scripts/twitter_oauth_client.py authorize
python3 scripts/twitter_oauth_client.py post --text "Hello from AIsa"
```

## Posting Workflow

When the user asks to send, publish, reply, or quote on X/Twitter:

1. Check whether `AISA_API_KEY` is configured.
2. If the user intent is to publish, attempt the publish workflow.
3. If authorization has not been completed, return the OAuth authorization link first.
4. Use `--media-file` only for user-provided local workspace files.
5. Do not claim the post succeeded until the publish command actually succeeds.

## Guardrails

* Do not ask for Twitter passwords or browser cookies.
* Do not invent captions, tweet URLs, or attachment files.
* Do not default to browser opening unless the user explicitly wants local browser launch.
* Do not claim external posting succeeded until the API confirms success.

## Security Notes

* The workflow is relay-based and sends API requests, OAuth requests, and approved media uploads to `api.aisa.one`.
* Required secret: `AISA_API_KEY`.
* This workflow does not require passwords, browser cookie extraction, or direct account credential sharing.

## References

* See `references/post_twitter.md` for detailed posting examples and OAuth guidance.

## Get started

1. Sign up at [aisa.one](https://aisa.one) (new accounts start with \$2 free credit).
2. Generate an API key from the console.
3. Set your key and install the skill:
   ```bash theme={null}
   export AISA_API_KEY="your-key"
   npm install -g @aisa-one/cli
   aisa skills install aisa-twitter-command-center
   ```
4. Start a new agent session so the runtime loads the updated skill instructions.

## Related

<CardGroup cols={3}>
  <Card title="AIsa Twitter API" icon="twitter" href="/agent-skills/aisa-twitter-api">
    X/Twitter data access and social intelligence.
  </Card>

  <Card title="AIsa Twitter Post & Engage" icon="pen" href="/agent-skills/aisa-twitter-post-engage">
    Focused post, like, follow, and reply actions.
  </Card>

  <Card title="Link an X Account" icon="key" href="/api-reference/twitter/auth_twitter">
    OAuth setup for write actions.
  </Card>
</CardGroup>
