GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - NeaByteLab/Ollama-API-Tools: Node.js CLI with auto-execution capabilities using local Ollama models for intelligent tool selection and automation

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
prompt
prompt
 
 
screenshoot
screenshoot
 
 
services
services
 
 
tests
tests
 
 
tools
tools
 
 
utils
utils
 
 
.gitignore
.gitignore
 
 
CLI.js
CLI.js
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 

Repository files navigation

๐Ÿค– Ollama API Tools

Auto-execution CLI tool for LLM-powered task automation using local Ollama processing.

CLI Preview

๐ŸŽฏ Purpose

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

โœจ Features

  • 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

๐Ÿ› ๏ธ Tools Available

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

๐Ÿ“ฆ Installation

# 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

โš™๏ธ Prerequisites

  • Node.js 18+
  • Ollama running locally
  • Granite 3.2:8b model (or compatible model)

๐Ÿš€ Usage

Start Auto-Execution Session

npm start
# or
node CLI.js

Show System Information

node CLI.js info

โšก How Auto-Execution Works

  1. User Input: You describe what you want
  2. LLM Analysis: LLM analyzes request and selects tools
  3. Auto-Execution: Tools execute automatically
  4. Result Processing: Results are added to conversation
  5. Continued Conversation: LLM responds with results

โš™๏ธ Configuration

Default Model

Edit CLI.js line 40 to change the default model:

const defaultModel = 'granite3.2:8b' // Change this

Available Models

  • granite3.2:8b (default)
  • qwen2.5-coder:7b
  • llama3.2:8b
  • Any Ollama-compatible model

๐Ÿ“ Auto-Execution Examples

File Operations

# 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

๐Ÿ”ง System Operations

# Check running services
You: check if redis is running

# Execute commands
You: run npm install

# System information
You: show system info

๐ŸŒ Web Operations

# Fetch web content
You: get content from https://example.com

๐Ÿ”„ Simple Workflows

# Basic file operations
You: read package.json and show dependencies

# Simple search
You: find all files containing "import" in src folder

๐ŸŽฏ Auto-Execution Features

  • 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

๐Ÿ› ๏ธ Development

Project Structure

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

โž• Adding New Tools

  1. Create tool file in tools/ directory
  2. Implement tool class with execute() method
  3. Add to Registry.js exports
  4. Update prompt.txt tool list

๐Ÿงช Testing

npm test
# or
node tests/TestTools.js

๐Ÿ”ง Troubleshooting

Common Issues

Ollama not running

# Start Ollama
ollama serve

Model not found

# Pull model
ollama pull granite3.2:8b

Tool 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

๐Ÿ“„ License

MIT License - NeaByteLab

About

Node.js CLI with auto-execution capabilities using local Ollama models for intelligent tool selection and automation

Topics

automationcli-toolsnodejsollama

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402503 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.