Quick Start
This guide walks you through creating your first agent and chatting with it.
1. Initialize a Workspace
duragent init
# Follow the interactive setup
This creates a .duragent/ directory with a starter agent and configuration.
2. Authenticate
Set up credentials for your LLM provider:
# Option A: API key via environment variable
export OPENROUTER_API_KEY=your-key
# Option B: OAuth login (Anthropic only — tokens auto-refresh)
duragent login anthropic
See Authentication for details on all providers.
3. Chat with Your Agent
duragent chat --agent <YOUR_AGENT_NAME>
The server starts automatically. Type your message and press Enter.
Press Ctrl+C or type /exit to detach from the session.
4. Attach to a Session Later
Sessions are durable — detaching doesn’t lose your conversation. Reconnect at any time:
duragent attach --list # List attachable sessions
duragent attach SESSION_ID # Reconnect to existing session
What’s Next?
- Learn about the Agent Format to customize your agents
- Add Tools to give your agent capabilities
- Set up Telegram or Discord to chat from messaging platforms
- Configure Memory for persistent agent knowledge