From e758d08e157076cf69e6d0adb1ecd2c61eced2b6 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Tue, 3 Feb 2026 07:57:00 +0000 Subject: [PATCH] Add CLI commands (create, list, status, merge, destroy, diff) --- .src/commands/create.ts | 145 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 .src/commands/create.ts diff --git a/.src/commands/create.ts b/.src/commands/create.ts new file mode 100644 index 0000000..aef9472 --- /dev/null +++ b/.src/commands/create.ts @@ -0,0 +1,145 @@ +import * as path from 'path'; +import * as fs from 'fs-extra'; +import { Command } from 'commander'; +import ora from 'ora'; +import chalk from 'chalk'; +import { + createWorktree, + createGit, + getMainBranch +} from '../utils/git-utils'; +import { + loadGlobalConfig, + saveWorkspaceConfig, + getWorkspacePath, + isValidAgentName, + detectPackageJson, + installDependencies, + getGitUserInfo +} from '../utils/file-utils'; +import { setupEnvironment, runCustomSetupScript } from '../utils/env-utils'; +import { sanitizeAgentName } from '../utils/file-utils'; +import { GitAgentSyncError, InvalidAgentNameError } from '../utils/errors'; +import { CreateOptions } from '../types'; + +export function createCreateCommand(): Command { + const cmd = new Command('create') + .description('Create an isolated git worktree for an AI agent') + .argument('', 'Name identifier for the agent (will become agent-{name})') + .option('-p, --path ', 'Custom path for the workspace') + .option('-t, --template