From 934ab3dad6c6174c2214e7401409078d06402943 Mon Sep 17 00:00:00 2001 From: Gordon Mickel Date: Fri, 9 Aug 2024 16:39:56 +0200 Subject: [PATCH] fix: update docs and order of commands --- README.md | 13 ++-- package.json | 2 +- src/cli/index.ts | 188 ++++++++++++++++++++++++----------------------- 3 files changed, 103 insertions(+), 100 deletions(-) diff --git a/README.md b/README.md index 598db5f..c35eabb 100644 --- a/README.md +++ b/README.md @@ -155,12 +155,6 @@ npm install -g codewhisper # Navigate to your project directory cd /path/to/your/project -# Generate an AI-friendly prompt using interactive mode -codewhisper interactive - -# List available models -codewhisper list-models - # Start an AI-assisted coding task # CodeWhisper will prompt you to select a model from the list of available models codewhisper task @@ -189,6 +183,13 @@ codewhisper task --undo # To redo the last task with the option to change the model, file selection or plan, use the --redo option. # Note: CodeWhisper saves the plan, instructions, model and selected files from the last task. Other options (such as --dry-run) need to be specified again. codewhisper task --redo + +# Generate an AI-friendly prompt using interactive mode +codewhisper interactive + +# List available models +codewhisper list-models + ``` > Note: If you are using CodeWhisper's LLM integration with `codewhisper task`, you will need to set the respective environment variable for the model you want to use (e.g., `export ANTHROPIC_API_KEY=your_api_key` or `export OPENAI_API_KEY=your_api_key` or `export GROQ_API_KEY=your_api_key` or `export DEEPSEEK_API_KEY=your_api_key` ). diff --git a/package.json b/package.json index 5aea156..32d3e1f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "codewhisper", "type": "module", "version": "1.14.1", - "description": "A powerful tool for converting repository code to AI-friendly prompts", + "description": "AI-Powered End-to-End Task Implementation & blazingly fast Codebase-to-LLM Context Bridge", "author": "Gordon Mickel ", "license": "MIT", "funding": "https://github.com/sponsors/gmickel", diff --git a/src/cli/index.ts b/src/cli/index.ts index 0c9609b..156e8bf 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -40,42 +40,11 @@ export function cli(_args: string[]) { ); program .name('codewhisper') - .description('A powerful tool for converting code to AI-friendly prompts') + .description( + 'AI-Powered End-to-End Task Implementation & blazingly fast Codebase-to-LLM Context Bridge', + ) .version(packageJson.version); - program - .command('list-models') - .description('List available AI models') - .action(() => { - const models = getModelNames(); - console.log('Available AI models:'); - for (const modelId of models) { - const config = getModelConfig(modelId); - if (config) { - console.log(`- ${config.modelName} (${chalk.cyan(modelId)})`); - console.log( - ` Context window: ${config.contextWindow}, Max output: ${config.maxOutput}`, - ); - console.log( - ` Pricing: $${config.pricing.inputCost}/1M tokens (input), $${config.pricing.outputCost}/1M tokens (output)`, - ); - } - } - }); - - program - .command('apply-task ') - .description('Apply an AI-generated task from a file') - .option('--auto-commit', 'Automatically commit changes', false) - .action(async (file) => { - try { - await applyTask(file); - } catch (error) { - console.error(chalk.red('Error applying task:'), error); - process.exit(1); - } - }); - program .command('task') .description('Start an AI-assisted coding task') @@ -201,6 +170,98 @@ Note: see "query parameters" at https://docs.github.com/en/rest/issues/issues?ap } }); + program + .command('list-models') + .description('List available AI models') + .action(() => { + const models = getModelNames(); + console.log('Available AI models:'); + for (const modelId of models) { + const config = getModelConfig(modelId); + if (config) { + console.log(`- ${config.modelName} (${chalk.cyan(modelId)})`); + console.log( + ` Context window: ${config.contextWindow}, Max output: ${config.maxOutput}`, + ); + console.log( + ` Pricing: $${config.pricing.inputCost}/1M tokens (input), $${config.pricing.outputCost}/1M tokens (output)`, + ); + } + } + }); + + program + .command('apply-task ') + .description('Apply an AI-generated task from a file') + .option('--auto-commit', 'Automatically commit changes', false) + .action(async (file) => { + try { + await applyTask(file); + } catch (error) { + console.error(chalk.red('Error applying task:'), error); + process.exit(1); + } + }); + + program + .command('interactive') + .description('Start interactive mode') + .option('-p, --path ', 'Path to the codebase', '.') + .option( + '-pr, --prompt ', + 'Custom prompt to append to the output', + (value) => value, + ) + .option('-t, --template