JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 71
  • Score
    100M100P100Q53392F
  • License MIT

๐Ÿ”ฎ Echo - Intelligent AI terminal with autonomous agents, 6 providers (Claude, GPT, Groq, OpenRouter, Meta, Gemini), and advanced output optimization

Package Exports

  • echoai
  • echoai/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (echoai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Echo AI CLI

๐Ÿ”ฎ An intelligent AI terminal with autonomous agents, multi-provider support, and advanced output optimization

NPM Version License: MIT TypeScript

โœจ What Makes Echo Special

Echo isn't just another AI CLI - it's an intelligent terminal that thinks before it acts. With autonomous agents that analyze your prompts and optimize them automatically, Echo delivers better results with less effort.

๐Ÿ†• What's New in Latest Version

โœจ Interactive Welcome Experience

  • Guided Setup: Beautiful CLI interface that walks you through provider configuration
  • Smart Detection: Automatically detects existing configurations with โœ… indicators
  • Connection Testing: Real-time API key validation during setup
  • Persistent Storage: Never lose your configurations - they're saved permanently

โšก Groq Provider - Ultra-Fast Inference

  • Lightning Speed: Experience blazing-fast responses with Groq's optimized infrastructure
  • Full Integration: Complete Groq SDK implementation with streaming support
  • Llama Models: Access to Llama 3 70B, 8B, Mixtral 8x7B, and Gemma variants
  • Production Ready: Robust error handling and authentication

๐Ÿ”ง Configuration Persistence

  • Smart Storage: Configurations persist between CLI sessions automatically
  • Flexible Updates: Keep existing API keys or update them individually
  • No Re-entry: Set up once, use forever - no more repeated configuration
  • Multi-Provider: Seamlessly manage multiple AI providers simultaneously

๐Ÿš€ Features

  • ๐Ÿค– Intelligent Agents: Autonomous prompt optimization and output enhancement
  • ๐ŸŒ 6 AI Providers: Claude, OpenAI, Gemini, Groq, Meta AI, and OpenRouter (100+ models)
  • โšก Smart Routing: Automatically suggest the best provider for your task
  • ๐Ÿ’ฌ Interactive Chat: Real-time streaming conversations with context awareness
  • ๐Ÿ“ Code Integration: AI-assisted file editing with diff preview and backups
  • ๐ŸŽฏ Output Optimization: Context-aware formatting and post-processing
  • ๐Ÿ”ง Smart Configuration: Global and project-specific settings with validation
  • ๐Ÿš€ Ultra-Fast: Groq integration for lightning-speed responses
  • ๐ŸŽช Interactive Welcome: Beautiful guided setup experience
  • ๐Ÿ’พ Smart Persistence: Configuration saved automatically, never re-enter API keys
  • ๐Ÿ”„ Seamless Updates: Keep existing configs or update individual providers

๐Ÿ“ฆ Installation

# Install globally from NPM (recommended)
npm install -g echoai

# Or clone and build (development version)
git clone https://github.com/vijeet-shah/echo-ai-cli.git
cd echo-ai-cli
npm install
npm run build

# Make executable (replace with your project path)
chmod +x dist/cli.js

๐Ÿƒโ€โ™‚๏ธ Quick Start

1. Interactive Welcome Experience

NEW! Echo now features a beautiful interactive welcome that guides you through setup:

# Launch Echo's interactive welcome
./dist/cli.js
# or 
echoai

This opens an interactive menu where you can:

  • ๐Ÿš€ First-time setup: Guided provider configuration with connection testing
  • โœ… Existing configs: See providers marked as "Already configured"
  • ๐Ÿ”‘ API key management: Keep existing keys or update them easily
  • ๐Ÿ’ฌ Direct access: Jump into chat, file editing, or agent optimization

2. Quick Provider Setup

# Interactive welcome handles setup, but you can also use:
echoai config setup

# Or manually configure (now with persistent storage!)
echoai config set claude.key sk-ant-your-api-key-here
echoai config set groq.key gsk_your-groq-key-here  # โšก Ultra-fast inference
echoai config set meta.key your-meta-ai-key-here
echoai config set openrouter.key sk-or-your-key-here  # ๐ŸŒ 100+ models via unified API

3. Experience the Power

# Direct command with automatic optimization
echoai "explain machine learning to me"

# Ultra-fast responses with Groq
echoai "quick code snippet" --provider groq

# Interactive chat with agent optimization
echoai  # โ†’ Select "๐Ÿ’ฌ Start interactive chat session"

4. Let Echo's Agents Optimize Your Prompts

# Automatic optimization and execution
echoai agents run "help me write a React component"

# See how agents would optimize your prompt  
echoai agents optimize "debug this code"

# Direct execution (agents work behind the scenes)
echoai "explain how machine learning works"

# Interactive agent testing (from welcome menu)
echoai  # โ†’ Select "๐Ÿค– Use intelligent agents for optimization"

๐Ÿค– Intelligent Agents System

Echo's breakthrough feature is its autonomous agents that analyze and optimize your prompts automatically:

Available Agents

๐Ÿ”ง CodeOptimizer Agent

  • Optimizes prompts for programming tasks
  • Suggests best providers for code generation
  • Adds structure and best practices guidance
  • Supports all major programming languages

โœจ PromptEnhancer Agent

  • Enhances general queries for better responses
  • Adds context and output formatting
  • Incorporates expert role-playing
  • Customizes based on user preferences

Agent Commands

# List all available agents
echoai agents list

# Optimize any prompt with agents
echoai agents optimize "write a Python script to analyze data"

# Auto-optimize and execute (recommended)  
echoai agents run "help me design a database schema" --level expert --examples

# View agent optimization details
echoai agents optimize "fix my code" --format detailed

# Interactive agent exploration (recommended for beginners)
echoai  # โ†’ "๐Ÿค– Use intelligent agents for optimization" โ†’ "๐Ÿงช Test prompt optimization"

๐Ÿ“š Usage Examples

Multi-Provider Support

# Ultra-fast responses with Groq (โšก NEW: Fully functional!)
echoai "quick code snippet" --provider groq

# Advanced reasoning with Claude
echoai "complex analysis task" --provider claude --model claude-3-opus

# Code generation with Meta AI  
echoai "generate Python function" --provider meta --model code-llama-70b

# Creative tasks with OpenAI
echoai "write a creative story" --provider openai --model gpt-4

# 100+ models via OpenRouter (๐ŸŒ NEW: Cost-effective unified access!)
echoai "explain quantum computing" --provider openrouter --model anthropic/claude-3.5-sonnet

# Interactive provider selection (NEW!)
echoai  # โ†’ Welcome shows "โœจ Ready to go! You have X providers configured"

Intelligent File Operations

# AI-assisted file editing with agent optimization
echo edit src/components/Header.tsx --task "add TypeScript interfaces"

# Agent-optimized code review
echo agents run "review this code for security issues" --file auth.js --format detailed

# Multi-file context with smart optimization  
echo "optimize this implementation" --file src/app.js --file src/utils.js --provider claude

Advanced Agent Features

# Customize agent behavior
echo agents run "explain quantum computing" \\
  --format structured \\
  --level beginner \\
  --examples \\
  --provider claude

# Let agents choose the best provider
echo agents run "write performant database queries"
# โ†’ Agents automatically suggest Meta AI with Code Llama

# Complex optimization with confidence scoring
echo agents optimize "build a machine learning pipeline" --format detailed
# โ†’ Shows confidence scores and optimization strategies

โš™๏ธ Configuration

Provider Setup

Echo supports 6 major AI providers:

Recommended: Use Interactive Welcome

echoai  # โ†’ Guided setup with connection testing and persistent storage

Manual Configuration (Advanced)

# Claude (Anthropic) - Best for analysis and reasoning
echoai config set claude.key sk-ant-your-key

# OpenAI - Excellent for creative and complex tasks  
echoai config set openai.key sk-your-key

# Groq - Ultra-fast inference (โšก NOW FULLY WORKING!)
echoai config set groq.key gsk_your-key

# Meta AI - Powerful Llama and Code Llama models
echoai config set meta.key your-together-ai-key

# OpenRouter - 100+ models via unified API (๐ŸŒ NEW!)
echoai config set openrouter.key sk-or-your-key

# Gemini - Google's multimodal AI (coming soon)
echoai config set gemini.key your-key

Configuration Management (NEW!)

# View all configured providers with masked API keys
echoai  # โ†’ "โš™๏ธ Manage providers and configuration" โ†’ "๐Ÿ‘€ View current config"

# Update existing API key while keeping other settings  
echoai  # โ†’ Select configured provider โ†’ "๐Ÿ”‘ Update API key"

# Check configuration status
echoai  # โ†’ Welcome shows: "โœจ Ready to go! You have X providers configured"

Agent Preferences

# Set default output preferences for agents
echo config set defaults.outputFormat structured
echo config set defaults.explanationLevel intermediate
echo config set defaults.includeExamples true

# Configure agent behavior
echo config set agents.enableAutoOptimization true
echo config set agents.preferredOptimizer CodeOptimizer

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Echo CLI      โ”‚โ”€โ”€โ”€โ”€โ”‚  Agent System   โ”‚โ”€โ”€โ”€โ”€โ”‚   AI Providers  โ”‚
โ”‚   (Commander)   โ”‚    โ”‚  (Optimization) โ”‚    โ”‚   (5 Providers) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”‚
         โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚  Smart Routing  โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚
         โ”‚              โ”‚  (Auto-Select)  โ”‚              โ”‚
         โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ”‚
         โ”‚                       โ”‚                       โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   File Manager  โ”‚โ”€โ”€โ”€โ”€โ”‚   Config Mgmt   โ”‚โ”€โ”€โ”€โ”€โ”‚   Agent Store   โ”‚
โ”‚   (VS Code Int) โ”‚    โ”‚   (Multi-tier)  โ”‚    โ”‚   (Extensible)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค– Agents Deep Dive

How Agents Work

  1. Input Analysis: Agents analyze your prompt for context, complexity, and intent
  2. Optimization: Apply domain-specific enhancements and structure
  3. Provider Selection: Suggest the best AI provider for your specific task
  4. Execution: Run the optimized prompt with optimal settings
  5. Post-Processing: Apply formatting and enhancement to the output

Agent Scoring System

echo agents optimize "write a sorting algorithm" --format detailed

Output includes:

  • Confidence Score: How well the agent understands your request (0-100%)
  • Optimization Applied: List of enhancements made to your prompt
  • Provider Recommendation: Best AI provider for this specific task
  • Estimated Tokens: Approximate cost/usage prediction

Extending with Custom Agents

Echo's agent system is designed to be extensible. Each agent implements a simple interface:

interface Agent {
  name: string;
  capabilities: AgentCapability[];
  canHandle(context: AgentContext): boolean;
  optimize(context: AgentContext): Promise<AgentResult>;
  postProcess?(result: string, context: AgentContext): Promise<string>;
}

๐Ÿ“Š Provider Comparison

Provider Strengths Speed Cost Models
Claude Analysis, Code Review Medium $$$ Opus, Sonnet, Haiku
OpenAI Creative, Complex Tasks Medium $$$ GPT-4, GPT-3.5
Groq Ultra-Fast Inference โšก Fastest $ Llama 3, Mixtral
Meta AI Code, Open Models Fast $$ Llama 3.1/3.2, Code Llama
OpenRouter ๐ŸŒ Unified Access Varies ๐Ÿ’ฐ Cheapest 100+ Models
Gemini Multimodal Medium $$ Gemini Pro (Coming Soon)

Echo's agents automatically recommend the best provider for each task

๐ŸŒ OpenRouter: The Game Changer

NEW! OpenRouter integration provides unprecedented access to AI models:

Why OpenRouter?

  • ๐Ÿ’ฐ Cost Efficiency: Often 50-90% cheaper than direct provider APIs
  • ๐ŸŽฏ Model Variety: 100+ models from 20+ providers with one API key
  • โšก Easy Comparison: Test Claude, GPT, Llama, Gemini seamlessly
  • ๐Ÿ”„ Unified Interface: Consistent experience across all models
  • ๐Ÿ“Š Transparent Pricing: Clear per-token costs for budget control
# Premium models at lower costs
echoai "complex task" --provider openrouter --model anthropic/claude-3.5-sonnet
echoai "creative writing" --provider openrouter --model openai/gpt-4-turbo
echoai "code generation" --provider openrouter --model meta-llama/codellama-70b-instruct

# Explore cutting-edge models
echoai "analysis task" --provider openrouter --model google/gemini-pro-1.5
echoai "fast response" --provider openrouter --model mistralai/mixtral-8x7b-instruct

Get your OpenRouter API key at openrouter.ai and access the world's largest AI model marketplace!

๐Ÿ› ๏ธ Development

Prerequisites

  • Node.js 18+
  • npm, yarn, or pnpm

Setup

git clone https://github.com/vijeet-shah/echo-ai-cli.git
cd echo-ai-cli
npm install
npm run build
npm link

Adding New Agents

  1. Create agent in src/agents/specialized/
  2. Implement the Agent interface
  3. Register in EchoAgentManager
  4. Add tests and documentation

Development Scripts

npm run dev          # Development mode
npm test             # Run tests
npm run build        # Build for production
npm run type-check   # TypeScript validation
npm run lint         # Code linting

๐Ÿ“– API Reference

Core Classes

  • EchoAgentManager: Manages agent registration and optimization
  • ConfigManager: Handles multi-tier configuration
  • ProviderManager: Manages AI provider integration
  • FileManager: Provides file operations with backup

Agent Types

  • AgentContext: Input context for agent optimization
  • AgentResult: Optimized prompt with metadata and suggestions
  • AgentCapability: Defines what an agent can do

๐ŸŒŸ Examples & Tutorials

Code Generation

# Agent-optimized code generation
echo agents run "create a REST API with authentication" \\
  --provider meta \\
  --model code-llama-70b \\
  --level expert

# Result: Agents add structure, best practices, and examples

Data Analysis

# Smart provider selection for data tasks
echo agents run "analyze this CSV for trends" \\
  --file sales_data.csv \\
  --format detailed

# Result: Agents choose OpenAI/Claude and add analysis framework

Creative Writing

# Creative tasks with optimal settings
echo agents run "write a compelling product description" \\
  --format creative \\
  --examples

# Result: Agents enhance prompt and suggest GPT-4

๐Ÿค Contributing

We welcome contributions! Echo's agent system is designed for community extension.

Contribution Areas

  • New Agents: Create specialized agents for different domains
  • Provider Integration: Add new AI providers
  • Agent Capabilities: Enhance existing agent intelligence
  • Performance: Optimize agent decision-making
  • Documentation: Improve guides and examples

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿ™ Acknowledgments

  • OpenAI for pushing the boundaries of AI capabilities
  • Groq for ultra-fast inference infrastructure
  • Meta for open-source Llama models
  • The community for feedback and contributions

๐Ÿ“ž Support & Community


Echo - Where AI meets Intelligence
Made with ๐Ÿ”ฎ by Vijeet Shah