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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tomsun28/happy-code

v0.1.4

Published

A simplified AI-powered CLI tool for intelligent code operations

Downloads

11

Readme

Happy Code CLI

A powerful AI-driven command-line tool designed for developers, providing intelligent code operations, file management, task planning, and development assistance through natural language interaction and rich toolsets to dramatically improve development efficiency.

🚀 Features

Core Tools

  • File Operations: Read, write, and edit files with intelligent parsing
  • Pattern Search: File pattern matching with glob support
  • Content Search: Grep-based content search across files
  • Shell Integration: Execute bash commands with sync/async support
  • Task Management: Structured todo tracking with status and priority
  • Natural Language: Interactive chat interface for seamless workflow

Advanced Capabilities

  • MCP Protocol: Integration with third-party MCP servers and tools
  • ReAct Planning: Intelligent task planning and execution scheduling
  • Multi-Resource: Support for files, URLs, and various resource types
  • Background Tasks: Asynchronous command execution support
  • Context Management: Automatic context window tracking and intelligent compression

📦 Installation

# Install dependencies
pnpm install

# Build the project
pnpm run build

# Install globally
pnpm run install:global

🛠️ Usage Modes

One-Shot Mode

Execute single commands with immediate results:

# Basic message
happy m "who are you"
happy message "who are you"
happy msg "who are you"

# With linked resources
happy m "read the content of the file" -l ./path/to/your/file.txt
happy m "read the content of the file" -l https://example.com/file.txt

# Multiple resources (parallel processing)
happy m "read the content of the files" -l ./path/to/your/file.txt https://example.com/file.txt
happy m "analyze these files" -l https://example.com/file.txt -l ./path/to/your/file.txt

Interactive Mode

Enter continuous conversation mode:

# Start interactive mode
happy

# Start with initial message
happy "who are you"

🔧 Command Reference

Non-Interactive Mode Commands

Message Commands

happy m <message>           # Send message
happy message <message>     # Send message (full form)
happy msg <message>         # Send message (short form)

MCP Server Management

# Add MCP server
happy mcp add <name> <command-to-run>
happy mcp add -s user zai-mcp-server --env Z_AI_API_KEY=your_key -- npx -y "@z_ai/mcp-server"
happy mcp add --transport http sentry https://mcp.sentry.dev/mcp --header Authorization=650ff76850634cbfa
happy mcp add --transport sse asana https://mcp.asana.com/sse --header Authorization=650ff76850634cbfa

# List servers
happy mcp list

# Remove server
happy mcp remove <name>

# Get server info
happy mcp info <name>

⚙️ Configuration

Configure via ~/.happy-code/config.yaml:

apiKeys:
  zhipu: your_api_key_here
defaults:
  encoding: utf8
  maxFileSizeMB: 10
  searchResultsLimit: 100
  shellTimeoutMs: 120000
  enableBackgroundTasks: true
  aiProvider: zhipu
  aiModel: glm-4.6
  maxTokens: 131072
  temperature: 0.95
  # Context Window Management
  contextWindow: 204800        # Maximum context size in tokens
  autoCompress: true           # Enable automatic compression
  compressionThreshold: 0.8    # Trigger at 80% usage
environment: development
logLevel: info
mcpServers:
  zai-mcp:
    command: npx
    args:
      - -y
      - "@z_ai/mcp-server"
    env:
      Z_AI_API_KEY: your_api_key_here
    autoConnect: true

Context Window Management

Happy Code automatically manages context window usage to prevent overflow:

  • Token Tracking: Real-time monitoring of prompt and completion tokens
  • Aggressive Compression: Compresses ALL history (except system prompts) when threshold reached
  • Intelligent Summaries: Uses AI to create concise summaries of entire conversation history
  • High Compression Ratio: Typically achieves 85-95% token reduction
  • Configurable: Adjust context window size and compression threshold

Configuration Options:

  • contextWindow: Maximum context size in tokens (default: 204,800)
  • autoCompress: Enable/disable automatic compression (default: true)
  • compressionThreshold: Trigger compression at this usage percentage (default: 0.8)

View Token Usage:

# In interactive mode
/status

🛠️ Development

pnpm run dev     # Development mode
pnpm run build   # Build for production
pnpm test        # Run tests
pnpm run lint    # Lint code

📄 License

MIT License