diff --git a/src/commands.ts b/src/commands.ts index cba5bc2e..37e02a2d 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -136,6 +136,7 @@ import hooks from './commands/hooks/index.js' import files from './commands/files/index.js' import branch from './commands/branch/index.js' import agents from './commands/agents/index.js' +import autoFix from './commands/auto-fix.js' import plugin from './commands/plugin/index.js' import reloadPlugins from './commands/reload-plugins/index.js' import rewind from './commands/rewind/index.js' @@ -263,6 +264,7 @@ const COMMANDS = memoize((): Command[] => [ addDir, advisor, agents, + autoFix, branch, btw, chrome, diff --git a/src/commands/auto-fix.ts b/src/commands/auto-fix.ts new file mode 100644 index 00000000..41c53fd8 --- /dev/null +++ b/src/commands/auto-fix.ts @@ -0,0 +1,25 @@ +import type { Command } from '../types/command.js' + +const command: Command = { + name: 'auto-fix', + description: 'Configure auto-fix: run lint/test after AI edits', + isEnabled: () => true, + type: 'prompt', + progressMessage: 'Configuring auto-fix...', + contentLength: 0, + source: 'builtin', + async getPromptForCommand() { + return [ + { + type: 'text', + text: + 'The user wants to configure auto-fix settings. Auto-fix automatically runs lint and test commands after AI file edits, feeding errors back for self-repair.\n\n' + + 'Current settings location: `.claude/settings.json` or `.claude/settings.local.json`\n\n' + + 'Example configuration:\n```json\n{\n "autoFix": {\n "enabled": true,\n "lint": "eslint . --fix",\n "test": "bun test",\n "maxRetries": 3,\n "timeout": 30000\n }\n}\n```\n\n' + + 'Ask the user what lint and test commands they use, then help them set up the configuration.', + }, + ] + }, +} + +export default command