refactor(cli): rename ps to ls and add top-level agent commands
This commit is contained in:
@@ -13,8 +13,14 @@ export function createDaemonCommand(): Command {
|
||||
daemon
|
||||
.command('status')
|
||||
.description('Show daemon status')
|
||||
.option('--json', 'Output in JSON format')
|
||||
.option('--host <host>', 'Daemon host:port (default: localhost:6767)')
|
||||
.action(withOutput(runStatusCommand))
|
||||
.action((options, command) => {
|
||||
if (options.json) {
|
||||
command.parent.parent.opts().format = 'json'
|
||||
}
|
||||
return withOutput(runStatusCommand)(options, command)
|
||||
})
|
||||
|
||||
daemon
|
||||
.command('stop')
|
||||
|
||||
@@ -13,6 +13,7 @@ interface StartOptions {
|
||||
home?: string
|
||||
foreground?: boolean
|
||||
noRelay?: boolean
|
||||
allowedHosts?: string
|
||||
}
|
||||
|
||||
export function startCommand(): Command {
|
||||
@@ -22,6 +23,7 @@ export function startCommand(): Command {
|
||||
.option('--home <path>', 'Paseo home directory (default: ~/.paseo)')
|
||||
.option('--foreground', 'Run in foreground (don\'t daemonize)')
|
||||
.option('--no-relay', 'Disable relay connection')
|
||||
.option('--allowed-hosts <hosts>', 'Comma-separated list of allowed MCP hosts (e.g., "localhost:6767,127.0.0.1:6767")')
|
||||
.action(async (options: StartOptions) => {
|
||||
await runStart(options)
|
||||
})
|
||||
@@ -46,6 +48,10 @@ async function runStart(options: StartOptions): Promise<void> {
|
||||
config.relayEnabled = false
|
||||
}
|
||||
|
||||
if (options.allowedHosts) {
|
||||
config.agentMcpAllowedHosts = options.allowedHosts.split(',').map(h => h.trim())
|
||||
}
|
||||
|
||||
// For now, only foreground mode is supported
|
||||
// TODO: Implement daemonization in a future phase
|
||||
if (!options.foreground) {
|
||||
|
||||
Reference in New Issue
Block a user