Eliza Terminal Chat
A command-line interface for chatting with Eliza agents using Deno.
Requirements
- Deno runtime installed on your system
rlwrap
Installation
No installation needed! The script runs directly with Deno.
Bash Alias Function
To simplify running the script, you can define a bash alias function:
function etc(){
env SERVER_URL="${SERVER_URL:-http://localhost:3000}" \
rlwrap \
npx -y deno run \
--allow-env=DEBUG,SERVER_URL \
--allow-net \
https://btwiuse.github.io/eliza-terminal-chat/terminal-chat.ts "$@"
}
You can override the SERVER_URL value by setting the environment variable:
export SERVER_URL=https://example.com:443
Usage
You can run the script in two ways:
- Specify an agent name:
- Let it automatically select the first available agent:
Environment Variables
SERVER_URL: The URL of the Eliza server (default: http://localhost:3000)
Features
- Connect to any Eliza agent by name
- Automatic agent selection if no name provided
- Interactive chat interface in the terminal
- Clean exit with Ctrl+C or typing ‘exit’
- Intelligent error handling:
- Warns when multiple agents are available and none specified
- Shows error when no agents are available
- Shows error when specified agent not found
How it Works
- The script first connects to the Eliza server’s
/agents endpoint to:
- List available agents
- Find the specified agent (if name provided)
- Select the first available agent (if no name provided)
- Once connected, you can:
- Type messages and press Enter to send
- See agent responses in the terminal
- Type ‘exit’ or press Ctrl+C to quit
Error Messages
- “No agents available”: The server has no configured agents
- “No agent found with name: [name]”: The specified agent name doesn’t exist
- “Multiple agents found, using the first one: [name]”: Warning when auto-selecting from multiple agents