npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ergosum-cli

v0.6.1

Published

Simple AI-friendly CLI for ErgoSum memory management. Perfect for Claude and other AI assistants.

Downloads

43

Readme

ErgoSum CLI

A powerful command-line interface for integrating ErgoSum memory and context with AI tools like Claude Code, Codex, Gemini CLI, and more.

✨ What's New in v0.2.0

  • 🛡️ Enterprise-grade error handling with automatic retry and recovery
  • 📊 Advanced logging system with debug modes and file output
  • 💾 Offline mode with intelligent caching for working without internet
  • 🎯 Enhanced UX with progress bars, spinners, and better feedback
  • 🔒 Input validation and sanitization for security
  • ⚡ Performance optimizations with smart caching strategies

🚀 Features

  • Memory Management: Store, search, and retrieve memories from ErgoSum
  • AI Tool Integration: Seamlessly inject context into Claude Code and other AI tools
  • Offline Mode: Work without internet using persistent local caching
  • Smart Caching: Reduce API calls and improve performance
  • Progress Tracking: Beautiful progress indicators for all operations
  • Error Recovery: Robust error handling with automatic retries
  • Debug Logging: Comprehensive logging with multiple verbosity levels
  • Input Validation: Secure input sanitization and schema validation

📦 Installation

npm install -g ergosum-cli

After installation, you can use either:

  • ergosum - Full command name
  • egs - Short alias for quick access

Verify Installation

ergosum --version  # Shows current version
ergosum --help     # Shows all available commands

🔧 Quick Start

1. Check Status

ergosum status
# Shows authentication status, API connectivity, and integrations

2. Authentication

# Start authentication process
ergosum auth login

# Check if you're logged in
ergosum auth status

3. Store Your First Memory

# Quick storage
ergosum add "TypeScript interfaces help catch errors at compile time"

# Detailed storage with metadata
ergosum memory store \
  --title "TypeScript Best Practices" \
  --type CODE \
  --tags "typescript,development,best-practices"

4. Search and Retrieve

# Quick search
ergosum search "typescript"

# Detailed search with options
ergosum memory search "typescript interfaces" \
  --limit 10 \
  --format table

5. AI Integration

# Setup Claude Code integration
ergosum claude setup

# Ask Claude with automatic context from your memories
ergosum claude ask "How should I structure TypeScript interfaces?"

📚 Complete Command Reference

Authentication

| Command | Description | |---------|-------------| | ergosum auth login | Authenticate with ErgoSum (OAuth or token) | | ergosum auth logout | Remove stored credentials | | ergosum auth status | Check authentication status | | ergosum auth whoami | Show current user information |

Memory Management

| Command | Description | |---------|-------------| | ergosum memory store | Store new memory with interactive prompts | | ergosum memory list | List all memories with pagination | | ergosum memory search <query> | Search memories by content | | ergosum memory show <id> | Display specific memory details | | ergosum memory delete <id> | Remove a memory (with confirmation) | | ergosum memory context <query> | Generate context from relevant memories |

Cache Management

| Command | Description | |---------|-------------| | ergosum cache status | Show cache statistics and hit rates | | ergosum cache clear | Clear all cached data | | ergosum cache offline | Enable offline mode with persistence | | ergosum cache online | Disable offline mode | | ergosum cache warmup | Pre-load frequently accessed data |

Claude Code Integration

| Command | Description | |---------|-------------| | ergosum claude setup | Configure Claude Code integration | | ergosum claude ask <question> | Ask Claude with ErgoSum context | | ergosum claude context <query> | Preview context that would be sent | | ergosum claude wrap <command> | Wrap any Claude command with context |

Configuration

| Command | Description | |---------|-------------| | ergosum config list | Show all configuration settings | | ergosum config get <key> | Get specific configuration value | | ergosum config set <key> <value> | Set configuration value | | ergosum config setup | Interactive configuration wizard |

Quick Shortcuts

| Command | Description | |---------|-------------| | ergosum add <content> | Quick memory storage | | ergosum search <query> | Quick memory search | | ergosum status | Overall CLI health check |

💡 Usage Examples

Development Workflow

# Store a code snippet you discovered
ergosum add "Use React.memo() to prevent unnecessary re-renders" \
  --tags "react,performance,optimization"

# Later, when working on optimization
ergosum claude ask "How can I optimize this React component?" 
# Automatically includes your stored context about React.memo()

Research and Learning

# Store research findings
ergosum memory store \
  --title "Database Indexing Strategies" \
  --type DOCUMENT \
  --tags "database,performance,postgresql" \
  --content "B-tree indexes work best for equality and range queries..."

# Search when needed
ergosum search "database indexing" --format json | jq '.memories[].title'

Working Offline

# Enable offline mode
ergosum cache offline

# Warm up cache with frequently used data
ergosum cache warmup --limit 50

# Now you can search and access memories without internet
ergosum search "react hooks"  # Uses cached data

Debugging and Monitoring

# Enable debug logging
DEBUG=1 ergosum --verbose memory list

# Check cache performance
ergosum cache status

# View detailed logs
tail -f ~/.cache/ergosum-cli/ergosum-cli.log

⚙️ Configuration

Configuration File Location

  • macOS/Linux: ~/.config/ergosum-cli/config.json
  • Windows: %APPDATA%\ergosum-cli\config.json

Environment Variables

# API Configuration
export ERGOSUM_API_URL="https://api.ergosum.cc/api/v1"
export ERGOSUM_TOKEN="your-access-token"

# Debugging
export DEBUG=1           # Enable debug output
export VERBOSE=1         # Enable verbose logging
export LOG_FILE=1        # Enable file logging

Default Settings

{
  "apiUrl": "https://api.ergosum.cc/api/v1",
  "defaultTags": ["cli"],
  "offlineMode": false,
  "integrations": {
    "claudeCode": true,
    "codex": false,
    "gemini": false
  }
}

🎯 Advanced Features

Smart Caching

  • Memory Cache: Hot data cached for 5 minutes
  • Disk Cache: Persistent storage for offline mode
  • Auto-Invalidation: Cache cleared when data changes
  • Hit Rate Monitoring: Track cache performance

Error Recovery

  • Automatic Retry: Failed requests retry with exponential backoff
  • Graceful Degradation: Falls back to cached data when offline
  • User-Friendly Messages: Clear error explanations with next steps

Performance Monitoring

# View cache statistics
ergosum cache status

# Monitor API performance  
DEBUG=1 ergosum memory list  # Shows request timing

🔐 Security & Privacy

  • Secure Authentication: OAuth2 flow with ErgoSum platform
  • Local Storage: Credentials stored securely using OS keychain
  • Input Validation: All inputs sanitized and validated
  • HTTPS Only: All API communication encrypted
  • Privacy First: Context processing happens locally

🛠️ Development

Requirements

  • Node.js 18+
  • npm or yarn
  • TypeScript 5+

Local Development

git clone https://github.com/TwoErgoSum/ErgoSum-CLI.git
cd ErgoSum-CLI
npm install
npm run dev  # Watch mode for development

Building

npm run build      # Compile TypeScript
npm run typecheck  # Type checking only
npm run lint       # Code linting

Testing

npm test           # Run test suite
npm run test:watch # Watch mode
npm run test:coverage # Coverage report

📄 License

MIT License - see LICENSE file for details.

🔗 Links


ErgoSum CLI v0.2.0 - Enterprise-ready CLI for AI-powered memory management 🧠⚡