An AI-powered extension for Gemini CLI that makes creating custom agents effortless through natural conversation.
This extension provides the /new-agent command that guides you through creating custom agent definitions using AI-assisted conversation. Instead of manually writing TOML files or filling out forms, you simply chat with the AI about what you want to build.
-
Clone this repository into your Gemini extensions directory:
git clone https://github.com/jduncan-rva/gemini-agent-creator.git ~/.gemini/extensions/agent-creator -
Restart Gemini CLI to load the extension
-
Verify installation:
/extensions list
You should see
agent-creatorin the list.
Provide a brief description and let the AI flesh out a complete agent:
/new-agent "reviews code for security vulnerabilities"The AI will:
- Analyze your description
- Generate a comprehensive agent definition with smart defaults
- Show you the complete TOML configuration
- Ask for your approval before saving
Example descriptions:
"reviews python code for bugs""generates API documentation""writes unit tests for functions""explains complex code in simple terms""finds performance bottlenecks"
Run without arguments for step-by-step guidance:
/new-agentThe AI will guide you through:
- Defining what your agent does
- Selecting which tools it needs
- Writing its behavior and instructions
- Defining input parameters
- Reviewing the generated configuration
- Saving to
~/.gemini/agents/
> /new-agent "analyzes code for performance issues"
Great! I'll create a performance analysis agent for you.
Based on your description, here's what I'm proposing:
**Agent: performance_analyzer**
- Display Name: ⚡ Performance Analyzer
- Icon: ⚡
- Tools: read, grep, glob
- Purpose: Identifies performance bottlenecks and optimization opportunities
Here's the complete configuration:
```toml
name = "performance_analyzer"
displayName = "⚡ Performance Analyzer"
description = "Analyzes code for performance issues and suggests optimizations"
icon = "⚡"
tools = ["read", "grep", "glob"]
systemPrompt = """
You are a performance optimization expert...
[detailed instructions]
"""
query = "Analyze ${file_path} for performance issues"
[inputs.file_path]
type = "string"
description = "Path to file or directory to analyze"
required = true
Does this look good, or would you like to customize anything?
looks perfect!
✅ Saving to ~/.gemini/agents/performance_analyzer.toml... 🎉 Agent created successfully! Restart CLI to use it.
## 🛠️ Available Tools for Agents
Your agent can use these read-only tools:
- `ls` - List directories
- `read` - Read files
- `grep` - Search in files
- `glob` - Find files by pattern
- `read_many_files` - Read multiple files
- `memory` - Persistent memory
- `web_search` - Web search
## 📚 Agent Templates
The assistant knows about common agent patterns:
- **Code Reviewers** - Find bugs, security issues, style problems
- **Documentation Generators** - Create docs from code
- **Test Writers** - Generate test cases
- **Research Assistants** - Gather information
- **Code Explainers** - Explain complex code
## 💡 Tips
- Be specific about what you want the agent to do
- Think about what files/data it needs to access
- Consider what inputs make sense (file paths, questions, etc.)
- The AI will suggest good defaults - feel free to customize
## 🔧 Troubleshooting
**Extension not found?**
- Restart Gemini CLI to load the extension
- Check that the extension is in `~/.gemini/extensions/agent-creator/`
- Verify `gemini-extension.json` exists in the extension directory
**Agent not working after creation?**
- Restart CLI to load the new agent
- Check the TOML file for syntax errors: `~/.gemini/agents/<name>.toml`
- Use `/agents` to verify it loaded
**Want to edit an agent?**
- Edit the file directly: `~/.gemini/agents/<name>.toml`
- Or delete and recreate with `/new-agent`
## 📋 Requirements
- [Gemini CLI](https://github.com/google-gemini/gemini-cli) with user-defined agents support
- The agent system must be available (check for `~/.gemini/agents/` directory)
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## 📄 License
MIT License - see [LICENSE](LICENSE) file for details
## 🙏 Credits
Created by [@jduncan-rva](https://github.com/jduncan-rva) with [Claude Code](https://claude.com/claude-code)
Built for [Gemini CLI](https://github.com/google-gemini/gemini-cli) by the Google Gemini team
## 🔗 Related
- **Main Fork with Agent System**: [jduncan-rva/gemini-cli](https://github.com/jduncan-rva/gemini-cli/tree/feature/user-defined-agents)
- **Gemini CLI**: [google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli)
---
**Note**: This extension requires the user-defined agents feature. See the [feature branch](https://github.com/jduncan-rva/gemini-cli/tree/feature/user-defined-agents) for installation.