Console plugin for ElizaOS - enables agent chat via stdin/stdout.
This plugin provides a simple text-based interface for interacting with ElizaOS agents through the terminal. It's useful for:
- Development and testing: Quick iteration without needing a full client setup
- Scripting and automation: Pipe input/output for automated workflows
- Headless deployments: Run agents on servers without a GUI
- Interactive CLI sessions: Chat with your agent directly in the terminal
npm install @elizaos/plugin-consoleOr with bun:
bun add @elizaos/plugin-consoleAdd the plugin to your character's plugins array:
{
"name": "MyAgent",
"plugins": ["@elizaos/plugin-console"]
}import { consolePlugin } from "@elizaos/plugin-console";
const character = {
name: "MyAgent",
plugins: [consolePlugin],
};| Variable | Default | Description |
|---|---|---|
CONSOLE_SHOW_THOUGHTS |
false |
Set to "true" to display the agent's internal thought process |
CONSOLE_SHOW_ACTIONS |
false |
Set to "true" to display action names when executed |
When running with a TTY (interactive terminal), you'll see:
🤖 MyAgent is ready to chat!
Type your message and press Enter. Press Ctrl+C to exit.
> Hello!
MyAgent: Hi there! How can I help you today?
>
The plugin also supports non-interactive mode for scripting:
# Single message
echo "What is the weather like?" | elizaos start
# Multiple messages from a file
cat questions.txt | elizaos start
# Save responses
echo "Tell me a joke" | elizaos start > response.txt- Automatic environment setup: Creates a console world, room, and user entity
- Event-driven: Integrates with ElizaOS's event system (MESSAGE_RECEIVED, MESSAGE_SENT)
- Streaming support: Responses appear as they're generated
- Clean shutdown: Handles Ctrl+C gracefully
The ConsoleService provides:
interface ConsoleService {
// Check if the service is running
readonly running: boolean;
// Get the room ID for console chat
readonly consoleRoomId: UUID;
// Get the entity ID for the console user
readonly consoleEntityId: UUID;
// Stop the service
stop(): Promise<void>;
}Access the service from runtime:
const consoleService = runtime.getService<ConsoleService>("console");
if (consoleService?.running) {
console.log(`Console room: ${consoleService.consoleRoomId}`);
}MIT