A simple CLI agent that uses Ollama. It can read files, list directories, and make file edits.
- Privacy: Fully local, no data leaves your machine
- Cost: Free (runs on your hardware)
- Customizable: Open source; modify tools and behavior
- No dependencies: No API keys or subscriptions
- Node.js (v14+)
- Ollama installed and a model available (default:
gpt-oss:20b)
npm installnode index.jsThe agent will:
- Check if Ollama is running on
http://localhost:11434 - Start it automatically if needed (stops on exit)
- Begin an interactive chat session
Type your requests naturally. The model will use available tools to help you.
The agent has access to these tools:
-
read_file: Read contents of a filepath: Relative file path
-
list_files: List files and directories recursivelypath: Optional directory path (defaults to current directory)
-
edit_file: Replace text in a filepath: File pathold_str: Exact text to replace (must appear exactly once)new_str: Replacement text
Set environment variables to customize behavior:
OLLAMA_HOST: Ollama server URL (default:http://localhost:11434)OLLAMA_BIN: Path toollamabinary (default:ollama)OLLAMA_TIMEOUT_MS: Startup timeout in ms (default:20000)
Example:
OLLAMA_HOST=http://localhost:11434 OLLAMA_TIMEOUT_MS=30000 node index.js