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