From d1371a045dd3f75ce85516cb4a0bc9a294293530 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Tue, 3 Feb 2026 08:07:29 +0000 Subject: [PATCH] fix: Add command source files --- 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