Start Command
The start
command launches an ElizaOS project or agent in production mode. It initializes the agent runtime, loads plugins, connects to services, and starts handling interactions.
Usage
elizaos start [options]
Options
Option | Description |
---|---|
-p, --port <port> | Port to listen on (default: 3000) |
-c, --configure | Reconfigure services and AI models (skips using saved configuration) |
--character <path> | Path or URL to character file to use instead of default |
--build | Build the project before starting |
Production Features
When you run start
, ElizaOS provides production-ready features:
- Optimized Performance: Runs with production optimizations
- Stable Configuration: Uses saved configuration by default
- Service Management: Handles service connections and disconnections
- Error Recovery: Automatic recovery from transient errors
- Resource Management: Efficient resource allocation and cleanup
What Happens During Startup
When you run the start
command, ElizaOS:
- Detects whether you're in a project or plugin directory
- Loads and validates the configuration
- Initializes the database system
- Loads required plugins
- Starts any configured services
- Processes knowledge files if present
- Starts the HTTP API server
- Initializes agent runtimes
- Begins listening for messages and events
For development features and hot reloading, see the Dev Command.
Project Detection
ElizaOS automatically detects projects in the current directory by looking for:
- A
package.json
with aneliza.type
field set toproject
- A main entry point that exports a project configuration with agents
- Other project indicators in the package metadata
Environment Variables
The start
command will look for an .env
file in the project directory and load environment variables from it. You can also set environment variables directly:
# Set environment variables directly
OPENAI_API_KEY=your-api-key elizaos start
For detailed information about environment configuration, see the Environment Command.
Examples
Basic startup
cd my-agent-project
elizaos start
Starting with configuration
elizaos start --configure
Starting with a custom port
elizaos start --port 8080
Starting with a custom character
elizaos start --character path/to/character.json
Building Before Starting
To build your project before starting it:
elizaos start --build
This will compile your TypeScript files and prepare the project for execution.