[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80765":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":13,"stars30d":14,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":12,"starSnapshotCount":12,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},80765,"2M-Code","ArafatAhmed-2M\u002F2M-Code","ArafatAhmed-2M","2M Code (Multi-Mind) — A terminal-native AI coding platform where teams of specialized, multi-provider LLM agents (Anthropic, Google, OpenAI, Mistral) collaborate to plan, implement, and review code together via a shared SQLite event bus.",null,"Python",58,0,3,19,43.4,"Other",false,"main",true,[],"2026-06-12 04:01:30","\u003Cdiv align=\"center\">\n\u003Cpre>\n██████╗ ███╗   ███╗     ██████╗ ██████╗ ██████╗ ███████╗\n╚════██╗████╗ ████║    ██╔════╝██╔═══██╗██╔══██╗██╔════╝\n █████╔╝██╔████╔██║    ██║     ██║   ██║██║  ██║█████╗  \n██╔═══╝ ██║╚██╔╝██║    ██║     ██║   ██║██║  ██║██╔══╝  \n███████╗██║ ╚═╝ ██║    ╚██████╗╚██████╔╝██████╔╝███████╗\n╚══════╝╚═╝     ╚═╝     ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n\u003C\u002Fpre>\n\u003C\u002Fdiv>\n\n# 2M Code — The AI coding platform that thinks in teams\n\n> **Multi-Mind:** Instead of one AI assistant, deploy a team of AI agents that plan, implement, and review code together — each from the best model for the job.\n\n[![License: Custom](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-NonCommercial--Attribution-blue.svg)](LICENSE)\n[![Go Version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGo-1.22+-00ADD8?logo=go)](https:\u002F\u002Fgo.dev)\n[![Python Version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.11+-3776AB?logo=python)](https:\u002F\u002Fpython.org)\n\n---\n\n## What is 2M Code?\n\nEvery current AI coding tool gives you one model, one perspective, one brain. But real engineering teams work differently — they plan, implement, review, and iterate. A tech lead breaks down the problem. A senior engineer builds the solution. A QA engineer catches bugs before they ship. **2M Code brings this dynamic to AI.**\n\nWith 2M Code, you define a **team** of AI agents in a simple YAML file. Each agent has a name, a role, a provider (Anthropic, Google, OpenAI, OpenAI-Compatible, Mistral, Cohere, Groq, Ollama, OpenRouter), and a system prompt that defines their personality and expertise. When you give the team a task, they collaborate through a shared conversation channel — each agent sees what the others have said, builds on their work, and contributes their unique perspective. The result? Code that has been planned, implemented, *and* reviewed before it reaches you.\n\n**V2 adds** persistent memory across sessions, streaming token output, cost tracking with budgets, and custom tool definitions — making 2M Code production-ready for daily use.\n\n---\n\n## Installation\n\n### Quick Install (macOS\u002FLinux)\n\n```bash\ncurl -sSL https:\u002F\u002Fraw.githubusercontent.com\u002FArafatAhmed-2M\u002F2M-Code\u002Fmain\u002Fscripts\u002Finstall.sh | bash\n```\n\n### Manual Install\n\n```bash\n# 1. Clone the repository\ngit clone https:\u002F\u002Fgithub.com\u002FArafatAhmed-2M\u002F2M-Code.git 2mcode\ncd 2mcode\n\n# 2. Install Python dependencies\npip install -r requirements.txt\n\n# 3. Build the Go binary\ngo build -o bin\u002F2m .\u002Fcmd\u002F2m\n\n# 4. Add to PATH\nexport PATH=\"$PATH:$(pwd)\u002Fbin\"\n\n# 5. Set up API keys (at least one provider)\nexport ANTHROPIC_API_KEY=\"your-key\"\nexport GOOGLE_API_KEY=\"your-key\"\nexport OPENAI_API_KEY=\"your-key\"\nexport OPENAI_COMPATIBLE_API_KEY=\"your-key\"   # DeepSeek, Together, xAI, etc.\nexport MISTRAL_API_KEY=\"your-key\"\nexport COHERE_API_KEY=\"your-key\"\nexport GROQ_API_KEY=\"your-key\"\nexport OPENROUTER_API_KEY=\"your-key\"\n# Ollama runs locally — no API key needed\n# OpenAI-Compatible also needs: export OPENAI_COMPATIBLE_BASE_URL=\"https:\u002F\u002Fapi.deepseek.com\"\n```\n\n### Requirements\n\n- **Go 1.22+** — [Install Go](https:\u002F\u002Fgo.dev\u002Fdl\u002F)\n- **Python 3.11+** — [Install Python](https:\u002F\u002Fpython.org\u002Fdownloads\u002F)\n- **API key** for at least one provider (Anthropic, Google, OpenAI, OpenAI-Compatible\\*, Mistral, Cohere, Groq, or OpenRouter). Ollama runs locally with no key needed. *\\*OpenAI-Compatible covers DeepSeek, Together AI, xAI\u002FGrok, Perplexity, Fireworks, GitHub Models, and any OpenAI-compatible API.*\n\n---\n\n## Quick Start\n\n### 1. Create a team\n\n```bash\n2m new-team\n```\n\nThis launches an interactive wizard that walks you through creating a team — naming agents, assigning roles, choosing providers, and setting the workflow.\n\n### 2. Run a task\n\n```bash\n2m run fullstack \"Build a REST API for user authentication with JWT\"\n```\n\nWatch your team collaborate in real time:\n\n```\n╭─ Aria · Tech Lead ────────────────────────\n│ I'll break this into three subtasks:\n│ 1. Database schema for users table\n│ 2. Auth endpoints (register, login, refresh)\n│ 3. JWT middleware for protected routes\n╰──────────────────────────────────────────\n\n╭─ Dev · Senior Engineer ───────────────────\n│ Starting with the database schema...\n│ ⚙ running bash: mkdir -p internal\u002Fauth\n│ └ [created directory]\n│ ...\n╰──────────────────────────────────────────\n\n╭─ Quinn · QA Engineer ────────────────────\n│ Code Review Results:\n│ ✓ Auth flow is solid\n│ ⚠ Warning: Add rate limiting to login endpoint\n│ ⚠ Warning: JWT secret should use env var, not hardcoded\n╰──────────────────────────────────────────\n\n✓ Team completed task in 4 turns · 3,241 tokens · 12.3s\n```\n\n### 3. Interactive chat\n\n```bash\n2m chat fullstack\n```\n\nOpens a REPL where you can have an ongoing conversation with your team.\n\n---\n\n## Team Configuration\n\nTeams are defined in YAML. Here's a complete example with V2 features:\n\n```yaml\nname: fullstack\ndescription: \"A full-stack web development team\"\nversion: \"2.0\"\n\nagents:\n  - name: Aria\n    role: Tech Lead\n    provider: anthropic          # Uses Claude\n    model: claude-opus-4-5\n    color: cyan\n    max_context: 20              # Last 20 messages as context\n    tools: [bash, read_file, write_file]\n    system_prompt: |\n      You are Aria, the Tech Lead. Break down tasks, set architecture\n      direction, and coordinate the team...\n\n  - name: Dev\n    role: Senior Engineer\n    provider: google             # Uses Gemini\n    model: gemini-1.5-pro\n    color: green\n    tools: [bash, read_file, write_file]\n    system_prompt: |\n      You are Dev, the Senior Engineer. Implement features based on\n      the tech lead's plan...\n\n  - name: Quinn\n    role: QA Engineer\n    provider: openai             # Uses GPT-4o\n    model: gpt-4o\n    color: yellow\n    tools: [bash, read_file]     # QA doesn't write files\n    system_prompt: |\n      You are Quinn, the QA Engineer. Review all code for bugs,\n      security issues, and quality...\n\nworkflow:\n  orchestration: leader_first    # Aria speaks first\n  turns_per_task: 1              # One round of turns per task\n  leader: Aria                   # Leader agent\n  reviewer: Quinn                # Reviewer speaks last\n  max_tokens_per_turn: 4096\n  max_tokens_per_run: 32000      # Optional: overall budget for the run\n\n# V2: Custom tools run arbitrary commands via bash\ncustom_tools:\n  - name: lint_code\n    description: \"Run the project's linter on specified paths\"\n    command: \"npm run lint -- {paths}\"\n    input_schema:\n      type: object\n      properties:\n        paths:\n          type: string\n          description: \"Space-separated file paths to lint\"\n      required: [paths]\n```\n\nTeams can be stored in:\n- **Project-local:** `.\u002F.2mcode\u002Fteams\u002F` — shared via version control\n- **Global:** `~\u002F.2mcode\u002Fteams\u002F` — personal teams\n- **Bundled:** `config\u002Fteams\u002F` — example teams included with 2M Code\n\n---\n\n## Skills\n\n2M Code ships with **17 built-in skills** that inject expert instructions into agent prompts when you mention a task they cover. Skills are auto-detected — just describe what you need, and matching skill content is appended to the agent's system prompt.\n\n### How it works\n\n1. You ask the agent team to do something (e.g., \"Create a PDF report with a table\")\n2. The system checks your message against known skill names\n3. If a match is found (e.g., the `pdf` skill), its full instructions are injected into the system prompt\n4. The agent follows the skill's expert guidance for superior results\n\n### Available skills\n\n```\n2m skill list              List all skills\n2m skill show \u003Cname>       Show full skill content\n```\n\n| Skill | Description |\n|---|---|\n| `pdf` | Create, read, edit, merge, split, OCR, and fill PDF forms |\n| `pptx` | Build slide decks, pitch decks, and edit presentations |\n| `docx` | Create and manipulate Word documents with formatting |\n| `xlsx` | Create and edit spreadsheets, charts, and tabular data |\n| `frontend-design` | Build production-grade web interfaces with bold aesthetics |\n| `canvas-design` | Create posters, art, and visual designs with design philosophy |\n| `algorithmic-art` | Generative art with p5.js, flow fields, and particle systems |\n| `theme-factory` | Apply curated font and color themes to any artifact |\n| `doc-coauthoring` | Structured workflow for co-authoring documentation |\n| `brand-guidelines` | Apply brand colors, typography, and style guidelines |\n| `internal-comms` | Write status reports, newsletters, FAQs, and team updates |\n| `mcp-builder` | Create MCP servers (Python FastMCP or Node\u002FTypeScript) |\n| `claude-api` | Build and optimize Claude API \u002F Anthropic SDK apps |\n| `web-artifacts-builder` | Create multi-component HTML artifacts with React + Tailwind |\n| `webapp-testing` | Test local web apps with Playwright |\n| `slack-gif-creator` | Create animated GIFs optimized for Slack |\n| `skill-creator` | Create, edit, and benchmark new skills |\n\nSkills live in the `Skills\u002F` directory. Each skill is a folder with a `SKILL.md` file containing YAML frontmatter (name, description, license) and Markdown body with expert instructions.\n\n---\n\n## Plugins\n\n2M Code has a Python-based plugin system that lets you hook into the agent engine lifecycle. Plugins can modify agent prompts, intercept tool execution, log activity, and more.\n\n### How it works\n\n1. Create a `.py` file in `~\u002F.2mcode\u002Fplugins\u002F` (global) or `.2mcode\u002Fplugins\u002F` (project-local)\n2. Subclass `Plugin` from `plugin_base.Plugin` and override lifecycle hooks\n3. Run `2m plugin list` to verify it loaded\n\n### Lifecycle hooks\n\n| Hook | When it runs | What you can do |\n|---|---|---|\n| `on_startup(server_app)` | Engine starts | Register FastAPI routes, init connections |\n| `on_shutdown()` | Engine stops | Clean up resources |\n| `on_agent_turn_start(req)` | Before each agent call | Modify system prompt, inject context |\n| `on_agent_turn_end(response)` | After each agent response | Format output, log tokens, append footers |\n| `on_tool_exec(tool_name, params)` | Before tool execution | Block dangerous commands, log usage |\n\n### Example: context injector\n\n```python\nfrom plugin_base import Plugin\n\nclass ContextInjectorPlugin(Plugin):\n    name = \"context_injector\"\n\n    def on_agent_turn_start(self, req: dict) -> dict:\n        req[\"system\"] += \"\\n## Guidelines\\n- Prefer simple, readable code\"\n        return req\n```\n\n### Built-in example plugins\n\n```\n~\u002F.2mcode\u002Fplugins\u002F\n  context_injector.py   — Injects coding guidelines into every agent turn\n  turn_logger.py        — Logs agent turn start\u002Fend to a file\n  safety_filter.py      — Blocks dangerous tool calls (rm -rf \u002F, etc.)\n  response_formatter.py — Appends token usage and timestamp to responses\n```\n\n### CLI\n\n```\n2m plugin list   — List all discovered plugins and their hooks\n```\n\n---\n\n## Supported Providers\n\n| Provider | Available Models (Examples) | Required Env Var | Notes |\n|---|---|---|---|\n| **Anthropic** | `claude-3.5-sonnet`, `claude-3-opus` | `ANTHROPIC_API_KEY` | Best for complex reasoning and lead roles. |\n| **Google** | `gemini-1.5-pro`, `gemini-2.0-flash` | `GOOGLE_API_KEY` | Massive context window (up to 2M tokens). |\n| **OpenAI** | `gpt-4o`, `o1-preview` | `OPENAI_API_KEY` | Strong all-rounder. |\n| **OpenAI-Compatible** | Any OpenAI-compatible API | `OPENAI_COMPATIBLE_API_KEY` | Set `base_url` in team YAML (or `OPENAI_COMPATIBLE_BASE_URL` env var). Covers DeepSeek, Together, xAI, Perplexity, Fireworks, GitHub Models, and hundreds more. |\n| **Mistral** | `mistral-large`, `codestral` | `MISTRAL_API_KEY` | Excellent code-specific models. |\n| **Cohere** | `command-r-plus`, `command-r` | `COHERE_API_KEY` | Strong tool-use and RAG capabilities. |\n| **Groq** | `llama3-70b-8192`, `mixtral-8x7b-32768` | `GROQ_API_KEY` | Ultra-fast LPU inference (500+ tokens\u002Fsec). |\n| **OpenRouter** | `anthropic\u002Fclaude-3.5-sonnet`, etc. | `OPENROUTER_API_KEY` | Unified API for 200+ models. |\n| **Ollama** | `llama3`, `mistral`, `codellama` | *None* | Runs locally and privately. Connects to `localhost:11434` |\n\n---\n\n## How It Works\n\n1. **Shared Team Channel.** All agent messages are stored in a SQLite database. Each agent reads the last N messages as context before responding — so they genuinely see each other's work, like a shared Slack channel.\n\n2. **Turn-Based Orchestration.** Agents take turns in a defined order. In `leader_first` mode, the leader speaks first (usually the planner), then workers implement, then the reviewer gives final feedback.\n\n3. **Streaming Output.** Agent responses stream token-by-token via SSE from the Python engine to the Go CLI, so you see text appear in real time — no waiting for the full response.\n\n4. **Tool Access.** Agents can run bash commands, read files, and write files — just like you do when coding. The orchestrator handles tool execution and feeds results back to the agent. You can also define **custom tools** in the team YAML that run arbitrary commands via bash.\n\n5. **Cost Tracking & Budgets.** Each run tracks input\u002Foutput tokens and estimates cost. Set `max_tokens_per_run` in your workflow to enforce spending limits.\n\n6. **Persistent Memory.** After each run, the orchestrator summarizes the session using `qwen\u002Fqwen3-coder:free` (1M+ context) via OpenRouter and saves it to `~\u002F.2mcode\u002Fmemory\u002F`. Future runs inject relevant past context into agent prompts — so your team remembers decisions, code patterns, and user preferences across sessions.\n\n---\n\n## CLI Commands\n\n```\n2m new-team              Create a new team interactively\n2m team list             List all configured teams\n2m team show \u003Cname>      Show team config details\n2m run \u003Cteam> \"\u003Ctask>\"   Run a one-shot task with a team\n2m chat \u003Cteam>           Start an interactive REPL with a team\n2m history \u003Cteam>        Show last session's team channel log\n2m config set \u003Ckey>      Set global config values\n2m models [provider]     List available models from providers (filter optional)\n2m plugin list           List all discovered plugins and their hooks\n2m skill list            List all available skills\n2m skill show \u003Cname>     Show full content of a specific skill\n```\n\n---\n\n## Roadmap\n\n### v1 — Foundation\n- ✅ Multi-provider agent teams (9 provider adapters — Anthropic, Google, OpenAI, OpenAI-Compatible\\*, Mistral, Cohere, Groq, Ollama, OpenRouter). *\\*OpenAI-Compatible covers DeepSeek, Together, xAI, Perplexity, Fireworks, GitHub Models, and any OpenAI-compatible API.*\n- ✅ YAML team configuration\n- ✅ Shared team channel (SQLite event bus)\n- ✅ Leader-first and round-robin orchestration\n- ✅ Tool support: bash, file read\u002Fwrite, web fetch\n- ✅ Interactive chat REPL\n- ✅ Team creation wizard\n\n### v2 (Current) — Production Features\n- ✅ Streaming token output (SSE from Python engine)\n- ✅ Cost tracking and budgets per team run (`max_tokens_per_run` in workflow)\n- ✅ Custom tool definitions in team YAML (arbitrary bash commands as tools)\n- ✅ Persistent memory across sessions (LLM-summarized context saved to `~\u002F.2mcode\u002Fmemory\u002F`)\n- ✅ Agent parallelism (simultaneous turns — planned)\n\n### v3 (Current) — Extensibility & Integration\n- ✅ Plugin\u002Fextension system (Python-based plugins with lifecycle hooks) — `2m plugin list`\n- ✅ Built-in skill system (17 expert skills auto-injected into agent prompts) — `2m skill list`\n- 🔲 GitHub PR and CI\u002FCD integration (auto-review PRs, run on push)\n- 🔲 Agent self-improvement via feedback loops (agents review each other)\n- 🔲 Web dashboard for team monitoring (read-only session viewer)\n- ✅ `2m history \u003Cteam>` — View last session's full conversation log with agent badges\n\n### v4 (Future) — Enterprise & Collaboration\n- 🔲 Multi-user session sharing (team members see the same team channel)\n- 🔲 Team management UI (invite, roles, access control)\n- 🔲 Audit logging (every agent action logged with timestamp + user)\n- 🔲 Persistent agent personas (agents remember their own history across projects)\n- 🔲 Usage analytics and cost dashboards\n\n### v5 (Future) — Autonomous & Intelligent\n- 🔲 Autonomous agent mode (agents proactively suggest and start work)\n- 🔲 Cross-project memory (agents transfer learning between projects)\n- 🔲 Natural language workflow builder (describe your team in plain English)\n- 🔲 Self-hosted model fine-tuning integration\n- 🔲 Real-time collaboration (multiple users chatting with the same team)\n\n---\n\n## Contributing\n\nWe welcome contributions! Here's how to get started:\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature\u002Fmy-feature`\n3. Make your changes and add tests\n4. Run the test suite: `make test`\n5. Submit a pull request\n\n### Development Setup\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FArafatAhmed-2M\u002F2M-Code.git 2mcode\ncd 2mcode\npip install -r requirements.txt\nmake build\nmake run-dev ARGS=\"team list\"\n```\n\n### Code Standards\n\n- **Go:** `go vet .\u002F...` must pass with no warnings\n- **Python:** PEP 8 compliant (use `black` formatter)\n- All public functions must have documentation comments\n- No hardcoded API keys anywhere in source code\n- Error messages must be actionable (what went wrong + what to do)\n\n---\n\n## License\n\nCustom License — Non-Commercial, Attribution Required.\n© 2026 [Arafat Ahmed Mubin](https:\u002F\u002Fgithub.com\u002FArafatAhmed-2M)\n\nYou may use, modify, and distribute this software for **non-commercial purposes only**.\nAttribution to the original author is required in all copies and derivative works.\nSee [LICENSE](LICENSE) for full terms.\n\n---\n\n\u003Cp align=\"center\">\n  \u003Cstrong>2M Code\u003C\u002Fstrong> — Because the best code comes from multiple minds.\u003Cbr>\n  Built with ❤️ by the 2M Code team.\n\u003C\u002Fp>\n","2M Code 是一个基于终端的AI编码平台，通过多提供商的大规模语言模型（LLM）代理团队协作完成代码规划、实现和审查。其核心功能包括支持Anthropic、Google、OpenAI等多家AI服务提供商的模型协同工作，通过共享的SQLite事件总线进行通信，以及版本V2新增的会话间持久化记忆、流式输出、成本跟踪与预算管理等功能。该平台适合需要高质量代码产出且重视开发过程中多人协作模拟效果的场景，特别适用于希望提高软件开发效率与质量的技术团队。",2,"2026-06-11 04:01:57","CREATED_QUERY"]