A visual supervisor and manager for multiple Amp CLI instances, providing monitoring, thread management, and enhanced parallel execution features.
- Create and switch between amp CLI threads
- Continue existing conversations across threads
- Thread-aware prompt routing
- Visual thread indicators
- Fuzzy file search with
@filenamesyntax - Auto-completion with Tab navigation
- Working directory awareness
- Relative path resolution
- Per-instance amp CLI settings
- Command allowlisting for security
- Tool management and configuration
- Environment variable injection
- Command approval workflows
- Configurable allowlists
- Non-interactive mode for better control
- Audit logging of all commands
- Authentication status tracking
- Thread activity monitoring
- Enhanced error pattern detection
- Tool usage analytics
- Node.js (v22+) - Required by amp CLI
- TypeScript
- tmux installed on your system
- amp CLI tool installed:
npm install -g @sourcegraph/amp - Authenticated amp CLI: Run
ampfirst to authenticate
-
Install amp CLI first:
npm install -g @sourcegraph/amp
-
Authenticate with amp:
amp # Follow the authentication flow -
Install and run Amp Manager:
git clone <this-repo> cd amp-manager bun install bun run build bun start
←/→- Navigate between instancesn- Create new amp instance with authenticationd- Delete selected instance (with confirmation)p- Send prompt with file mention supportr- Toggle auto-restart for selected instancea- Approve pending command (when visible)x- Reject pending command (when visible)s- Open settings panelEnter- Open enhanced full-screen viewq- Quit with proper cleanup
p- Send prompt with@filemention supportt- Create new thread for current instancer- Toggle auto-restart for current instancea- Approve pending command (when visible)x- Reject pending command (when visible)↑/↓- Scroll through output historyESC/q- Return to dashboard
Tab- Switch between General and Instance tabsg- Toggle global auto-restart setting (General tab)r- Toggle auto-restart for selected instance (Instance tab)e- Edit configuration values (thresholds)← →- Navigate instances (Instance tab)ESC- Close settings panel
- Type
@followed by filename to search files Tab/Shift+Tab- Navigate search resultsEnter- Insert selected file reference- Works in both prompt input and full-screen view
const config = {
name: 'production-agent',
workingDirectory: '/path/to/project',
threadId: 'existing-thread-id', // Continue existing thread
ampSettings: {
'amp.notifications.enabled': true,
'amp.commands.allowlist': [
'git status',
'git diff',
'npm test',
'npm run build'
],
'amp.tools.disable': ['browser_navigate'],
'amp.mcp.disable': []
},
autoRestart: true,
inactivityThreshold: 300, // 5 minutes
requireApproval: true,
errorPatterns: [
'authentication failed',
'out of free credits',
'exceed context limit',
'timeout'
],
logLevel: 'debug'
};- Command Allowlisting: Pre-approve safe commands
- Approval Workflows: Manual approval for sensitive operations
- Tool Restrictions: Disable potentially harmful tools
- Audit Logging: Complete command history tracking
When requireApproval is enabled or commands are not in the allowlist, amp will request manual approval:
- Instance Panels: Show pending commands with
⚠️ warning - Full-Screen View: Prominent approval interface with instructions
- Status Changes: Instance status becomes
waiting_approval
- Dashboard: Press
ato approve,xto reject (when instance selected) - Full-Screen: Press
ato approve,xto reject - WebSocket API: Send
approve_commandorcancel_commandmessages
- Command Submitted: User sends prompt that requires approval
- Status Change: Instance status becomes
waiting_approval - Visual Alert: Red/magenta border with approval instructions
- User Decision: Approve (
a) or reject (x) the command - Execution: Approved commands execute immediately, rejected commands are cancelled
const config = {
requireApproval: true,
commandAllowlist: ['git status', 'ls', 'cat'],
ampSettings: {
'amp.commands.allowlist': ['git status', 'ls -la', 'pwd']
}
};Commands not in the allowlist will require manual approval before execution.
The manager provides flexible auto-restart controls:
- Global Settings: Press
sthengin the General tab to enable/disable auto-restart for all new instances - Per-Instance Toggle: Press
rto toggle auto-restart for the selected instance (works in main view, full-screen, or settings) - Settings Panel: Press
sto open comprehensive settings with editable configuration values - Visual Indicators:
- Each instance panel shows individual auto-restart status with color coding
- Settings panel shows both global defaults and per-instance overrides
- Green = Enabled, Red = Disabled
Configuration Options:
- Default Inactivity Threshold: 10-3600 seconds (editable in settings)
- Global Auto-restart Default: Applied to new instances
- Per-Instance Overrides: Individual timeout and auto-restart settings
Auto-restart triggers:
- Instance inactivity (configurable threshold per instance)
- Error pattern detection
- Manual restart requests
- Network failures and timeouts
# Create new thread
t (in full-screen view)
# Switch threads via WebSocket API
{
"type": "switch_thread",
"payload": {
"instanceId": "instance-id",
"threadId": "thread-id"
}
}// Thread Management
{ "type": "create_thread", "payload": { "instanceId": "..." } }
{ "type": "switch_thread", "payload": { "instanceId": "...", "threadId": "..." } }
{ "type": "list_threads", "payload": { "instanceId": "..." } }
// Tool Management
{ "type": "get_tools", "payload": { "instanceId": "..." } }
// Settings Management
{ "type": "update_settings", "payload": { "instanceId": "...", "settings": {...} } }
// Auto-restart Controls
{ "type": "toggle_auto_restart", "payload": { "instanceId": "..." } }
{ "type": "set_global_auto_restart", "payload": { "enabled": true } }
// Command Approval
{ "type": "approve_command", "payload": { "instanceId": "..." } }
{ "type": "cancel_command", "payload": { "instanceId": "..." } }{
"instanceCount": 3,
"runningCount": 1,
"authenticatingCount": 1,
"waitingApprovalCount": 1,
"instances": [
{
"id": "...",
"name": "...",
"status": "waiting_approval",
"authStatus": "authenticated",
"threadId": "thread-abc123...",
"uptime": 12345,
"promptsExecuted": 5,
"restartCount": 0,
"pendingCommand": {
"command": "rm -rf /important/files",
"timestamp": "2024-01-15T10:30:00.000Z"
}
}
]
}The system now monitors:
- Authentication events: Login failures, token expiry
- Thread operations: Creation, switches, forks
- Tool usage: Which tools are being used
- Command approvals: What needs manual approval
- Error patterns: Enhanced pattern matching
# Run with enhanced debugging
AMP_LOG_LEVEL=debug npm start
# Or with specific log file
AMP_LOG_FILE=./debug.log npm startThe system automatically handles:
- Auth failures: Prompts for re-authentication
- Thread corruption: Automatic thread recovery
- Tool failures: Graceful fallbacks
- Credit exhaustion: Clear user notifications
src/
├── components/
│ ├── AmpManager.tsx # Main manager component
│ ├── FullScreenView.tsx # Enhanced full-screen view
│ ├── CommandInput.tsx # File mention support
│ └── ...
├── services/
│ ├── TmuxManager.ts # Thread & auth management
│ ├── ControlSocket.ts # Enhanced WebSocket API
│ ├── AmpLogMonitor.ts # Advanced log monitoring
│ └── ...
├── utils/
│ └── AmpCliHelpers.ts # Amp CLI utilities
├── types/
│ └── AmpInstance.ts # Enhanced type definitions
└── ...
-
"Authentication failed":
# Re-authenticate manually amp logout amp login
-
"Out of free credits":
- Visit ampcode.com/settings to upgrade
-
Thread not found:
# List available threads amp threads list -
Thread corruption:
- The manager will automatically create a new thread
-
Files not found:
- Check working directory setting
- Ensure files exist and are readable
-
Search too slow:
- Limit search depth in settings
- Use more specific search terms
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure amp CLI compatibility
- Submit a pull request
MIT License - see LICENSE file for details.
⚡ Powered by Amp CLI - The AI coding agent from Sourcegraph