Installation
Set up your development environment for SwiftClaw
Installation
Set up your local development environment to build and test agents before deploying to SwiftClaw.
System Requirements
- Node.js: 18.x or later
- Python: 3.9 or later (if using Python agents)
- Git: For repository management
- Operating System: macOS, Linux, or Windows (WSL recommended)
Install SwiftClaw CLI
The SwiftClaw CLI allows you to manage agents, deploy, and monitor from your terminal.
npm install -g swiftclaw-cliyarn global add swiftclaw-clipnpm add -g swiftclaw-cliVerify installation:
swiftclaw --versionAuthentication
Log in to your SwiftClaw account:
swiftclaw loginThis will open a browser window for authentication. Once complete, your credentials are stored securely in ~/.swiftclaw/config.
API Keys: You can also authenticate using API keys for CI/CD environments.
Using API Keys
For automated deployments:
export SWIFTCLAW_API_KEY=your_api_key_here
swiftclaw whoamiGenerate API keys in the dashboard under Settings → API Keys.
Install SDK
Install the SwiftClaw SDK for your preferred language:
pip install swiftclawOr with poetry:
poetry add swiftclawnpm install swiftclawOr with yarn:
yarn add swiftclawgo get github.com/swiftclaw/swiftclaw-goProject Setup
Initialize a New Project
Create a new agent project:
swiftclaw init my-agent
cd my-agentThis creates a project structure:
my-agent/
├── swiftclaw.json # Configuration file
├── agent.py # Agent code (or agent.ts)
├── requirements.txt # Dependencies (or package.json)
├── .env.example # Environment variables template
└── README.md # Project documentationConfigure Your Agent
Edit swiftclaw.json:
{
"name": "my-agent",
"version": "1.0.0",
"runtime": "python3.11",
"model": {
"primary": "gpt-4",
"fallbacks": ["claude-3-sonnet"]
},
"memory": {
"type": "persistent",
"ttl": "30d"
},
"triggers": [
{
"type": "api",
"path": "/chat"
}
],
"environment": {
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
}
}Set Up Environment Variables
Copy the example file:
cp .env.example .envEdit .env with your API keys:
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...Security: Never commit .env files to version control. They're automatically ignored by .gitignore.
Install Dependencies
pip install -r requirements.txtnpm installLocal Development
Run your agent locally for testing:
swiftclaw devThis starts a local development server with:
- Hot reload on code changes
- Local memory storage
- Debug logging
- API endpoint at
http://localhost:8000
Testing Locally
Send test requests:
curl http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{
"message": "Hello, agent!",
"session_id": "test-session"
}'Or use the interactive CLI:
swiftclaw chat --localIDE Setup
VS Code
Install the SwiftClaw extension:
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "SwiftClaw"
- Click Install
Features:
- Syntax highlighting for
swiftclaw.json - IntelliSense for SDK functions
- Integrated deployment
- Log streaming
PyCharm / IntelliJ
Install the SwiftClaw plugin:
- Go to Settings → Plugins
- Search for "SwiftClaw"
- Click Install and restart
Verify Installation
Check that everything is set up correctly:
# Check CLI version
swiftclaw --version
# Check authentication
swiftclaw whoami
# Check SDK installation
python -c "import swiftclaw; print(swiftclaw.__version__)"
# or
node -e "console.log(require('swiftclaw').version)"
# Test local development
swiftclaw dev --checkTroubleshooting
CLI Not Found
If swiftclaw command is not found:
# Check if npm global bin is in PATH
npm config get prefix
# Add to PATH (add to ~/.bashrc or ~/.zshrc)
export PATH="$PATH:$(npm config get prefix)/bin"Authentication Issues
If login fails:
# Clear cached credentials
rm -rf ~/.swiftclaw/config
# Try logging in again
swiftclaw loginSDK Import Errors
If SDK imports fail:
# Verify installation
pip show swiftclaw
# Reinstall if needed
pip uninstall swiftclaw
pip install swiftclaw# Verify installation
npm list swiftclaw
# Reinstall if needed
npm uninstall swiftclaw
npm install swiftclawNext Steps
Now that your environment is set up:
- Deploy Your First Agent - Create and deploy a simple agent
- Core Concepts - Understand SwiftClaw's architecture
- Configuration Reference - Learn all configuration options
Need Help? Join our Discord community or check the troubleshooting guide.
How is this guide ?
Last updated on