Skip to content

feat(commands/config.ts): add support for 'describe' mode to print detailed help for config parameters #470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

benleibowitz
Copy link
Contributor

@benleibowitz benleibowitz commented May 4, 2025

Summary

  • feat(commands/config.ts): add support for 'describe' mode to print detailed help for config parameters

  • fix(commands/config.ts): improve error handling for get and set modes when no config keys are provided

Changes

The changes in this commit add a new describe mode to the config command, which allows users to get detailed information about the available configuration parameters. This includes a description of each parameter and the accepted values.

The describe mode can be used in two ways:

  1. To print help for all available config parameters: oco config describe

  2. To print help for specific config parameters: oco config describe OCO_MODEL OCO_API_KEY

Additionally, the commit fixes the error handling for the get and set modes, ensuring that an error is thrown if no config keys are provided.

These changes improve the usability and discoverability of the configuration system, making it easier for users to understand and manage their opencommit settings.

Example Usage

oco config describe
┌  COMMAND: config describe 
Available config parameters:

OCO_AI_PROVIDER:
  Description: The AI provider to use
  Default: openai

OCO_API_KEY:
  Description: API key for the selected provider

OCO_API_URL:
  Description: Custom API URL - may be used to set proxy path to OpenAI API

OCO_DESCRIPTION:
  Description: Postface a message with ~3 sentences description of the changes
  Default: false
...
...
... 
oco config describe OCO_AI_PROVIDER
┌  COMMAND: config describe OCO_AI_PROVIDER

OCO_AI_PROVIDER:
  Description: The AI provider to use
  Default: openai
  Accepted values:
    - ollama
    - openai
    - anthropic
    - gemini
    - azure
    - test
    - flowise
    - groq
    - mistral
    - mlx
    - deepseek

…tailed help for config parameters

fix(commands/config.ts): improve error handling for 'get' and 'set' modes when no config keys are provided

The changes in this commit add a new 'describe' mode to the config command, which allows users to get detailed information about the available configuration parameters. This includes a description of each parameter and the accepted values.

The 'describe' mode can be used in two ways:

1. To print help for all available config parameters:
   ```
   oco config describe
   ```

2. To print help for specific config parameters:
   ```
   oco config describe OCO_MODEL OCO_API_KEY
   ```

Additionally, the commit fixes the error handling for the 'get' and 'set' modes, ensuring that an error is thrown if no config keys are provided.

These changes improve the usability and discoverability of the configuration system, making it easier for users to understand and manage their opencommit settings.
… section

refactor(config.ts): improve config key descriptions and add default values
@di-sukharev
Copy link
Owner

@benleibowitz hi, sorry, you should be merging to master directly, i know contributions guide tell to merge to dev, but i forgot to update it, people 99% never read it and merge to master anyway, so i aligned to how they do it. now master is the base of all PRs, i then try to ship a new version each month

@benleibowitz
Copy link
Contributor Author

Sure, let me send out a new PR off of master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants