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