Creating and Managing Agents
Run Qodo Gen CLI with a configured agent
Create your own agent for Qodo Gen CLI to use, then run Qodo Gen CLI with a customizable command.
1. Create an agent file
Create a file <your-command-name-here>.toml
and save it under a folder called agents
.
You can create an initial skeleton of an agent file by running:
2. Customize your agent
Follow the skeleton and customize your agent to your needs. You can set instructions, import existing agents configurations for your agent to use, and give it tools to utilize:
Name your agent file after the command you want to use to run it. This name should also appear in the file itself, under the commands
section.
The fields of the agent file are:
description
string
Description of what your agent does
instructions
string
Prompt for the AI models explailing the required behavior
arguments
list of objects
List of possible arguments that can be given to the agent.
The arguments will be translated and forwarded to MCP servers.
mcpServers
string
List of MCP servers used by the agent
available_tools
list
List of MCP server names
execution_strategy
"act" or "plan"
Plan lets the agent think through a multi-step strategy, act executes actions immediately
output_schema
string
Valid json of the wanted agent output
exit_expression
string
For CI runs, a condition used to determine if the agent run succeeded or failed
Example agent TOML file
3. Set output type
You can give your agent a json
schema to follow as its output. If there’s no output schema given, your agent will output a textual summary as a reply for a query.
4. Create an agent.toml
file
agent.toml
fileAdd your agent to a file called agent.toml
. This file will hold all agent files that Qodo Gen CLI will know and be able to call.
Example agent.toml
file:
Use your agent
You can now run your agent by calling:
Agent as server
You can also run an agent as a tool server:
This launches the agent as a service listening on port 3000
.
The service can be integrated with other AI tools or exposed via URL.
You can exit at any time by pressing Escape
.
AI Model selection
You can use a specific AI model with --model=<model_name>
.
For a list of available model names, run qodo models
.
mcp.json
file
mcp.json
fileYou can define MCP servers to be used by agents in a file called mcp.json
. This will make the MCP servers available to all agents you're configuring.
If you want a specific MCP server for your agent that doesn't need to be reused for other agents, you can define it in the specific agent configuration TOML file.
Available Agent Commands and Flags
init
Generate starter agent configuration file
create-agent
Create a new agent by translating user requirements into a valid TOML configuration
<command-name>
Run a configured agent
-agentfile=path
Specify a custom path to an agent TOML file
<command-name> --mcp
Run an agent as a service (listening on port 3000)
mcp-list
List available local and remote tools
models
List available models
--model=model_name
Specify a custom model to use
--ci
Run commands in CI mode
--mcp
Run all configured agents as tools in MCP-server mode
--ui
Open Qodo Gen CLI with web interface
-h
, --help
View all available commands and flags
-l
, --log=path
Redirect console output to a file (directed in the path), or to stdout
or stderr
--silent
Suppress all console output except the final result. Logs go to /dev/null
--resume=session_id
Resume a task with the given session ID
Last updated
Was this helpful?