Background
What is OpenClaw?

If you’ve never used an AI agent before, here’s the shortest possible explanation: ChatGPT is a brain in a jar. OpenClaw gives that brain hands.

OpenClaw is an open-source, self-hosted AI agent. Where ChatGPT can only talk to you, OpenClaw can actually do things — read your files, send emails, browse the web, post on social media — all by connecting to external tools through “Skills.” It runs locally on your computer, which means your data stays on your machine.

🦞
Why the lobster logo?
OpenClaw started as “Clawdbot” in November 2025, briefly became “Moltbot,” then settled on “OpenClaw.” The lobster logo survived every name change. By February 2026 it had 200,000+ GitHub stars — one of the fastest-growing open-source projects ever.

In this tutorial, we’re going to use OpenClaw to connect to X (Twitter) and post tweets automatically using an AI agent. By the end, your OpenClaw will be able to write, schedule, and publish tweets on your behalf.

Before You Start
What You’ll Need

Get these ready before you begin — it’ll save you from stopping halfway through:

💻
A Mac or Windows computer with at least 8GB RAM. OpenClaw runs locally on your machine.
🔧
Node.js installed (version 18 or higher). Download free at nodejs.org. If you’ve never used it, just download and run the installer — no configuration needed.
🤖
An AI model API key — either OpenAI (GPT-4) or Anthropic (Claude). OpenClaw needs a brain to power it. Free credits are available for new accounts on both platforms.
🐦
An X / Twitter account with a verified phone number. You’ll need this to apply for API access in Step 2.
About 30–45 minutes the first time. Most of that is waiting for the X Developer approval, which is usually instant.
⚠️
Heads up on costs: The X/Twitter API Basic tier costs $100/month and is required for posting tweets programmatically. The free tier only allows read access with tight limits. We’ll cover a workaround using OpenTweet as a bridge (free 7-day trial, then $5.99/month) that avoids dealing with the Twitter API directly.
1
Installation
Install OpenClaw on Your Computer

The fastest way to install OpenClaw is via Ollama, which handles the entire setup automatically. Open your Terminal (Mac) or Command Prompt (Windows) and run this single command:

Terminal
ollama launch openclaw

Ollama will detect if OpenClaw isn’t on your system and install it automatically. Once installed, OpenClaw will open in your terminal ready to chat.

If you don’t have Ollama yet, install it first at ollama.com — it’s a one-click installer. Then run the command above.

After installation, OpenClaw will ask you to configure a model. When prompted, enter your AI API key:

OpenClaw Setup Prompt
# When OpenClaw asks for your model API key: # For OpenAI (GPT-4): OPENAI_API_KEY=sk-your-openai-key-here# OR for Anthropic (Claude — recommended): ANTHROPIC_API_KEY=sk-ant-your-anthropic-key-here

Once configured, test that everything is working by typing a simple message like Hello into the terminal. If OpenClaw responds, you’re ready for Step 2.

💡
OpenClaw stores everything locally in ~/.openclaw/ on your computer. Your conversations, memory, and preferences all live in this folder — nothing goes to the cloud.
2
API Access
Set Up X / Twitter API Access

Rather than dealing with X’s $100/month API directly, we’ll use OpenTweet as a bridge. OpenTweet gives your OpenClaw agent a simple API key to post tweets — your actual Twitter credentials never leave OpenTweet’s servers, which is significantly safer.

1
Go to opentweet.io and create a free account. The 7-day trial gives you full access — no credit card required upfront.
2
During onboarding, click “Connect X Account.” This opens the official X OAuth flow — the same login screen you’d see connecting any app to Twitter. Sign in with your X credentials. This is the only time you’ll interact with your Twitter password directly.
3
After connecting, go to your OpenTweet dashboard → API Keys → Create New Key.
4
Copy your API key — it looks like ot_a1b2c3d4e5f6... (48 characters). Save this somewhere safe. It’s only shown once.
⚠️
Don’t close the page until you’ve copied your API key. If you lose it, you’ll need to generate a new one from your OpenTweet dashboard.
3
Skill Installation
Install the Twitter Skill via ClawHub

OpenClaw uses “Skills” to connect to external services — think of them like apps you install on your phone. ClawHub is the official Skills marketplace. We’ll install the OpenTweet skill, which teaches OpenClaw how to talk to X.

In your terminal, run:

Terminal — Install Twitter Skill
clawhub install openclaw/skills/twitter

ClawHub downloads and installs the skill automatically. When it’s done, you’ll see a confirmation message. Restart OpenClaw to load the new skill:

Terminal
openclaw restart
Prefer manual setup? Create a folder at ~/.openclaw/skills/twitter/, add a SKILL.md file with the OpenTweet API documentation inside, then restart OpenClaw. The ClawHub method above does this automatically.
4
Configuration
Add Your OpenTweet API Key to OpenClaw

Now tell OpenClaw where to find your Twitter API credentials. Open your OpenClaw config file:

Terminal — Open Config File
# Mac / Linux: nano ~/.openclaw/openclaw.json# Windows: notepad %USERPROFILE%\.openclaw\openclaw.json

Find the "secrets" section (or add it if it doesn’t exist) and add your OpenTweet API key:

~/.openclaw/openclaw.json
{ "model": "claude-3-5-sonnet", "secrets": { "OPENTWEET_API_KEY": "ot_a1b2c3d4e5f6your-key-here" } }

Save the file and restart OpenClaw. To verify the credentials are working, run the auth check command:

Terminal — Verify Connection
twclaw auth-check

You should see a green confirmation: ✓ Connected to X as @yourusername. If you see an error, double-check your API key was copied correctly with no extra spaces.

💡
The secrets section in openclaw.json is never sent to any AI model — it stays on your machine. Your API key is only used to authenticate with OpenTweet’s servers when posting.
5
First Tweet
Post Your First Tweet with OpenClaw

You’re connected. Now let’s post. In your OpenClaw terminal, you can either use natural language or the twclaw command directly.

Option A — Natural language (easiest): Just tell OpenClaw what to do:

OpenClaw Chat
Post a tweet saying: "Just set up my AI agent to auto-post on X. The future is now. 🤖"

OpenClaw will confirm before posting. Type yes to confirm.

Option B — Direct command:

Terminal — Post Directly
twclaw post "Just set up my AI agent to auto-post on X. The future is now. 🤖"

Check your X profile — the tweet should appear within seconds.

You can also read your timeline, search tweets, and check mentions:

Terminal — Other Commands
# Read your home timeline (last 20 tweets) twclaw home -n 20# Check your mentions twclaw mentions -n 10# Search tweets by keyword twclaw search "AI filmmaking" --recent# View someone's profile twclaw user @handle# Read a specific tweet twclaw read tweet-url-or-id
6
Automation
Schedule Automatic Tweets with OpenClaw

The real power of OpenClaw isn’t one-off tweets — it’s fully automating your posting schedule. Here’s how to set up a recurring content workflow.

Schedule a specific tweet for a future time:

OpenClaw Chat
Schedule a tweet for tomorrow at 9am saying: "New blog post just dropped — link in bio 🔗"

Set up a daily content routine: Edit your SOUL.md file — this is the file OpenClaw reads every time it starts up, like a standing instruction document:

~/.openclaw/SOUL.md — Add These Lines
## Daily Twitter RoutineEvery morning at 9:00 AM: - Post one original tweet about AI creativity or filmmaking - Keep it under 200 characters - Use a conversational, curious tone - Do NOT include hashtags unless the topic is trendingEvery Friday at 5:00 PM: - Post a short weekly reflection tweet summarizing what I created this week

Save the file. From now on, every time OpenClaw runs, it will follow these instructions automatically.

Pro tip: The more specific your SOUL.md instructions, the better the output. Include your brand voice, topics you care about, things you never want to post about, and any formatting preferences. OpenClaw reads this file fresh every session.

Generate a thread and post it:

OpenClaw Chat
Write a 5-tweet thread about how AI is changing indie filmmaking in 2026. Make it conversational, hook-first, and post it now.

OpenClaw will draft the full thread, show it to you for review, and post it to X after you confirm.

Common Issues
Troubleshooting

Most problems come down to one of these three issues:

twclaw auth-check returns “Invalid API key”
Your OpenTweet API key wasn’t saved correctly. Open ~/.openclaw/openclaw.json and check: (1) the key is inside quotes, (2) there are no extra spaces, (3) the key starts with ot_. Generate a new key from your OpenTweet dashboard if needed.
OpenClaw doesn’t know the twclaw commands
The Twitter skill wasn’t loaded. Run clawhub install openclaw/skills/twitter again and make sure OpenClaw was restarted afterward with openclaw restart. You can verify installed skills with openclaw skills list.
Tweet posted but didn’t appear on my X profile
Check your OpenTweet dashboard — the post may be in a queue. Also verify your X account isn’t in restricted mode (Settings → Privacy and Safety → Audience and Tagging). If your account is new, X sometimes delays first API posts by a few minutes.
OpenClaw isn’t running my scheduled tweets
Scheduled tasks only run while OpenClaw is actively running. Make sure the OpenClaw process stays open in the background. On Mac, you can use brew services start openclaw to run it as a background service that starts automatically on login.
X feed appears blank when using twclaw home
X’s timeline is JavaScript-rendered and login-walled, which blocks simple API reads. For reading your live feed, use the OpenClaw Browser Relay: install the Chrome extension from docs.openclaw.ai/tools/chrome-extension, open x.com while logged in, and click the OpenClaw extension icon to attach it to that tab.