FLASH (Fast Local Agent SHell) CLI is an AI-powered command-line interface that allows you to interact with local (or remote) Ollama models while having the ability to execute shell commands directly or through the AI.
- Interactive AI Chat: Chat with local or self-hosted models served by Ollama, directly from your terminal.
- Switchable Backend: Point Flash at
localhostor any remote Ollama server via a single config option. - Shell Command Execution:
- AI can use a
shelltool to execute commands and see their output. - Manually execute shell commands using the
!prefix.
- AI can use a
- Context Management: Automatic history trimming to stay within token limits.
- Markdown Support: Rich formatting for AI responses in the terminal.
-
Clone the repository:
git clone https://github.com/Natuworkguy/Flash cd Flash -
Install dependencies:
pip install -r requirements.txt
-
Install and start Ollama:
Flash talks to an Ollama server. Install Ollama, start it, and pull a model that supports tool calling:
ollama pull llama3.1
By default, Flash connects to a local server at
http://localhost:11434. To use a remote server, setOLLAMA_HOST(see Configuration).
python3 run.pyFLASH CLI is configured through environment variables. You can create a flash.env file in your home directory:
MODEL=llama3.1
OLLAMA_HOST=http://localhost:11434For a full reference of every option, see docs/CONFIGURATION.md.
| Variable | Description | Default | Minimum |
|---|---|---|---|
MODEL |
Required. The Ollama model name (e.g., llama3.1). Must be pulled on the target server. |
None | N/A |
OLLAMA_HOST |
Base URL of the Ollama server. Set this to point at a remote machine instead of localhost. | http://localhost:11434 |
N/A |
MAX_HISTORY_MESSAGES |
Maximum number of messages kept in history. | 6 | 2 |
MAX_HISTORY_CHARS |
Maximum characters kept in history. | 3000 | 1000 |
MAX_TOOL_ROUNDS |
Maximum tool-calling rounds per request. | 4 | 1 |
MAX_TOOL_OUTPUT_CHARS |
Maximum characters for tool output before truncation. | 1200 | 500 |
MAX_OUTPUT_TOKENS |
Maximum tokens for AI response (num_predict). |
512 | 128 |
- Local (default): leave
OLLAMA_HOSTunset, or set it tohttp://localhost:11434. - Remote server: set
OLLAMA_HOSTto the other machine, e.g.OLLAMA_HOST=http://192.168.1.50:11434orOLLAMA_HOST=https://ollama.example.com.
Make sure the target server is reachable and that MODEL has been pulled on it.
Start the CLI by running:
python run.py/helpor/?: Display the help message./model: Show the currently active model and Ollama host./clear: Clear the conversation history./bye: Exit the application.
You can run shell commands directly without AI intervention:
!ls -la!git status!echo "Hello"
Simply type your request. If the AI needs to see the contents of a file or run a command to answer your question, it can invoke the shell tool automatically. It can also search the web via Duck Duck Go and show it's reasoning.