An offline-first command memory + execution copilot. Never repeat the same command twice.
π Live at smart-terminal.onrender.com
CommandBrain is a React + TypeScript browser app that transforms natural language into executable system commands. Built locally-first with @runanywhere/web + WebAssemblyβyour data stays on your machine.
I noticed I was repeating the same ChatGPT prompts again and again. Instead of re-explaining context every time, I built CommandBrain to remember commands locally and execute/refine them instantly without repeating the full conversation.
Everything is stored locally in your browser:
{
"commands": [
{
"id": "cmd_1",
"prompt": "download youtube video",
"generated": "yt-dlp \"<VIDEO_URL>\"",
"safety": "caution",
"category": "Media",
"timestamp": 1710614400000
}
],
"favorites": [
{
"commandId": "cmd_1",
"nickname": "YouTube Download",
"folder": "Media Tools",
"tags": ["video", "download", "yt-dlp"],
"notes": "Best for video extraction and audio conversion"
}
],
"macros": [
{
"id": "macro_1",
"name": "Batch Download",
"description": "Download multiple videos",
"commandIds": ["cmd_1", "cmd_2"],
"runCount": 5
}
],
"patterns": [
{ "category": "Media", "count": 12 },
{ "category": "DevOps", "count": 8 },
{ "category": "Files", "count": 5 }
],
"reminders": [
{
"commandId": "cmd_1",
"frequency": "high",
"lastRun": 1710614300000,
"snoozed": null
}
]
}{
"commandbrain_bridge_config": {
"bridgeUrl": "http://localhost:8888",
"enabled": true
},
"commandbrain_reminder_snooze_map": {
"cmd_1": "2026-03-24T00:00:00Z"
}
}π Zero cloud sync. Everything stays in your browser's local database.
Describe what you want in plain English. CommandBrain generates the right command automatically.
Organize with folders, tags, notes. Search and filter. Never lose a command again.
Install & Run:
npm install
npm run devOpen http://localhost:5173
Production Build:
npm run build
npm run preview- Describe β Enter what you need in natural language
- Preview β See generated command + safety classification
- Refine β Edit parameters (URLs, outputs, placeholders) inline
- Execute β Run in Simulate or Real mode (with bridge)
- Save β Store in Saved Commands for instant reuse
For YouTube requests, CommandBrain generates multiple yt-dlp variants:
# Video download (best quality)
yt-dlp "<VIDEO_URL>"
# High-quality MP4 merge
yt-dlp -f "bestvideo+bestaudio" --merge-output-format mp4 "<VIDEO_URL>"
# Audio-only extraction
yt-dlp -x --audio-format mp3 "<VIDEO_URL>"
# List available formats
yt-dlp -F "<VIDEO_URL>"
# Download specific format
yt-dlp -f <FORMAT_CODE> "<VIDEO_URL>"
# Custom output filename
yt-dlp -o "%(title)s.%(ext)s" "<VIDEO_URL>"Refinement in Action: Type "audio only" or "use this URL" to update the preview in real-time instead of starting from scratch.
Organize saved commands with:
- Nicknames β Friendly names for quick recall
- Folders β Group by project or category
- Tags β Filter across your command library
- Notes β Context and usage instructions
- Inline Editing β Update metadata directly from cards
- Search & Filter β Find commands in milliseconds
Auto-suggest frequently used commands:
- Shows reminder card for commands you run often
- Quick execute or explore options
- Snooze for 1 day or 7 days
- Open Saved Commands for full context
| Mode | Behavior | Use Case |
|---|---|---|
| Simulate | No real execution, returns mock output | Testing, previews |
| Real | Executes through local bridge | Actual command execution |
Configure bridge in Settings.
src/
βββ App.tsx # Main app entry
βββ runanywhere.ts # RunAnywhere SDK
βββ components/
β βββ CommandBrainTab.tsx # π§ Core UI
βββ commandbrain/
β βββ CommandBrain.ts # Main API
β βββ interpreter/ # NL β Command
β βββ safety/ # Safety classification
β βββ storage/ # IndexedDB management
β βββ templates/ # Command templates
βββ styles/
βββ index.css # Global styles
Note: CommandBrain is the active experience. Chat/Vision/Voice tabs are gated behind SHOW_EXTRA_TABS.
This app requires Cross-Origin Isolation headers:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: credentiallessvercel.json is included for Vercel deployment.
- Quick Start β Get running in 5 minutes
- CommandBrain Guide β Detailed workflow
- New Features β Latest additions
- Implementation β Architecture & internals
Built to solve the problem of repetitive AI prompting by creating an offline-first memory layer for system commands. CommandBrain runs entirely locally in the browser, ensuring your data never leaves your device unless you explicitely share it.
SDK Repository: https://github.com/RunanywhereAI/runanywhere-sdks
MIT