Kowalski CLI
A command-line interface for the Kowalski AI agent framework, providing easy access to all Kowalski capabilities through a unified CLI.
Overview
The Kowalski CLI provides a comprehensive command-line interface for interacting with AI agents, managing models, and performing various AI-powered tasks. It serves as the main entry point for users who prefer command-line tools over programmatic APIs.
Features
- Multi-Agent Support: Access to all Kowalski agents (academic, code, data, web)
- Model Management: List, check, and manage Ollama models
- Conversation Interface: Interactive chat with AI agents
- File Processing: Analyze documents, code, and data files
- Web Research: Perform web searches and scrape information
- Academic Research: Analyze research papers and academic content
- Code Analysis: Analyze, refactor, and generate code
- Data Analysis: Process and analyze data files (optional feature)
Installation
From Source
From Crates.io (when published)
Prerequisites
- Ollama: Make sure Ollama is installed and running
- Rust: Rust toolchain (for building from source)
- Models: Download the models you want to use (e.g.,
ollama pull llama2)
Usage
Basic Commands
# Show help
# Show version
# Show help for a specific command
Model Management
# List available models
# Check if a specific model exists
# Pull a model from Ollama
# Show model information
Chat Interface
# Start an interactive chat session
# Chat with a specific model
# Chat with a specific agent type
# Chat with a file context
# Chat with custom system prompt
Academic Research
# Analyze a research paper
# Summarize academic content
# Extract key insights
# Compare multiple papers
# Generate research questions
Code Analysis
# Analyze a code file
# Refactor code
# Generate documentation
# Review code quality
# Suggest improvements
Web Research
# Search the web
# Scrape a webpage
# Research a topic
# Extract information from multiple sources
Data Analysis (Optional Feature)
# Analyze CSV data
# Generate statistics
# Create visualizations
# Detect patterns
# Clean data
Configuration
The CLI uses the same configuration system as the Kowalski framework. Configuration files are automatically loaded from:
~/.config/kowalski/config.toml(user config)./config.toml(local config)- Environment variables
Example Configuration
# ~/.config/kowalski/config.toml
[]
= "localhost"
= 11434
= "llama2"
[]
= 100
= true
= 0.7
= 2048
[]
= "info"
= "json"
Environment Variables
# Set Ollama host
# Set default model
# Set log level
Command Options
Global Options
--config <FILE>: Specify configuration file--log-level <LEVEL>: Set logging level (debug, info, warn, error)--quiet: Suppress output--verbose: Enable verbose output
Model Options
--model <NAME>: Specify model to use--host <HOST>: Ollama host address--port <PORT>: Ollama port number
Output Options
--output <FILE>: Write output to file--format <FORMAT>: Output format (text, json, yaml)--pretty: Pretty-print JSON output
Examples
Interactive Development Session
# Start a coding session
# Ask for help with async programming
> How do
# Get code review
# Refactor based on suggestions
Research Workflow
# Research a topic
# Download and analyze papers
# Generate summary
# Ask follow-up questions
Data Analysis Pipeline
# Analyze dataset
# Generate insights
# Create visualizations
# Generate report
Error Handling
The CLI provides detailed error messages and suggestions:
# If Ollama is not running
# If model is not found
# If file is not found
Troubleshooting
Common Issues
-
Ollama Connection Failed
# Check if Ollama is running # Start Ollama if needed -
Model Not Found
# List available models # Pull missing model -
Permission Issues
# Check file permissions # Fix permissions if needed -
Memory Issues
# Use smaller models for limited memory # Adjust model settings in config
Getting Help
# General help
# Command-specific help
# Debug mode
# Check version and dependencies
Integration
The CLI integrates seamlessly with other Kowalski components:
- Programmatic Use: Use the CLI output in scripts
- Pipeline Integration: Chain commands with pipes
- Automation: Use in CI/CD pipelines
- IDE Integration: Use with VS Code, IntelliJ, etc.
Contributing
Contributions are welcome! Please see the main Kowalski repository for contribution guidelines.
License
MIT License - see LICENSE file for details.
Related
- Kowalski Core - Core framework
- Kowalski Tools - Tool collection
- Kowalski Agent Template - Agent templates
- Main Kowalski Repository - Source code and documentation