diff --git a/package-lock.json b/package-lock.json index 38d079b76..bade96865 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,8 @@ "packages/app", "packages/relay", "packages/website", - "packages/desktop" + "packages/desktop", + "packages/cli" ], "dependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.11" @@ -6698,6 +6699,10 @@ "resolved": "packages/app", "link": true }, + "node_modules/@paseo/cli": { + "resolved": "packages/cli", + "link": true + }, "node_modules/@paseo/desktop": { "resolved": "packages/desktop", "link": true @@ -26344,6 +26349,43 @@ "url": "https://github.com/sponsors/colinhacks" } }, + "packages/cli": { + "name": "@paseo/cli", + "version": "0.1.0", + "dependencies": { + "@paseo/server": "*", + "chalk": "^5.3.0", + "commander": "^12.0.0" + }, + "bin": { + "paseo": "bin/paseo" + }, + "devDependencies": { + "tsx": "^4.6.0", + "typescript": "^5.2.2" + } + }, + "packages/cli/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "packages/cli/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "packages/desktop": { "name": "@paseo/desktop", "version": "1.0.0", diff --git a/package.json b/package.json index 91765d94a..514f77ef7 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "packages/app", "packages/relay", "packages/website", - "packages/desktop" + "packages/desktop", + "packages/cli" ], "scripts": { "dev": "./scripts/dev.sh", diff --git a/packages/cli/bin/paseo b/packages/cli/bin/paseo new file mode 100755 index 000000000..67ea354db --- /dev/null +++ b/packages/cli/bin/paseo @@ -0,0 +1,2 @@ +#!/usr/bin/env npx tsx +import '../src/index.js' diff --git a/packages/cli/package.json b/packages/cli/package.json new file mode 100644 index 000000000..014cbcc31 --- /dev/null +++ b/packages/cli/package.json @@ -0,0 +1,21 @@ +{ + "name": "@paseo/cli", + "version": "0.1.0", + "description": "Paseo CLI - control your AI coding agents from the command line", + "type": "module", + "bin": { + "paseo": "./bin/paseo" + }, + "scripts": { + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "@paseo/server": "*", + "commander": "^12.0.0", + "chalk": "^5.3.0" + }, + "devDependencies": { + "typescript": "^5.2.2", + "tsx": "^4.6.0" + } +} diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts new file mode 100644 index 000000000..c776b8d67 --- /dev/null +++ b/packages/cli/src/cli.ts @@ -0,0 +1,50 @@ +import { Command } from 'commander' + +const VERSION = '0.1.0' + +export function createCli(): Command { + const program = new Command() + + program + .name('paseo') + .description('Paseo CLI - control your AI coding agents from the command line') + .version(VERSION, '-v, --version', 'output the version number') + + // Placeholder subcommands for Phase 1 + program + .command('agent') + .description('Manage agents') + .action(() => { + console.log('agent command (not yet implemented)') + }) + + program + .command('daemon') + .description('Manage the Paseo daemon') + .action(() => { + console.log('daemon command (not yet implemented)') + }) + + program + .command('permit') + .description('Manage permission requests') + .action(() => { + console.log('permit command (not yet implemented)') + }) + + program + .command('worktree') + .description('Manage git worktrees') + .action(() => { + console.log('worktree command (not yet implemented)') + }) + + program + .command('provider') + .description('Manage agent providers') + .action(() => { + console.log('provider command (not yet implemented)') + }) + + return program +} diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts new file mode 100644 index 000000000..9fe0776ce --- /dev/null +++ b/packages/cli/src/index.ts @@ -0,0 +1,4 @@ +import { createCli } from './cli.js' + +const program = createCli() +program.parse() diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json new file mode 100644 index 000000000..0a76a2787 --- /dev/null +++ b/packages/cli/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "outDir": "./dist", + "rootDir": "./src", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "src/**/*.test.ts"] +}