mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
feat(cli): add settings file support for builtin Claude
- Enhance CLI status rendering to display settings file information for builtin Claude. - Introduce settings file input in CLI manager for configuring the path to settings.json. - Update Claude CLI tool interface to include settingsFile property. - Implement settings file resolution and validation in CLI executor. - Create a new collaborative planning workflow command with detailed documentation. - Add test scripts for debugging tool configuration and command building.
This commit is contained in:
48
test-command-build.mjs
Normal file
48
test-command-build.mjs
Normal file
@@ -0,0 +1,48 @@
|
||||
import { buildCommand } from './ccw/dist/tools/cli-executor-utils.js';
|
||||
import { getToolConfig } from './ccw/dist/tools/claude-cli-tools.js';
|
||||
import { resolvePath } from './ccw/dist/utils/path-resolver.js';
|
||||
import fs from 'fs';
|
||||
|
||||
const workingDir = 'D:\\Claude_dms3';
|
||||
const tool = 'claude';
|
||||
|
||||
// Get tool config
|
||||
const toolConfig = getToolConfig(workingDir, tool);
|
||||
console.log('=== Tool Config ===');
|
||||
console.log(JSON.stringify(toolConfig, null, 2));
|
||||
|
||||
// Resolve settings file
|
||||
let settingsFilePath = undefined;
|
||||
if (toolConfig.settingsFile) {
|
||||
try {
|
||||
const resolved = resolvePath(toolConfig.settingsFile);
|
||||
console.log(`\n=== Settings File Resolution ===`);
|
||||
console.log(`Configured: ${toolConfig.settingsFile}`);
|
||||
console.log(`Resolved: ${resolved}`);
|
||||
console.log(`Exists: ${fs.existsSync(resolved)}`);
|
||||
|
||||
if (fs.existsSync(resolved)) {
|
||||
settingsFilePath = resolved;
|
||||
console.log(`✓ Will use settings file: ${settingsFilePath}`);
|
||||
} else {
|
||||
console.log(`✗ File not found, skipping`);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(`✗ Error resolving: ${err.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Build command
|
||||
const cmdInfo = buildCommand({
|
||||
tool: 'claude',
|
||||
prompt: 'test prompt',
|
||||
mode: 'analysis',
|
||||
model: 'sonnet',
|
||||
settingsFile: settingsFilePath
|
||||
});
|
||||
|
||||
console.log('\n=== Command Built ===');
|
||||
console.log('Command:', cmdInfo.command);
|
||||
console.log('Args:', JSON.stringify(cmdInfo.args, null, 2));
|
||||
console.log('\n=== Full Command Line ===');
|
||||
console.log(`${cmdInfo.command} ${cmdInfo.args.join(' ')}`);
|
||||
Reference in New Issue
Block a user