refactor(tool): simplify edit_file to parameter-based input only

- Remove JSON input support, use CLI parameters only
- Remove line mode, keep text replacement only
- Add sed as line operation alternative in tool-strategy.md
- Update documentation to English

Usage: ccw tool exec edit_file --path file.txt --old "old" --new "new"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-09 15:50:35 +08:00
parent fcc811d6a1
commit be9a1c76d4
3 changed files with 75 additions and 156 deletions

View File

@@ -108,9 +108,12 @@ export function run(argv) {
// Tool command
program
.command('tool [subcommand] [args] [json]')
.command('tool [subcommand] [args]')
.description('Execute CCW tools')
.action((subcommand, args, json) => toolCommand(subcommand, args, { json }));
.option('--path <path>', 'File path (for edit_file)')
.option('--old <text>', 'Old text to replace (for edit_file)')
.option('--new <text>', 'New text (for edit_file)')
.action((subcommand, args, options) => toolCommand(subcommand, args, options));
program.parse(argv);
}