Auto-execution CLI tool for LLM-powered task automation using local Ollama processing.
This project enables automatic tool execution using local LLM processing. The LLM automatically:
- Analyzes user requests and determines required tools
- Executes tools automatically without manual intervention
- Continues conversation with tool results
- Handles simple tasks through focused tool usage
- Auto-Execution: LLM automatically selects and executes tools
- Local AI Processing: Uses Ollama for 100% local AI processing
- Tool-Based Architecture: 8 specialized tools for automation
- Interactive CLI: Inquirer-based command line interface
- Context Management: Persistent conversation history and session management
- Intelligent Tool Selection: LLM chooses appropriate tools automatically
| Tool | Description | Auto-Execution |
|---|---|---|
BashTool |
Execute bash commands securely | โ Automatic |
GrepTool |
Search files with regex patterns | โ Automatic |
GlobTool |
Find files using glob patterns | โ Automatic |
ReadTool |
Read file contents | โ Automatic |
EditTool |
Edit existing files | โ Automatic |
WriteTool |
Create new files (restricted) | โ Automatic |
LSTool |
List directory contents | โ Automatic |
WebFetchTool |
Fetch web content | โ Automatic |
# Clone the repository git clone https://github.com/NeaByteLab/Ollama-API-Tools cd Ollama-API-Tools # Install dependencies npm install # Install Ollama (if not already installed) # Visit: https://ollama.ai or https://ollama.com
- Node.js 18+
- Ollama running locally
- Granite 3.2:8b model (or compatible model)
npm start
# or
node CLI.jsnode CLI.js info
- User Input: You describe what you want
- LLM Analysis: LLM analyzes request and selects tools
- Auto-Execution: Tools execute automatically
- Result Processing: Results are added to conversation
- Continued Conversation: LLM responds with results
Edit CLI.js line 40 to change the default model:
const defaultModel = 'granite3.2:8b' // Change this
granite3.2:8b(default)qwen2.5-coder:7bllama3.2:8b- Any Ollama-compatible model
# List directory contents You: list files in current directory # Read file contents You: read package.json # Search for patterns You: find all files containing "import" # Edit files You: add a comment to the main function
# Check running services You: check if redis is running # Execute commands You: run npm install # System information You: show system info
# Fetch web content
You: get content from https://example.com# Basic file operations You: read package.json and show dependencies # Simple search You: find all files containing "import" in src folder
- Intelligent Tool Selection: LLM automatically chooses appropriate tools
- Single Tool Execution: Simple, focused tool usage per request
- Error Handling: Automatic error reporting and fallback
- Context Awareness: Maintains conversation context across tool executions
- Result Integration: Tool results automatically feed back into conversation
Ollama-API-Tools/
โโโ CLI.js # Main CLI application with auto-execution
โโโ package.json # Dependencies and scripts
โโโ prompt/ # AI prompt configurations
โ โโโ prompt.txt # Main system prompt
โ โโโ message.json # Message templates
โโโ tools/ # Tool implementations
โ โโโ Registry.js # Tool registry
โ โโโ BashTool.js # Command execution
โ โโโ ReadTool.js # File reading
โ โโโ ... # Other tools
โโโ services/ # Service layer
โ โโโ Provider.js # Ollama API integration
โโโ utils/ # Utilities
โ โโโ Context.js # Session management
โโโ tests/ # Test files
โโโ TestTools.js # Tool testing
- Create tool file in
tools/directory - Implement tool class with
execute()method - Add to
Registry.jsexports - Update prompt.txt tool list
npm test # or node tests/TestTools.js
Ollama not running
# Start Ollama
ollama serveModel not found
# Pull model
ollama pull granite3.2:8bTool execution errors
- Check file permissions
- Verify tool dependencies
- Review error messages in console
Auto-execution not working
- Check LLM model compatibility
- Verify tool schema definitions
- Review prompt configuration
MIT License - NeaByteLab
