Skip to main content

CLI Commands

Mega Brain provides a comprehensive CLI for installation, setup, and system management.

Installation


Commands

install

Install Mega Brain into a new or existing project.
string
Optional project name. If omitted, uses current directory name.
Usage:
Behavior:
  • Creates directory structure (core/, agents/, .claude/, etc.)
  • Copies templates and hooks
  • Initializes .env file
  • Sets up git repository with layer system
Location: bin/mega-brain.js:65-67

setup

Interactive setup wizard for API keys and dependencies. Usage:
Behavior:
  • Prompts for API keys (OpenAI, Voyage, Google)
  • Validates credentials
  • Writes to .env file
  • Installs Python dependencies
  • Runs system health check
Auto-trigger: Runs automatically on first use if .env is missing Location: bin/mega-brain.js:95-97

validate

Validate MoneyClub email for Premium access.
string
required
Email address to validate
Usage:
Returns:
  • Exit code 0: Email valid
  • Exit code 1: Email invalid
Location: bin/mega-brain.js:68-77

push

Push changes to Layer 1/2/3 remote repositories.
number
Specific layer to push (1, 2, or 3). If omitted, pushes current layer.
Usage:
Layers:
  • Layer 1 (Community): Public shell - core templates, hooks, and CLI
  • Layer 2 (Premium): Shell + brain - includes agents and knowledge base
  • Layer 3 (Personal): Full backup - includes sensitive data and personal agents
Location: bin/mega-brain.js:78-80

upgrade

Upgrade from Community to Premium version. Usage:
Behavior:
  • Validates MoneyClub membership
  • Downloads Premium assets
  • Updates agent registry
  • Enables Pro features
Location: bin/mega-brain.js:81-88

status

Show Pro license status and feature availability. Usage:
Output:
Location: bin/mega-brain.js:89-91

features

List available vs locked features. Usage:
Output:
Location: bin/mega-brain.js:92-94

—help

Show help message with all available commands. Usage:
Location: bin/mega-brain.js:105-131

Environment Variables

All configuration is managed through .env file:
string
required
OpenAI API key for Whisper transcription. Required for pipeline processing.
string
Voyage AI API key for semantic embeddings and RAG search. Recommended for knowledge retrieval.
string
Google OAuth client ID for Drive import functionality. Optional.
string
Google OAuth client secret for Drive import. Optional.
string
Not required when using Claude Code. Only needed for direct API usage.

Exit Codes


Notes

The CLI uses Node.js 21+ native .env loading. No external dependencies required.
Never commit .env file to version control. It’s automatically gitignored.