aipipe
Version, currently main branch1 version
- main branchlatestDec 5, 2024
github.com/AutoRecursive/aipipe
An simple CLI tool to integrate LLMs in shell scripting with ollama
Installation
# Add this to your shard.yml
dependencies:
aipipe:
github: AutoRecursive/aipipe
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.9.0- License
- MIT
- Author
- Your Name
- Target
aipipefrom src/aipipe.cr
Dependencies
Runtime Dependencies
- cling~> 1.0.0github: devnote-dev/cling
README
Aipipe
Aipipe is a command-line tool designed to integrate Large Language Models (LLMs) into shell scripts. It provides a seamless interface to Ollama, supporting pipe operations and making AI capabilities readily available in your command-line workflow.
Features
- Pipe input/output support
- Automatic Ollama service management
- Custom model selection
- System prompt support
- Configurable API endpoints
Prerequisites
Ensure you have the following installed:
Installation
Clone and build the project:
bash
git clone https://github.com/yourusername/aipipe.git
cd aipipe
shards install
crystal build src/aipipe.cr -o bin/aipipe --release
Usage
Basic Commands
# Direct question
aipipe ask "What is 1+1?"
# Using pipes
echo "Explain this code" | aipipe ask
# Specify model
aipipe ask -m codellama "Analyze this code"
# With system prompt
aipipe ask -s "You are a Shell expert" "Optimize this script"
Script Integration
# Log analysis
cat error.log | aipipe ask "Analyze these error messages"
# Code review
git diff | aipipe ask -m codellama "Review these code changes"
# System diagnostics
top -b -n 1 | aipipe ask "Analyze system performance"
Configuration
Configure through environment variables:
# Ollama API endpoint
export OLLAMA_API_BASE="http://localhost:11434"
# Default model
export OLLAMA_MODEL="qwen2.5"
# Ollama port
export OLLAMA_PORT=11434
# Log level
export AIPIPE_LOG_LEVEL=DEBUG
Development
# Install dependencies
shards install
# Run tests
crystal spec
# Development mode
./scripts/dev.sh ask "test question"
Contributing
- Fork the project
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Dec 5, 2024
- Crystal
>= 1.9.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/AutoRecursive/aipipe
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1