diff --git a/CHANGELOG.md b/CHANGELOG.md index 590b99f..aecde81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,19 @@ # [0.8.0](https://github.com/drivecore/mycoder/compare/v0.7.0...v0.8.0) (2025-03-11) - ### Features -* add --githubMode and --userPrompt as boolean CLI options that override config settings ([0390f94](https://github.com/drivecore/mycoder/commit/0390f94651e40de93a8cb9486a056a0b9cb2e165)) -* remove modelProvider and modelName - instant decrepation ([59834dc](https://github.com/drivecore/mycoder/commit/59834dcf932051a5c75624bd6f6ab12254f43769)) +- add --githubMode and --userPrompt as boolean CLI options that override config settings ([0390f94](https://github.com/drivecore/mycoder/commit/0390f94651e40de93a8cb9486a056a0b9cb2e165)) +- remove modelProvider and modelName - instant decrepation ([59834dc](https://github.com/drivecore/mycoder/commit/59834dcf932051a5c75624bd6f6ab12254f43769)) # [0.7.0](https://github.com/drivecore/mycoder/compare/v0.6.1...v0.7.0) (2025-03-10) - ### Bug Fixes -* change where anthropic key is declared ([f6f72d3](https://github.com/drivecore/mycoder/commit/f6f72d3bc18a65fc775151cd375398aba230a06f)) -* ensure npm publish only happens on release branch ([ec352d6](https://github.com/drivecore/mycoder/commit/ec352d6956c717726ef388a07d88372c12b634a6)) - +- change where anthropic key is declared ([f6f72d3](https://github.com/drivecore/mycoder/commit/f6f72d3bc18a65fc775151cd375398aba230a06f)) +- ensure npm publish only happens on release branch ([ec352d6](https://github.com/drivecore/mycoder/commit/ec352d6956c717726ef388a07d88372c12b634a6)) ### Features -* add GitHub Action for issue comment commands ([136950f](https://github.com/drivecore/mycoder/commit/136950f4bd6d14e544bbd415ed313f7842a9b9a2)), closes [#162](https://github.com/drivecore/mycoder/issues/162) -* allow for generic /mycoder commands ([4b6608e](https://github.com/drivecore/mycoder/commit/4b6608e0b8e5f408eb5f12fe891657a5fb25bdb4)) -* **release:** implement conventional commits approach ([5878dd1](https://github.com/drivecore/mycoder/commit/5878dd1a56004eb8a994d40416d759553b022eb8)), closes [#140](https://github.com/drivecore/mycoder/issues/140) +- add GitHub Action for issue comment commands ([136950f](https://github.com/drivecore/mycoder/commit/136950f4bd6d14e544bbd415ed313f7842a9b9a2)), closes [#162](https://github.com/drivecore/mycoder/issues/162) +- allow for generic /mycoder commands ([4b6608e](https://github.com/drivecore/mycoder/commit/4b6608e0b8e5f408eb5f12fe891657a5fb25bdb4)) +- **release:** implement conventional commits approach ([5878dd1](https://github.com/drivecore/mycoder/commit/5878dd1a56004eb8a994d40416d759553b022eb8)), closes [#140](https://github.com/drivecore/mycoder/issues/140) diff --git a/README.md b/README.md index eb50827..0ecc763 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,9 @@ mycoder --enableUserPrompt false "Generate a basic Express.js server" # or using the alias mycoder --userPrompt false "Generate a basic Express.js server" +# Disable user consent warning and version upgrade check for automated environments +mycoder --userWarning false --upgradeCheck false "Generate a basic Express.js server" + # Enable GitHub mode via CLI option (overrides config) mycoder --githubMode "Work with GitHub issues and PRs" diff --git a/packages/cli/README.md b/packages/cli/README.md index b2505be..d07369c 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -32,6 +32,12 @@ mycoder "Implement a React component that displays a list of items" # Run with a prompt from a file mycoder -f prompt.txt +# Disable user prompts for fully automated sessions +mycoder --userPrompt false "Generate a basic Express.js server" + +# Disable user consent warning and version upgrade check for automated environments +mycoder --userWarning false --upgradeCheck false "Generate a basic Express.js server" + # Enable GitHub mode mycoder config set githubMode true ``` @@ -104,6 +110,14 @@ mycoder config set model claude-3-7-sonnet-20250219 # or any other Anthropic mo - `customPrompt`: Custom instructions to append to the system prompt for both main agent and sub-agents (default: `""`) - `tokenCache`: Enable token caching for LLM API calls (default: `true`) +### CLI-Only Options + +These options are available only as command-line parameters and are not stored in the configuration: + +- `userWarning`: Skip user consent check for current session without saving consent (default: `true`) +- `upgradeCheck`: Disable version upgrade check for automated/remote usage (default: `true`) +- `userPrompt`/`enableUserPrompt`: Enable or disable the userPrompt tool (default: `true`) + Example: ```bash diff --git a/packages/cli/src/commands/$default.ts b/packages/cli/src/commands/$default.ts index 65fa930..1bc50e2 100644 --- a/packages/cli/src/commands/$default.ts +++ b/packages/cli/src/commands/$default.ts @@ -57,9 +57,13 @@ export const command: CommandModule = { `MyCoder v${packageInfo.version} - AI-powered coding assistant`, ); - await checkForUpdates(logger); + // Skip version check if upgradeCheck is false + if (argv.upgradeCheck !== false) { + await checkForUpdates(logger); + } - if (!hasUserConsented()) { + // Skip user consent check if userWarning is false + if (!hasUserConsented() && argv.userWarning !== false) { const readline = createInterface({ input: process.stdin, output: process.stdout, @@ -81,6 +85,10 @@ export const command: CommandModule = { logger.info('User did not consent. Exiting.'); throw new Error('User did not consent'); } + } else if (!hasUserConsented() && argv.userWarning === false) { + // Just skip the consent check without saving consent when userWarning is false + logger.debug('Skipping user consent check due to --userWarning=false'); + // Note: We don't save consent here, just bypassing the check for this session } const tokenTracker = new TokenTracker( diff --git a/packages/cli/src/options.ts b/packages/cli/src/options.ts index 8e17f59..5de958d 100644 --- a/packages/cli/src/options.ts +++ b/packages/cli/src/options.ts @@ -16,6 +16,8 @@ export type SharedOptions = { readonly enableUserPrompt?: boolean; readonly userPrompt?: boolean; readonly githubMode?: boolean; + readonly userWarning?: boolean; + readonly upgradeCheck?: boolean; }; export const sharedOptions = { @@ -107,4 +109,15 @@ export const sharedOptions = { description: 'Enable GitHub mode for working with issues and PRs', default: false, } as const, + userWarning: { + type: 'boolean', + description: + 'Skip user consent check for current session (does not save consent)', + default: false, + } as const, + upgradeCheck: { + type: 'boolean', + description: 'Disable version upgrade check (for automated/remote usage)', + default: false, + } as const, };