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

@midewev/midewev-cli

v0.2.1

Published

Autonomous coding agent with MCP, LangGraph and Docker - npm wrapper

Readme

@midewev/midewev-cli

🤖 Autonomous coding agent powered by MCP, LangGraph, and Docker - npm wrapper

Installation

Step 1: Install the npm package

# npm
npm install -g @midewev/midewev-cli

# yarn
yarn global add @midewev/midewev-cli

# pnpm
pnpm add -g @midewev/midewev-cli

Step 2: Install the Python backend

The npm package provides a CLI wrapper, but requires the Python backend to be installed separately:

# Clone the repository
git clone https://github.com/LunarBs7/Midewev-CLI.git
cd Midewev-CLI

# Install Poetry (if not already installed)
pip install poetry

# Install Python dependencies
poetry install

# Verify installation
poetry run codeforge --version

Requirements

  • Node.js 18.0.0 or higher
  • Python 3.11 or higher
  • Poetry for Python dependency management
  • Docker (optional, for sandbox execution)

Quick Start

🎨 Interactive Mode (New!)

Simply run midewev without arguments to launch the beautiful interactive interface:

midewev

You'll be greeted with:

  • Stunning ASCII art logo with welcome message
  • Interactive menu with arrow key navigation
  • Quick action templates: Tests, Bug Fixes, Refactoring, Documentation, Code Review
  • Real-time spinners and colored output
  • Easy-to-use prompts for all options

See INTERFACE.md for a complete visual guide!

💻 Command Line Mode

Or use direct commands for automation and scripting:

# Initialize in your project
midewev init

# Execute a task directly
midewev execute "Add unit tests for authentication module"

# Start interactive chat mode
midewev interactive

# Start MCP server
midewev agent --mcp-server

# View statistics
midewev stats

CLI Commands

midewev init

Initialize Midewev CLI in your project:

midewev init
midewev init --project-path /path/to/project
midewev init --force  # Overwrite existing configuration

midewev execute

Execute a coding task:

midewev execute --prompt "Task description"
midewev execute --prompt "Fix bug in auth.py" --output-format json
midewev execute --prompt "Refactor user service" --thread-id my-thread

Options:

  • --prompt (required): Task description
  • --output-format: Output format (markdown or json)
  • --checkpoint: Enable checkpointing (default: true)
  • --thread-id: Thread ID for checkpointing

midewev interactive

Start interactive mode:

midewev interactive

Type your requests naturally, type exit to quit.

midewev agent

Start the MCP server:

midewev agent --mcp-server

midewev stats

View agent statistics:

midewev stats

midewev github

Start GitHub webhook handler:

midewev github --port 8080

Programmatic API

You can also use Midewev CLI programmatically from Node.js:

import midewev from '@lunarbsdev/midewev-cli';

// Initialize project
await midewev.init('./my-project');

// Execute a task
const result = await midewev.executeTask(
  'Add error handling to user service',
  {
    format: 'json',
    threadId: 'task-123',
    onProgress: (output) => console.log(output)
  }
);

console.log(result.summary);

// Get statistics
const stats = await midewev.getStats();
console.log(`Total tasks: ${stats.tool_calls.total}`);

// Start MCP server
const server = midewev.startMCPServer({ detached: true });

API Reference

execute(command, args, options)

Execute any Midewev CLI command:

const result = await midewev.execute('execute', ['--prompt', 'Task'], {
  env: { LOG_LEVEL: 'DEBUG' },
  onStdout: (data) => console.log(data),
  onStderr: (data) => console.error(data)
});

init(projectPath)

Initialize Midewev in a project:

await midewev.init('./my-project');

executeTask(prompt, options)

Execute a task:

const result = await midewev.executeTask('Add tests', {
  format: 'json',
  threadId: 'thread-1',
  onProgress: (output) => {}
});

getStats()

Get agent statistics:

const stats = await midewev.getStats();

startMCPServer(options)

Start MCP server:

const server = midewev.startMCPServer({
  stdio: 'inherit',
  detached: false
});

// Stop server
server.kill();

Configuration

Create a .env file in your project:

# Required
OPENAI_API_KEY=sk-...

# Optional
ANTHROPIC_API_KEY=sk-ant-...
GITHUB_TOKEN=ghp_...
DOCKER_ENABLED=true
MIN_TEST_COVERAGE=90
LOG_LEVEL=INFO

Architecture

Midewev CLI consists of:

  1. Node.js Wrapper (this package) - Provides npm installation and CLI interface
  2. Python Backend - Core agent with MCP server, LangGraph orchestration, and Docker sandbox
  3. MCP Protocol - Communication between components
┌─────────────────────────────────────┐
│   Node.js CLI (midewev command)     │
└──────────────┬──────────────────────┘
               │ (spawn)
┌──────────────▼──────────────────────┐
│   Python Backend (Poetry/pip)       │
│   - MCP Server (13 tools)           │
│   - LangGraph Orchestrator          │
│   - Docker Sandbox                  │
│   - ChromaDB Memory                 │
└─────────────────────────────────────┘

Features

  • 🤖 Autonomous Agent: Plan, execute, validate, and report
  • 🔧 13 MCP Tools: File ops, git, code analysis, testing, web fetch, monitoring
  • 🧠 LangGraph Workflow: Planner → Executor → Validator → Reporter
  • 🔒 Secure Sandbox: Docker isolation with resource limits
  • 💾 Vector Memory: ChromaDB for long-term context
  • Validation Pipeline: Static analysis, security scan, style check, tests
  • 📊 Observability: Comprehensive metrics and logging
  • 🔌 Extensible: Custom tool registry

Troubleshooting

Python not found

# Install Python 3.11+
# macOS
brew install [email protected]

# Ubuntu/Debian
sudo apt install python3.11

# Windows
# Download from https://www.python.org/downloads/

Poetry installation fails

The installer will fall back to pip automatically. You can also install Poetry manually:

curl -sSL https://install.python-poetry.org | python3 -

Docker not available

Docker is optional. Disable it in .env:

DOCKER_ENABLED=false

Permission denied

On Linux/macOS, you may need to add execute permissions:

chmod +x $(which midewev)

Development

# Clone repository
git clone https://github.com/LunarBs7/Midewev-CLI.git
cd Midewev-CLI

# Install npm dependencies
cd npm
npm install

# Link locally
npm link

# Now you can use 'midewev' command globally
midewev --help

Documentation

License

MIT © Midewev Team

Support

  • Issues: https://github.com/LunarBs7/Midewev-CLI/issues
  • Discussions: https://github.com/LunarBs7/Midewev-CLI/discussions