Skip to content
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

feat: add new config command and streamline flags #2

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Conversation

emilkje
Copy link
Member

@emilkje emilkje commented Mar 26, 2024

This change introduces the concept of configurable settings in the main cwc configuration. The rationale behind this change is to enable more configurable options without polluting the commandline interface with more flags.

The configuration can be managed manually by editing the cwc.yaml config file or by using the cwc config set command.

  • Remove --api-version flag as it's now hardcoded The apiVersion config is confusing the end-user where they conflate the azure api version with the openai model version. The azure api version is dictating the capabilities of the API and should therefore be managed by the cwc system and not the end user.
  • Add config cmd to the root command for managing CWC configurations
  • Update README.md to include configuration management section
  • Refactor cmd/cwc.go to remove obsolete flags related to gitignore and git directory exclusion, configuring through cwc config
  • Modify error handling in main.go to suppress certain error messages
  • Change config file format from JSON to YAML
  • Introduce constants for API version and config file properties
  • Improve error types with specific checks for template and suppressed errors
  • Amend login.go to adapt to the removal of the --api-version flag and use the new config structure
  • Remove unnecessary error message handling in config.go related to unmarshalling config data

This change introduces the concept of configurable
settings in the main cwc configuration. The rationale behind
this change is to enable more configurable options without
polluting the commandline interface with more flags.

The configuration can be managed manually by editing the
`cwc.yaml` config file or by using the `cwc config set` command.

- Remove `--api-version` flag as it's now hardcoded
  The apiVersion config is confusing the end-user where they conflate
  the azure api version with the openai model version. The azure
  api version is dictating the capabilities of the API and should
  therefore be managed by the cwc system and not the end user.
- Add `config` cmd to the root command for managing CWC configurations
- Update `README.md` to include configuration management section
- Refactor `cmd/cwc.go` to remove obsolete flags related to gitignore
  and git directory exclusion, configuring through `cwc config`
- Modify error handling in `main.go` to suppress certain error messages
- Change config file format from JSON to YAML
- Introduce constants for API version and config file properties
- Improve error types with specific checks for template and suppressed errors
- Amend `login.go` to adapt to the removal of the `--api-version` flag
  and use the new config structure
- Remove unnecessary error message handling in `config.go`
  related to unmarshalling config data
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@emilkje emilkje self-assigned this Mar 26, 2024
@emilkje emilkje merged commit fc4fe0b into main Mar 26, 2024
4 checks passed
@emilkje emilkje deleted the feature/config branch March 27, 2024 09:28
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.

1 participant