Amp-Thread-ID: https://ampcode.com/threads/T-a6cf4bd2-36d0-4ef8-ada6-a8e2850fcacf Co-authored-by: Amp <amp@ampcode.com>
4.2 KiB
Amp Integration in FleetCode
Amp has been added as a coding agent option in FleetCode, alongside Claude and Codex.
What Changed
Files Modified
- index.html - Added Amp to the coding agent dropdown
- server.ts - Added Amp command execution
- main.ts - Added Amp support for Electron mode
- renderer.ts - Updated UI logic for Amp
- README.md - Updated documentation
How It Works
When you select "Amp" as your coding agent and create a session:
- FleetCode creates a new git worktree for the session
- Spawns a terminal (PTY) in that worktree
- Runs any setup commands you configured
- Executes
ampcommand in the terminal
Using Amp
Prerequisites
Amp is run via npx and doesn't need to be installed system-wide:
# Amp is run using:
nix shell nixpkgs#nodejs -c npx -y @sourcegraph/amp
# This automatically:
# - Provides Node.js via Nix
# - Downloads and runs the latest @sourcegraph/amp package
Creating an Amp Session
- Click "New Session" in FleetCode
- Select your project directory (git repository)
- Choose the parent branch
- Select "Amp" from the Coding Agent dropdown
- Optionally add setup commands
- Click "Create Session"
FleetCode will:
- Create a git worktree
- Start a terminal session
- Launch
ampin the worktree
Features
What Works with Amp
✅ Git worktree isolation
✅ Persistent sessions
✅ Terminal theming
✅ Setup commands (environment variables, etc.)
✅ Session management (rename, close, delete)
Differences from Claude
Unlike Claude, Amp doesn't require:
--session-idor--resumeflags--dangerously-skip-permissionsflag- MCP server configuration
Amp sessions are simpler - just run amp and it starts.
Code Implementation
Terminal Command
When you select Amp, FleetCode runs:
nix shell nixpkgs#nodejs -c npx -y @sourcegraph/amp
This uses Nix to provide Node.js and npx to run the latest Amp package.
Claude in comparison requires session management:
claude --session-id <uuid>
UI Behavior
- Skip Permissions checkbox: Hidden for Amp (only needed for Claude)
- Session persistence: Works the same as other agents
- MCP servers: Not shown for Amp sessions
Customization
If you need to pass additional flags to Amp, you can:
-
Add them in the Setup Commands field:
export AMP_CONFIG=/path/to/config -
Or modify the code in
server.tsandmain.ts:} else if (config.codingAgent === "amp") { ptyProcess.write("nix shell nixpkgs#nodejs -c npx -y @sourcegraph/amp --your-flags-here\r"); }
Testing
To test Amp integration:
# Start the web server
npm run server
# Or for Electron
npm run dev
Then:
- Create a new session
- Select "Amp" as the coding agent
- Choose a project
- Verify that
amplaunches in the terminal
Troubleshooting
"nix: command not found"
Nix is not installed. Install it from https://nixos.org/download.html
"npx: command not found"
The nix shell should provide Node.js and npx. If this fails, check your Nix installation:
# Test Nix shell
nix shell nixpkgs#nodejs -c node --version
Amp doesn't start
Check the terminal output in the FleetCode session - you'll see any errors from the amp command.
Want to pass custom flags?
Edit the setup commands or modify server.ts/main.ts as shown above.
Future Enhancements
Possible improvements for Amp integration:
- Amp-specific settings panel
- Custom Amp flags input field
- Amp session persistence (if Amp supports session IDs)
- Amp-specific MCP server integration
- Amp status indicators
Summary
Amp is now fully integrated into FleetCode! You can:
- ✅ Select Amp from the coding agent dropdown
- ✅ Create Amp sessions in isolated git worktrees
- ✅ Run multiple Amp sessions in parallel
- ✅ Use all FleetCode features (themes, persistence, etc.)
Enjoy using Amp in FleetCode! 🚀