AI Coding Agent for FTC / FRC / VEX Robotics Software Development
__ __ _ ____ _
| \/ | (_) / ___|___ __| | ___
| \ / | ___ ___ _ ___| | / _ \ / _` |/ _ \
| |\/| |/ _ \/ __| |/ __| |__| (_) | (_| | __/
|_| |_|\___/\___|_|\___|\____\___/ \__,_|\___|
The only AI coding agent built specifically for robotics — FTC, FRC, and VEX.
Generate robot code, design autonomous routines, tune PID, and deploy — all from your terminal.
# Install
pip install magic-code
# Run the interactive setup (pick provider, model, enter API key)
magic-code setup
# Start coding
magic-code "create an FTC teleop with mecanum drive using NextFTC"
magic-code "generate an FRC swerve drive with PathPlanner"
magic-code "write a VEX PROS autonomous routine"| Platform | Frameworks | Path Planning | Vision |
|---|---|---|---|
| FTC | NextFTC, FTCLib | Pedro Pathing, Pure Pursuit | AprilTag, TFOD, Limelight |
| FRC | WPILib, Command-Based | PathPlanner, Choreo | PhotonVision, Limelight |
| VEX | PROS (C/C++) | VEX Pathing | Vision Sensor |
Pick your AI model like Hermes Agent, OpenCode, Cursor:
Anthropic (Claude) → sonnet, opus, haiku
OpenAI (GPT) → gpt-5, gpt-4o, o1
Google (Gemini) → gemini-2.5-pro, gemini-2.5-flash
xAI (Grok) → grok-3, grok-3-mini
Cohere (Command R) → command-r-plus
Ollama (Local) → llama3.1, qwen2.5, codellama
NVIDIA (NIM) → nemotron-3-ultra
OpenRouter → 300+ models unified
DeepSeek → deepseek-chat, deepseek-coder
Quick model switching:
# CLI flags
magic-code --provider openai --model gpt-5 "make an FTC auto"
magic-code --provider google --model gemini-2.5-pro "tune PID"
magic-code --provider ollama --model llama3.1 "build chassis"
magic-code --provider nvidia --model nemotron-3-ultra "swerve drive"Visualise robots, fields, and paths — no GUI needed:
magic-code "show the FTC DECODE field"
magic-code "place my robot at (36, 36, 90) on the FTC field"
magic-code "show a path from (0,0) to (72,72)"
magic-code "visualise my Pedro Pathing code on the field"┌────── FTC DECODE FIELD ──────┐
│ │
│ 🔵 ⚪ 🔴 │
│ ╲ │ ╱ │
│ ╲ │ ╱ │
│ ─── ┴ ─── │
│ R 🟦 │
│ ─── ┬ ─── │
│ ╱ │ ╲ │
│ ╱ │ ╲ │
│ 🟦 ⚪ 🔴 │
│ │
└──────────────────────────────┘
| Category | Tools |
|---|---|
| File System | read, write, edit, list, search, create, delete, copy |
| Terminal | run command, run async, wait, gradle, adb |
| Deploy | deploy-ftc, deploy-frc, run-simulation |
| Visualizer | show-field, show-pose, show-path, show-pedro-path, show-dashboard |
- FTC: Command-Based, Pedro Pathing, Pure Pursuit, AprilTag, Dashboard
- FRC: Command-Based, PathPlanner, Choreo, PhotonVision
- Common: PID Tuning, Git→Deploy→Test Loop, VEX PROS
Pick your provider interactively:
magic-code setup=== Magic Code Setup Wizard ===
Step 1: Pick your AI Provider
# Provider Models Description
1 Anthropic (Claude) sonnet, opus, haiku Best for complex reasoning
2 OpenAI (GPT) gpt-5, gpt-4o, o1 Fast, coding-optimized
3 Google (Gemini) gemini-2.5-pro Large context, fast
4 xAI (Grok) grok-3, grok-3-mini Unfiltered
5 Cohere (Command R) command-r-plus RAG, enterprise
6 Ollama (Local) llama3.1, qwen2.5 Run locally
7 NVIDIA (NIM) nemotron-3-ultra NVIDIA NIM
8 OpenRouter 300+ models Unified API
9 DeepSeek deepseek-chat Reasoning
Enter number or provider name [1]:
API keys are saved securely to ~/.config/magic-code/.env (chmod 600).
magic-code "create FTC teleop with mecanum drive, intake subsystem, and arm"
# → Generates TeleOp.kt, DriveSubsystem.kt, IntakeSubsystem.kt, ArmSubsystem.kt
magic-code "add Pedro Pathing autonomous that scores 2 samples in high chamber"
# → Generates AutoRed.kt with Pedro Pathing path chain
magic-code "show my path on the field"
# → Terminal field visualisation with robot pose and path overlaymagic-code "create FRC swerve subsystem with PathPlanner integration for team 1234"
# → Generates SwerveSubsystem.java, PathPlanner integration, RobotContainer.javamagic-code "create FTC PID tuning routine for arm with FTC Dashboard @Config"
# → Generates ArmPIDTuner OpMode with configurable constants| Provider | API Key Env | Models | Cool Factor |
|---|---|---|---|
| Anthropic | ANTHROPIC_API_KEY |
sonnet, opus, haiku | Best reasoning |
| OpenAI | OPENAI_API_KEY |
gpt-5, gpt-4o, o1 | Fast coding |
GOOGLE_API_KEY |
gemini-2.5-pro | 1M context | |
| xAI | XAI_API_KEY |
grok-3 | Unfiltered |
| Cohere | COHERE_API_KEY |
command-r-plus | RAG |
| Ollama | (none) | llama3.1 | Local/Private |
| NVIDIA | NVIDIA_API_KEY |
nemotron-3-ultra | GPU optimized |
| OpenRouter | OPENROUTER_API_KEY |
300+ models | One API |
| DeepSeek | DEEPSEEK_API_KEY |
deepseek-chat | Budget |
magic-code/
├── magic_code/ # Core agent package
│ ├── agent.py # Main agent with LLM integration
│ ├── cli.py # CLI entry + setup wizard (9 providers)
│ ├── config/ # Configuration management
│ ├── llm_provider.py # 6 LLM providers + model aliases
│ ├── tools/ # 21 tools (file, terminal, visualizer)
│ └── visualizer/ # Terminal field visualiser (FTC/FRC/VEX)
├── skills/ # 13 robotics-specific skills
└── AGENTS.md # AI agent instructions
magic-code doctorChecks:
- Python version
- Configured provider + model
- All 9 API key statuses
- Installed dependencies
Built-in season knowledge:
- Full field layout (144" x 144")
- Sample/Specimen/Ascent scoring
- AprilTag ID map (1-24)
- Optimal autonomous strategies
- Chamber and Observation Zone coordinates
magic-code --help— CLI referencemagic-code doctor— System health checkmagic-code setup— Interactive provider setupAGENTS.md— Agent behavior guidelines
PRs welcome! See CONTRIBUTING.md for guidelines.
MIT — use it, fork it, build robots with it.
Made with ⚡ for FIRST Robotics and VEX teams everywhere.