feat(cli): add agent send command

Implements the `agent send` command for sending messages to existing agents.

Features:
- Send follow-up tasks to running agents
- Support for ID prefix matching (e.g., "a1b2" matches "a1b2c3d4")
- --no-wait flag to return immediately without waiting for completion
- Default behavior waits for agent to become idle

Usage:
  paseo agent send <id> <prompt>
  paseo agent send --no-wait a1b2c3d "Run the linter"
This commit is contained in:
Mohamed Boudra
2026-01-28 23:25:45 +07:00
parent dd514a4a67
commit 851d5ef247
3 changed files with 342 additions and 0 deletions
+10
View File
@@ -2,6 +2,7 @@ import { Command } from 'commander'
import { runPsCommand } from './ps.js'
import { runRunCommand } from './run.js'
import { runSendCommand } from './send.js'
import { runStopCommand } from './stop.js'
import { withOutput } from '../../output/index.js'
export function createAgentCommand(): Command {
@@ -37,5 +38,14 @@ export function createAgentCommand(): Command {
.option('--host <host>', 'Daemon host:port (default: localhost:6767)')
.action(withOutput(runSendCommand))
agent
.command('stop')
.description('Stop an agent (cancel if running, then terminate)')
.argument('[id]', 'Agent ID (or prefix) - optional if --all or --cwd specified')
.option('--all', 'Stop all agents')
.option('--cwd <path>', 'Stop all agents in directory')
.option('--host <host>', 'Daemon host:port (default: localhost:6767)')
.action(withOutput(runStopCommand))
return agent
}