Your First AI Agent in 10 Minutes
Let's skip the preamble and get straight to building. By the end of this tutorial, you'll have a working OpenClaw agent that can search the web, read and write files, and chat with you. Total time: about 10 minutes.
Prerequisites
You'll need:
- Node.js 20+ installed (check with
node --version) - A terminal (macOS Terminal, iTerm2, Windows Terminal, whatever you like)
- An API key from an AI provider (OpenAI, Anthropic, or any OpenAI-compatible endpoint)
That's it. No Docker, no Kubernetes, no PhD required.
Step 1: Install OpenClaw
Open your terminal and run:
npm install -g openclaw
This installs the OpenClaw CLI globally. Verify it worked:
openclaw --version
You should see something like openclaw v1.x.x. If you get an error, make sure your Node.js is up to date and try again.
Step 2: Initialize Your Workspace
Every OpenClaw agent needs a workspace โ a directory where it stores its configuration, memory, and files. Let's create one:
openclaw init ~/my-agent
cd ~/my-agent
This creates a clean workspace with the default file structure:
my-agent/
โโโ AGENTS.md # Agent behavior rules
โโโ SOUL.md # Agent personality
โโโ USER.md # Info about you
โโโ TOOLS.md # Tool-specific notes
โโโ memory/ # Persistent memory
โโโ .openclaw/
โโโ config.yaml # Main configuration
Step 3: Configure Your AI Provider
Open .openclaw/config.yaml in your favorite editor. You'll need to set your AI provider and API key:
model:
provider: anthropic
model: claude-sonnet-4-20250514
apiKey: sk-ant-your-key-here
# Or for OpenAI:
# model:
# provider: openai
# model: gpt-4o
# apiKey: sk-your-key-here
Pro tip: you can also set the API key as an environment variable (ANTHROPIC_API_KEY or OPENAI_API_KEY) instead of putting it in the config file. That's generally safer.
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
Step 4: Customize Your Agent (Optional but Fun)
Open SOUL.md and give your agent some personality. This file defines who your agent is. The default is fine, but it's way more fun to customize:
# SOUL.md
You're Claw, a sharp and efficient AI assistant.
You're direct, a little witty, and you get things done.
You prefer action over discussion.
When something can be automated, you automate it.
Then edit USER.md with some info about yourself:
# USER.md
- Name: Alex
- Role: Indie hacker building a SaaS product
- Timezone: US Eastern
- Preferences: Keep responses concise. I like bullet points.
This context helps your agent give more relevant, personalized responses right from the start.
Step 5: Start Your Agent
Here's the moment of truth:
openclaw gateway start
This starts the OpenClaw gateway โ the background service that keeps your agent running. You should see confirmation that it's up and listening.
Now start a chat session:
openclaw chat
You're now talking to your agent! Try some things:
> Hey, what can you do?
> Search the web for the latest news about AI agents
> Create a file called ideas.md with three startup ideas
> What's the weather like in New York?
Your agent will use its built-in tools to actually perform these tasks โ searching the web, creating files, fetching data. It's not just generating text; it's doing things.
Step 6: Explore the Built-in Tools
Out of the box, your agent can:
- Read and write files in your workspace
- Run shell commands (with your permission)
- Search the web using Brave Search
- Fetch web pages and extract content
- Keep persistent memory across sessions
Try this fun test:
> Remember that my favorite programming language is Rust
> Actually, create a memory note about my current project:
I'm building a habit tracking app called "StreakUp"
Now close the chat (Ctrl+C), start it again, and ask:
> What's my favorite programming language?
> What project am I working on?
Your agent remembers. That's the persistent memory in action.
Step 7: Connect a Channel (Bonus)
Chatting in the terminal is great, but the real magic happens when you connect your agent to channels you already use. OpenClaw supports Discord, iMessage, Slack, and more.
For example, to connect Discord:
# In .openclaw/config.yaml
channels:
- type: discord
token: your-discord-bot-token
Now your agent lives in your Discord server, ready to help whenever you need it. You can message it directly, mention it in channels, and it'll respond with full access to all its tools.
What's Next?
You've got a working agent. Here's where to go from here:
- Add more skills: Browse the OpenClaw skill library for email, calendar, social media, and more
- Set up heartbeats: Configure your agent to periodically check things (email, calendar, news) without you asking
- Connect your phone: Pair your mobile device as a node for camera, location, and notification capabilities
- Join the community: The ClawMakers Skool group is the best place to get help, share your setup, and steal ideas from other builders
Common Gotchas
A few things that trip people up:
- "Command not found": Make sure
npm install -gworked and the npm global bin is in your PATH - "API key invalid": Double-check your key and make sure you're using the right provider
- "Permission denied": Your agent asks before running shell commands. Type
yto approve or configure auto-approval for safe commands - Agent seems slow: The first response takes longer as the model loads context. Subsequent messages are faster
The 10-Minute Challenge
If you followed along, you should now have a fully functional AI agent in about 10 minutes. Not bad, right?
The real power of OpenClaw isn't in any single feature โ it's in the compound effect of having an AI that knows you, remembers your context, and can actually interact with your tools. The more you use it, the more useful it becomes.
Start small. Automate one annoying task. Then another. Before you know it, you'll wonder how you ever worked without it.
Happy building! ๐ฆ
Enjoyed this article?
Join the ClawMakers community to discuss this and more with fellow builders.
Join on Skool โ It's Free โ