ββββββββββββββββββββββββ ββββββ βββββββββββββββββββββββββββββββββ βββ ββββββ ββββββββββββββββ βββ ββββββ ββββββββββββββββ βββ βββββββββββ ββββββ βββ βββ βββββββββββ ββββββ βββ
# TERA - Intelligent AI Development Assistant
> **T**erminal **E**nhanced **R**obot **A**ssistant
A powerful CLI tool that leverages multiple AI providers (OpenAI, OpenRouter, Ollama) to automate development tasks with intelligent streaming, code analysis, and automated workflows.
[](https://www.npmjs.com/package/tera-cli)
[](https://nodejs.org/)
[](https://opensource.org/licenses/ISC)
## β¨ Features
- π€ **Multi-Provider AI Support**: OpenAI (GPT-4o, GPT-4), OpenRouter (Claude, Gemini, Llama, etc.), Ollama (local models)
- π **Smart Git Commits**: Automatically generate intelligent commit messages from your staged changes
- π§ **Intelligent File Modification**: Modify any file with natural language instructions
- π **Code Review & Analysis**: Detect bugs, security issues, and performance problems in commits
- π― **Autonomous Agent**: Automate complex development tasks with real-time streaming
- π§ **Persistent Memory**: Agent learns from past experiences to improve future tasks
- π¬ **Natural Communication**: Chat interface for conversational interactions
- β‘ **Dynamic Model Selection**: Fetch and use the latest models from each provider
- π¨ **Enhanced Patch System**: Intelligent whitespace handling for reliable code modifications
## π Quick Start
### Installation
```bash
npm install -g tera-cli
# First-time setup - configure your AI provider
tera config
# View current configuration
tera config --show
# Switch between providers
tera config --switch
# Change model for current provider
tera config --model| Provider | Models | Description |
|---|---|---|
| OpenAI | GPT-4o, GPT-4, GPT-3.5 | Official OpenAI API with latest models |
| OpenRouter | 200+ models | Access to Claude, Gemini, Llama, and more |
| Ollama | Local models | Run models locally (Llama, Mistral, CodeLlama, etc.) |
The crown jewel of TERA - an intelligent agent that can automate complex development tasks with streaming AI.
# Interactive mode
tera agent
# Execute specific task
tera agent "create a React component with tests"
# Auto-approve all actions
tera agent "setup Node.js project" --auto
# Auto-approve specific actions only
tera agent "fix bugs" --auto read_file_lines,patch_fileAgent Capabilities:
- π File system operations (read, create, modify, organize)
- π§ Code modifications with intelligent patching
- π» Shell command execution with safety checks
- π£οΈ Natural conversation and status updates
- π§ Memory-based learning from past experiences
- β‘ Real-time streaming responses
Auto-Approval Actions:
read_file_lines- Read file contentslist_directory- List directory contentscreate_file- Create new filespatch_file- Modify existing filesrun_command- Execute shell commandschat,greet,apologize- Communication (always auto-approved)inform_user,task_completed- Status updates (always auto-approved)
Generate intelligent commit messages based on your staged changes.
# Basic usage
git add .
tera commit
# Add all changes and commit automatically
tera commit -a -y
# Interactive commit with preview
tera commitFeatures:
- β Analyzes staged changes with intelligent diff parsing
- π― Follows conventional commit format (
feat:,fix:,docs:, etc.) - π Generates messages in French for natural readability
- π Provides detailed change summaries
- β‘ Supports auto-confirmation with
-yflag
Modify any file using natural language instructions with AI.
# Basic file modification
tera change app.js "add email validation function"
# With automatic backup
tera change config.json "add development environment settings" --backup
# Preview changes before applying
tera change style.css "improve responsive design" --previewExamples:
# Add functionality
tera change utils.js "add function to format dates"
# Fix issues
tera change api.py "fix the authentication bug in login"
# Refactor code
tera change components.tsx "convert to TypeScript with proper types"
# Add documentation
tera change README.md "add installation section with examples"Analyze commits to detect bugs, security issues, and suggest improvements.
# Review latest commit
tera review
# Review specific commit
tera review --commit abc123
# Review multiple commits
tera review --last 3
# Skip certain file types
tera review --skip ".min.js,.lock"Analysis Categories:
- π Bug Detection: Logic errors, null pointer issues, type mismatches
- π Security Analysis: Injection vulnerabilities, data exposure
- β‘ Performance Issues: Inefficient loops, memory leaks
- π Code Quality: Naming conventions, structure improvements
- π‘οΈ Error Handling: Missing try-catch, validation gaps
Manage AI providers, models, and settings.
# Initial setup
tera config
# View current settings
tera config --show
# Switch provider (OpenAI β OpenRouter β Ollama)
tera config --switch
# Change model for current provider
tera config --model
# Dynamic model fetching from API
tera config --model # Shows live models from your providerView and manage the agent's learning memory.
# View memory statistics
tera memory
# Clear all learned experiences
tera memory --clearControl which actions require confirmation:
# Full automation - approve everything
tera agent "deploy to production" --auto
# Selective automation - only safe operations
tera agent "analyze codebase" --auto read_file_lines,list_directory
# Development workflow automation
tera agent "fix bugs" --auto read_file_lines,patch_file,run_command# Use latest GPT models with dynamic fetching
tera config --model # Shows: gpt-4o, gpt-4o-mini, gpt-4-turbo, etc.# Access 200+ models including Claude, Gemini, Llama
tera config --switch # Select OpenRouter
tera config --model # Browse: claude-3, gemini-pro, llama-3, etc.# Run models locally for privacy/offline use
tera config --switch # Select Ollama
tera config --model # Shows installed: llama3.2, mistral, codellama, etc.
# Install new models
ollama pull llama3.2:latest
tera config --model # New model appears automatically# 1. Morning setup - check project status
tera agent "analyze current project structure and suggest improvements"
# 2. Feature development
tera agent "implement user authentication with JWT" --auto read_file_lines,create_file
# 3. Code review
tera review --last 3
# 4. Smart commits
tera commit -a -y# 1. Identify issues
tera review
# 2. Fix automatically
tera agent "fix the security vulnerabilities found in review" --auto patch_file
# 3. Verify fixes
tera change test.js "add tests for security fixes" --backup
# 4. Commit changes
tera committera-cli/
βββ bin/
β βββ tera.js # CLI entry point
βββ lib/
β βββ commands/ # Command implementations
β β βββ agent.js # Autonomous agent
β β βββ commit.js # Smart commits
β β βββ change.js # File modification
β β βββ review.js # Code analysis
β β βββ config.js # Configuration
β βββ agent_tools/ # Agent capabilities
β β βββ chat.js # Conversational interface
β β βββ create_file.js # File creation
β β βββ patch_file.js # Intelligent file patching
β β βββ read_file.js # File reading
β β βββ run_command.js # Shell execution
β β βββ inform_user.js # User communication
β βββ utils/ # Core utilities
β βββ openai.js # AI provider integration
β βββ config.js # Configuration management
β βββ memory.js # Agent memory system
β βββ models.js # Dynamic model fetching
β βββ git.js # Git operations
β βββ file.js # File system utilities
β βββ diff.js # Code diff visualization
β βββ prompt.js # User interaction
βββ package.json
# Optional - can also use tera config
export OPENAI_API_KEY="sk-..."
export OPENROUTER_API_KEY="sk-or-..."
export OLLAMA_BASE_URL="http://localhost:11434/v1"TERA stores settings in ~/.tera-config.json:
{
"provider": "openai",
"openai": {
"apiKey": "sk-...",
"model": "gpt-4o"
},
"openrouter": {
"apiKey": "sk-or-...",
"model": "openai/gpt-4o"
},
"ollama": {
"baseURL": "http://localhost:11434/v1",
"model": "llama3.2:latest"
}
}- Visit platform.openai.com
- Create account and get API key
- Run
tera configand select OpenAI
- Visit openrouter.ai
- Create account and get API key
- Run
tera configand select OpenRouter - Access 200+ models including Claude, Gemini, Llama
- Install Ollama
- Start service:
ollama serve - Install models:
ollama pull llama3.2 - Run
tera configand select Ollama
"API key not configured"
tera config # Reconfigure your provider"No staged changes found"
git add . # Stage your changes first
tera commit -a # Or use auto-add flag"Model not found"
tera config --model # Select from available modelsOllama connection failed
ollama serve # Start Ollama service
ollama pull llama3.2 # Install a modelPatch failures due to whitespace
- TERA now includes intelligent whitespace handling
- Use
read_file_linesin agent mode for precise context
# Enable detailed logging
tera agent "debug this issue" --debug# Clear agent memory if behavior seems off
tera memory --clear- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
tera commit(use TERA itself!) - Push branch:
git push origin feature/amazing-feature - Open Pull Request
ISC License - see LICENSE file.
- GitHub: https://github.com/enokas/tera
- npm: https://www.npmjs.com/package/tera-cli
- Issues: https://github.com/enokas/tera/issues
Made with β€οΈ and AI - TERA is developed using AI assistance to create better AI tools for developers.