Skip to content

Latest commit

ย 

History

932 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MothX

MothX

้ป˜ๆ€ | ไธญๆ–‡ๅ็งฐ

๐Ÿš€ One Binary to Rule Them All โ€” Your AI Coding Assistant in the Terminal

Stop switching between Claude Code, Codex, Claw, and Channels.
MothX packs everything into a single file โ€” providers, tools, sandbox, sessions, skills, and more.

npm downloads PyPI version GitHub release Gitee release License: MIT Go Report Card GoDoc Dependencies

ๅ›ฝๅ†…้•œๅƒ: Gitee

Rename notice: MothX was formerly known as VibeCoding. The vibecoding command and old installer package names remain compatibility aliases. Configuration is read only from .mothx project directories and the MothX global configuration directory; legacy directories are neither read nor migrated.


โœจ Why MothX?

The Problem: You're juggling multiple AI coding tools โ€” Claude Code for one thing, Codex for another, Claw for something else. Each has its own setup, its own quirks, its own dependencies.

The Solution: MothX is the all-in-one terminal AI coding assistant that does it all. One binary. One config. Zero hassle.

๐ŸŽฏ Key Highlights

Feature What It Means for You
โš™๏ธ Workflow Mode Dynamic JavaScript workflows with phases, parallel execution, and multi-worker coordination โ€” automate complex development pipelines
๐Ÿค– Multi-Provider DeepSeek, OpenAI, Anthropic, Volcengine/Doubao, LongCat, Mistral, GitHub Copilot, Cloudflare, Amazon Bedrock, and 20+ vendor adapters โ€” switch models instantly
โšก Lightning Fast SSE streaming, real-time token delivery, cache hit optimization
๐Ÿง  Think Mode Extended reasoning for complex problems (DeepSeek, o1, Claude, inline <think> parsing)
๐Ÿ›ก๏ธ Sandboxed bwrap process isolation โ€” safe file ops, network control, approval gates
๐Ÿ“ Sessions Persistent SQLite-backed history with branching, compaction, and tree structure
๐Ÿงฉ Skills Reusable prompt snippets for project conventions โ€” share across teams
๐Ÿ’ป IDE Ready ACP protocol for VS Code, Zed, JetBrains โ€” native editor integration
๐ŸŒ Serve OpenAI-compatible HTTP API โ€” use MothX as a backend service
๐Ÿ“ฑ Messaging WeChat, Feishu, WebSocket โ€” deploy as a chatbot
๐Ÿค Multi-Agent Async sub-agents with --multi-agent, blocking delegation with --delegate, and A2A master mode
๐ŸŽจ Rich TUI Markdown rendering, syntax highlighting, thinking display, tool modals, multiline input
๐Ÿ“Š Stats Dashboard Web-based usage analytics with charts, filtering by time/vendor/protocol, and CLI fallback
๐Ÿ–ผ๏ธ Multimodal Image preprocessing, crop support, browser screenshots, and vision model integration
๐Ÿ”’ Security bashBlacklist > whitelist, YOLO mode safety, --print fails fast
๐Ÿ“ฆ Pure Go No external binary dependencies โ€” uses pure-Go grep/find SDKs, supports FreeBSD
โšก Approval V2 Interactive approval dialog, project-level bash auto-approval rules, and auto-edit whitelists

๐Ÿš€ Get Started in 30 Seconds

# Install (pick one)
curl -fsSL https://mothx.net/install.sh | bash       # Linux/macOS/FreeBSD; installs Node.js LTS if needed
# Windows (Command Prompt):
curl.exe -fsSL https://mothx.net/install.bat -o install.bat && install.bat

# Docker (GHCR, Linux amd64/arm64)
docker run --rm -it --entrypoint bash ghcr.io/startvibecoding/mothx:latest
docker run --rm -it -v "$PWD:/workspace" -w /workspace ghcr.io/startvibecoding/mothx:latest

# Set your API key
export DEEPSEEK_API_KEY=sk-...

# Run
mothx

That's it. You're coding with AI.

Supported Platforms: Linux (x86_64, arm64), macOS (x86_64, arm64), Windows (x86_64), FreeBSD (x86_64, arm64)

Uninstall:

# npm
npm uninstall -g mothx-installer

# Compatibility package, if installed before the rename
npm uninstall -g vibecoding-installer

# PyPI
pipx uninstall mothx-installer

# Linux/macOS (one-line install)
curl -fsSL https://mothx.net/install.sh | bash -s -- --uninstall

# Windows
npm uninstall -g mothx-installer

๐ŸŽฎ Three Modes for Every Situation

๐Ÿ—’๏ธ  Plan    โ†’ Read-only analysis & planning. Safe, sandboxed, no surprises.
๐Ÿ”ง  Agent   โ†’ Standard read/write. Bash approval required.
๐Ÿš€  YOLO    โ†’ Full system access. No restrictions. (Default)

Switch modes anytime with /mode plan|agent|yolo or press Tab.


๐Ÿ—๏ธ Architecture at a Glance

mothx/
โ”œโ”€โ”€ cmd/mothx/        # CLI entry point
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ agent/             # Core agent loop
โ”‚   โ”œโ”€โ”€ provider/          # LLM provider abstraction (20+ vendors)
โ”‚   โ”œโ”€โ”€ tools/             # Built-in tools (read, write, bash, grep, find, ...)
โ”‚   โ”œโ”€โ”€ sandbox/           # bwrap sandbox implementation
โ”‚   โ”œโ”€โ”€ session/           # SQLite session storage
โ”‚   โ”œโ”€โ”€ skills/            # Skills system
โ”‚   โ”œโ”€โ”€ tui/               # Terminal UI (BubbleTea + Lipgloss)
โ”‚   โ”œโ”€โ”€ serve/             # Unified OpenAI API, Web UI, and messaging channels
โ”‚   โ”œโ”€โ”€ a2a/               # A2A protocol server & master mode
โ”‚   โ”œโ”€โ”€ acp/               # ACP / MCP integration
โ”‚   โ”œโ”€โ”€ stats/             # Usage statistics web dashboard
โ”‚   โ”œโ”€โ”€ workflow/          # JavaScript workflow runtime
โ”‚   โ””โ”€โ”€ memory/            # Persistent memory (memory.md)
โ””โ”€โ”€ agent/               # Public Go SDK types and interfaces (bootstrap/ wires implementations)

๐Ÿ“š Documentation

๐Ÿš€ Getting Started

โš™๏ธ Configuration

๐Ÿ—๏ธ Architecture

๐Ÿ”’ Security

๐Ÿ’ป IDE Integration

๐ŸŒ Serve Mode

  • Serve Mode โ€” OpenAI-compatible HTTP API, Web UI, and messaging channels
  • A2A Protocol โ€” Agent-to-Agent protocol

๐Ÿ“Š Analytics

๐Ÿ“– Tutorials

๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡ๆ–‡ๆกฃ


๐ŸŽฏ Use Cases

๐Ÿ’ป Daily Development

mothx -P "Refactor this function to use generics"
mothx -P "Write tests for the UserService struct"
mothx -P "Explain what this regex does"

๐Ÿ” Code Review

mothx --mode plan "Review this PR and suggest improvements"

๐Ÿš€ CI/CD Integration

mothx -P "Generate changelog from git log" > CHANGELOG.md

๐ŸŒ API Server

mothx serve  # Start OpenAI-compatible HTTP server

๐Ÿ“ฑ Chatbot

mothx serve   # Deploy as WeChat/Feishu bot

๐Ÿ“Š Usage Analytics

mothx stats    # Start web dashboard on 127.0.0.1:7878
mothx stats --cli  # Print stats in terminal

๐Ÿ”„ Dynamic Workflows

mothx --workflows  # Enable JavaScript workflow automation
# Use workflow_run, workflow_status, workflow_cancel tools

๐Ÿ–ผ๏ธ Image Analysis

mothx -P "Describe this screenshot" --image screenshot.png
mothx -P "Extract text from this image" --image document.jpg

๐Ÿ› ๏ธ Built-in Tools

Tool Description
read Read file contents
write Create/overwrite files
edit Precise text replacement
bash Execute shell commands
grep Search file contents (powered by pure-Go ripgrep)
find Find files by pattern (powered by pure-Go fd)
ls List directory contents
plan Publish task plans
jobs Manage background jobs
kill Stop background jobs
skill_ref Load skill references
workflow_run Execute JavaScript workflow DSL
workflow_status Check workflow run status
workflow_cancel Cancel running workflows
delegate_subagent Blocking single sub-agent delegation
subagent_spawn Async sub-agent execution
question Interactive user prompts (plan/agent modes)

๐Ÿ”ง Configuration

Settings Files

Location Platform Scope
~/.mothx/settings.json Linux/macOS/FreeBSD Global
%APPDATA%\mothx\settings.json Windows Global
.mothx/settings.json All Project (overrides global)

MothX reads configuration only from the .mothx locations above. It does not read or migrate legacy .vibecoding or .vibe directories. Use MOTHX_DIR to select a custom global configuration directory.

Environment Variables

Variable Description
DEEPSEEK_API_KEY DeepSeek API key
MOTHX_DIR Override config directory
VIBECODING_PROVIDER Override default provider
VIBECODING_MODEL Override default model
VIBECODING_MODE Override default mode
VIBECODING_DEBUG Enable debug output
VIBECODING_NO_UPDATE_CHECK Disable update notifications
VIBECODING_NPM_REGISTRY Override npm registry URL

Serve Configuration

Serve config lives in serve.json (global ~/.mothx/serve.json, project .mothx/serve.json) and covers the OpenAI-compatible API, Web UI, cron, memory, and messaging channels. See Serve Mode for details.


๐Ÿค Contributing

We welcome contributions! See Development Guide for details.

git clone https://github.com/startvibecoding/mothx.git
cd mothx
make build
make test

๐Ÿ“„ License

MIT โ€” see LICENSE for details.


Ready to vibe? โญ Star this repo and start coding!

About

Ultra cost-effective terminal AI coding assistant with excellent token cache hit rate. Built in ~10K lines of Go, it uses DeepSeek by default with multiple modes and sandbox.

Topics

Resources

Stars

34 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages