From 1c965cd1f91749f3aa6b619482ccbe007100ab55 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Tue, 3 Feb 2026 09:03:57 +0000 Subject: [PATCH] feat: add create command --- src/commands/create.ts | 174 ++++++++++++----------------------------- 1 file changed, 48 insertions(+), 126 deletions(-) diff --git a/src/commands/create.ts b/src/commands/create.ts index 1aa82c7..bae316f 100644 --- a/src/commands/create.ts +++ b/src/commands/create.ts @@ -1,145 +1,67 @@ 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 { createWorktree, createGit, getMainBranch } from '../utils/git-utils'; +import { loadGlobalConfig, saveWorkspaceConfig, getWorkspacePath, isValidAgentName, detectPackageJson, installDependencies, getGitUserInfo, sanitizeAgentName } from '../utils/file-utils'; +import { setupEnvironment } from '../utils/env-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