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 thisgranite3.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.jsOllama 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
