- Add mc_api_call_machine() function for MC_MACHINE_TOKEN auth - Update mc_api_call() to use machine token when available - Allows cron jobs to authenticate without cookie-based login - No breaking changes - cookie auth still works for interactive use - Also updates default API URL to production (was localhost) |
||
|---|---|---|
| .. | ||
| lib | ||
| tests | ||
| add-voxyz-research.js | ||
| mc.sh | ||
| project.sh | ||
| README.md | ||
| sprint.sh | ||
| task.sh | ||
| update-task-status.js | ||
| voxyz-daily-cron.sh | ||
Mission Control CLI
A Next.js API-based CLI for managing Mission Control. Follows the same architecture principles as the Gantt Board CLI.
Architecture
The Mission Control CLI follows a clean API passthrough architecture:
- API is the source of truth - All business logic lives in the Mission Control API endpoints
- CLI is thin - CLI scripts parse arguments and call API endpoints, no direct database access
- Shared code via delegation - Task/project/sprint operations delegate to Gantt Board CLI
- Mission Control specific features call Mission Control API directly
Quick Start
# Authenticate
./scripts/mc.sh auth login user@example.com password
# Search across tasks, projects, documents
./scripts/mc.sh search "api design"
# List tasks with due dates
./scripts/mc.sh due-dates
# Task operations (delegates to gantt-board)
./scripts/mc.sh task list --status open
./scripts/mc.sh task create --title "New task" --project "Mission Control"
# Project operations (delegates to gantt-board)
./scripts/mc.sh project list
# Sprint operations (delegates to gantt-board)
./scripts/mc.sh sprint list --active
Scripts
Main CLI
mc.sh- Main entry point for all Mission Control CLI operations
Wrapper Scripts (Delegate to Gantt Board)
task.sh- Task operations (delegates to gantt-board/scripts/task.sh)project.sh- Project operations (delegates to gantt-board/scripts/project.sh)sprint.sh- Sprint operations (delegates to gantt-board/scripts/sprint.sh)
Library
lib/api_client.sh- Shared HTTP client for Mission Control API calls
Utilities
update-task-status.js- Update task status (delegates to gantt-board)
Configuration
Environment variables:
# Mission Control API URL
export MC_API_URL="http://localhost:3001/api"
# Path to gantt-board (auto-detected if not set)
export GANTT_BOARD_DIR="/path/to/gantt-board"
# Cookie file for authentication
export MC_COOKIE_FILE="$HOME/.config/mission-control/cookies.txt"
Command Reference
Authentication
./mc.sh auth login <email> <password>
./mc.sh auth logout
./mc.sh auth session
Search
./mc.sh search "query string"
Searches across:
- Tasks (title, description)
- Projects (name, description)
- Sprints (name, goal)
- Documents (title, content)
Tasks with Due Dates
./mc.sh due-dates
Returns tasks with due dates, ordered by due date.
Documents
./mc.sh documents list
./mc.sh documents get <id>
Task Operations (via Gantt Board)
./mc.sh task list [--status <status>] [--priority <priority>]
./mc.sh task get <task-id>
./mc.sh task create --title "..." [--description "..."] [--project <name>]
./mc.sh task update <task-id> [--status <status>] [--priority <priority>]
./mc.sh task delete <task-id>
See Gantt Board CLI documentation for full task command reference.
Project Operations (via Gantt Board)
./mc.sh project list
./mc.sh project get <project-id-or-name>
./mc.sh project create --name "..." [--description "..."]
./mc.sh project update <project-id> [--name "..."] [--description "..."]
Sprint Operations (via Gantt Board)
./mc.sh sprint list [--active]
./mc.sh sprint get <sprint-id-or-name>
./mc.sh sprint create --name "..." [--goal "..."]
./mc.sh sprint close <sprint-id-or-name>
Architecture Diagram
┌─────────────────────────────────────────────────────────────┐
│ Mission Control CLI │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ mc.sh │ │ task.sh │ │ project.sh │ │
│ │ (main) │ │ (wrapper) │ │ (wrapper) │ │
│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
│ │ │ │ │
│ │ └──────────┬──────────┘ │
│ │ │ │
│ │ ┌──────────────▼──────────────┐ │
│ │ │ Gantt Board CLI │ │
│ │ │ (task.sh, project.sh) │ │
│ │ └──────────────┬──────────────┘ │
│ │ │ │
│ │ ▼ │
│ │ ┌─────────────────────┐ │
│ │ │ Gantt Board API │ │
│ │ └─────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────┐ │
│ │ Mission Control API │ │
│ │ /api/search, /api/tasks/with-due-dates, etc │ │
│ └──────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Testing
Run the CLI contract test:
npm run test:cli-contract
This verifies:
- Mission Control CLI wrappers delegate to gantt-board CLI
- No direct database references in scripts/
- update-task-status.js delegates to gantt-board task.sh
Design Principles
- No Direct Database Access - CLI scripts never call the database directly
- API Passthrough - All operations go through API endpoints
- Shared Functionality - Common operations (tasks, projects, sprints) use Gantt Board
- Clean Separation - Mission Control specific features use Mission Control API
Adding New Commands
To add a new Mission Control specific command:
- Create the API endpoint in
app/api/<feature>/route.ts - Add the command handler in
scripts/mc.sh - Use
lib/api_client.shfunctions for HTTP calls - Document the command in this README
Example:
# In mc.sh
handle_feature() {
mc_get "/feature" | jq .
}
Troubleshooting
"GANTT_BOARD_DIR not set"
Set the environment variable:
export GANTT_BOARD_DIR=/path/to/gantt-board
Or use the auto-detection by placing gantt-board in a standard location:
../../../gantt-board(relative to mission-control)$HOME/Documents/Projects/OpenClaw/Web/gantt-board
"Not authenticated"
Login first:
./scripts/mc.sh auth login user@example.com password
API Connection Errors
Verify Mission Control is running:
curl http://localhost:3001/api/auth/session