Overview
Thego command launches an interactive agent session without requiring a separate agent.py file. It’s the fastest way to start chatting with an AI agent and test MCP server integrations.
Usage
Options
Agent Configuration
Name for the agent instance.
Path to file or URL containing instruction for the agent. Sets the base system prompt.
Override the default model. Supports model aliases and full identifiers.
Target a specific agent by name for messages and initial interactive mode.
MCP Server Configuration
Path to fastagent.config.yaml file. If not specified, searches recursively from current directory.
Comma-separated list of server names to enable from config.
Comma-separated list of HTTP/SSE URLs to connect to.
Authorization token value for URL-based servers. The ‘Bearer ’ prefix is optional.
OAuth Client ID Metadata Document URL for servers that don’t support dynamic client registration.
Agent Cards
Path or URL to an AgentCard file or directory. Can be specified multiple times.
Path or URL to an AgentCard file or directory to load as tools. Can be specified multiple times.
STDIO MCP Servers
NPX package and args to run as MCP server (quoted).
UVX package and args to run as MCP server (quoted).
Command to run as STDIO MCP server (quoted).
Message Handling
Message to send to the agent. Skips interactive mode and exits after response.
Path to a prompt file to use (either text or JSON).
Write resulting history to file. For multi-model mode, creates per-model suffixed files.
Session Management
Resume the last session or a specified session ID.
Enable manual AgentCard reloads via
/reload command.Watch AgentCard paths and reload automatically when files change.
Environment
Override the base fast-agent environment directory.
Run without implicit environment-side effects.
Override the default skills directory.
Shell Runtime
Enable a local shell runtime and expose the execute tool (bash or pwsh).
Smart Agent
Prefer a smart default agent when fast-agent creates the default agent.
Output Control
Disable progress/chat/tool output and print only direct command output.
Examples
Basic Interactive Session
With MCP Servers from Config
filesystem and fetch MCP servers defined in your config.
Remote MCP Server
With Shell Access
One-Shot Query
--quiet to suppress extra output.
Multi-Model Comparison
With Custom Model
With Agent Cards
Resume Previous Session
Interactive Mode
When running in interactive mode, you can use slash commands:| Command | Description |
|---|---|
/help | Show available commands |
/exit or /quit | Exit the session |
/clear | Clear conversation history |
/model | Switch models |
/agent | Switch between agents (if multiple loaded) |
/tools | List available MCP tools |
/prompt | Apply an MCP prompt |
/reload | Reload agent cards (with —reload flag) |
Multi-Model Mode
Specify multiple models with comma-separated values:- The same message is sent to all models
- Responses are displayed side-by-side
- Results can be saved to separate files
Environment Detection
fast-agent prevents running nested shell sessions:FAST_AGENT_SHELL_CHILD to continue.
Configuration Precedence
Settings are applied in this order (later overrides earlier):- Default values
- Config file (fastagent.config.yaml)
- Environment variables
- Command-line options
Related Commands
scaffold
Create config files for persistent agent definitions
auth
Manage OAuth tokens for MCP servers
check
Verify your configuration and API keys
serve
Run fast-agent as an MCP server
