Open marco76tv opened 5 months ago
Stale issue message
will look into this, thanks
I also see this as a useful yet dangerous option, but you, "use at your own risks". @marco76tv would you like to propose a PR? Here are some guidelines to get you started. We'll provide you with assistance once you start a PR.
To implement the --yes or -y option for the aic command line utility, allowing users to bypass interactive selection and automatically accept the first AI-generated commit message, you'll need to modify several parts of the codebase. Here's a step-by-step guide based on the provided context:
The current interaction with users primarily happens in the commit function within ./src/commands/commit.ts. This function uses prompts (from @clack/prompts) to interactively ask users to confirm commit messages or select files to stage.
To add the --yes or -y option, you'll need to modify the CLI setup in ./src/cli.ts to recognize the new flags and alter the flow based on these flags.
flags: {
fgm: Boolean,
yes: Boolean, // Add this line
y: 'yes' // Alias -y to --yes
},
// At the beginning of the commit function, add a check for the flag
if (flags.yes) {
// If the flag is set, automatically select the first AI-generated commit message
// and bypass any other interactive prompts (e.g., file staging or commit confirmation)
// You might need to adjust the logic to directly use the first AI-generated message
// and proceed with the commit without further user interaction.
}
You should be able to implement the --yes or -y option, let us know how this works for you.
Description
I propose to add a --yes or -y option to the aic command line utility, which will allow users to automatically accept the first AI generated commit message without requiring interactive input. This feature will be especially useful when aic is integrated into automation scripts or other environments where manual input is not convenient or possible.
Currently, when a user runs aic, they are presented with one or multiple AI-generated commit messages and are asked to select one. While this is a great feature for manual use, it becomes a bottleneck when trying to automate the Git commit process as it requires an interactive terminal to make a choice.
Suggested Solution
oco -y
Alternatives
No response
Additional Context
No response