rodger
v2.0.0
Published
CLI tool for Rodger.ai - Build and manage AI agents
Downloads
2
Readme
rodger
Official CLI tool for Rodger.ai - Build and manage AI agents.
Installation
npm install -g rodgerOr use directly with npx:
npx rodger <command>Quick Start
Create a new agent project:
npx rodger init my-agent
cd my-agent
npm installAdd your API keys to .env:
OPENAI_API_KEY=sk-...Start development server:
rodger devCommands
Core Commands
init [name]
Scaffold a new Rodger agent project.
rodger init my-support-bot
# With template
rodger init my-agent --template knowledge-agentAvailable Templates:
basic-chat- Simple Q&A chatbotknowledge-agent- Agent with RAG knowledge basetool-agent- Agent with custom toolsloan-assistant- Full-featured example
dev
Start the local development server.
rodger dev
# Custom port
rodger dev --port 3001test <message>
Test your agent with a message.
rodger test "Hello, what can you help with?"
# Stream response
rodger test "Tell me a story" --stream
# With session ID
rodger test "Continue our conversation" --session-id abc123Knowledge Commands
Manage your agent's knowledge base (Ragie or Zep).
knowledge upload <file>
Upload a document to the knowledge base.
rodger knowledge upload ./docs/faq.pdf
# With metadata
rodger knowledge upload ./docs/guide.txt --metadata '{"category": "support"}'Supported formats: PDF, TXT, MD, DOCX, and more.
knowledge search <query>
Search the knowledge base.
rodger knowledge search "password reset"
# Limit results
rodger knowledge search "billing" --limit 10knowledge status <documentId>
Check document processing status.
rodger knowledge status doc_abc123Guardrails Commands
Test and validate guardrail rules.
guardrails test
Run the guardrail test suite.
rodger guardrails test
# Verbose output
rodger guardrails test --verboseTests common violations:
- PII detection (emails, SSNs, phone numbers)
- Toxic content
- Off-topic queries
- Custom rules
guardrails validate <text>
Validate text against guardrail rules.
rodger guardrails validate "My email is [email protected]"Environment Variables
Required (at least one)
OPENAI_API_KEY- OpenAI API keyANTHROPIC_API_KEY- Anthropic API key
Optional (for knowledge base)
RAGIE_API_KEY- Ragie API keyZEP_API_KEY- Zep Cloud API keyZEP_COLLECTION- Zep collection name (default: "default")
Project Structure
After running rodger init, you'll have:
my-agent/
├── agent.config.ts # Agent configuration
├── app/
│ └── api/
│ └── chat/
│ └── route.ts # Chat API endpoint
├── package.json
├── .env # Environment variables
└── tsconfig.jsonConfiguration
Edit agent.config.ts to customize your agent:
import { createAgent } from '@rodger/core';
export const agent = createAgent({
name: 'My Agent',
llm: {
provider: 'openai',
model: 'gpt-4o-mini',
apiKey: process.env.OPENAI_API_KEY!,
},
systemPrompt: 'You are a helpful assistant...',
// Add knowledge base
knowledge: {
provider: 'ragie',
apiKey: process.env.RAGIE_API_KEY!,
},
// Add guardrails
guardrails: [
{
name: 'pii-detection',
type: 'input',
// ... config
},
],
});Examples
Test agent locally
# Quick test
rodger test "Hello!"
# Stream response
rodger test "Write a poem" --stream
# Test with session
rodger test "What's my name?" --session-id user_123Upload documentation
# Upload support docs
rodger knowledge upload ./docs/faq.pdf
# Upload with metadata
rodger knowledge upload ./docs/v2-guide.md --metadata '{"version": "2.0"}'Validate guardrails
# Test all guardrails
rodger guardrails test
# Validate specific text
rodger guardrails validate "My SSN is 123-45-6789"Troubleshooting
Missing API keys
If you see API key errors:
- Check
.envfile exists - Verify API keys are set correctly
- Restart dev server after changing
.env
TypeScript errors
Make sure you're running from the project root directory where agent.config.ts exists.
Knowledge upload fails
Verify your knowledge provider API key:
# For Ragie
echo $RAGIE_API_KEY
# For Zep
echo $ZEP_API_KEYLearn More
License
MIT
