debricked / cli

Debricked's command line interface. It brings open source security, compliance and health to your project via the command prompt.
MIT License
20 stars 10 forks source link

Proposal for Extending CLI Arguments for Customization #279

Open topikachu opened 1 week ago

topikachu commented 1 week ago

In our project, we often require additional arguments to customize the behavior of the package tool commands. For example:

To streamline this, I propose adding new CLI arguments such as --npm-args, --mvn-args, and similar options for other tools (like Yarn). This would allow users to specify custom arguments for different tools directly in the CLI.

If this approach sounds reasonable, I'd be happy to contribute an implementation that supports these options for npm, mvn, and yarn.

Let me know your thoughts!

CarlTern commented 4 days ago

Hi topikachu, thank you for sharing your ideas on CLI argument extensions.

The 'resolve' command was designed to be a quick and simple way of automatically ensuring that you have all lock files within your repository generated prior to scanning with Debricked.

We have not focused on adding support for more advanced use cases since the command by default does not overwrite any existing lock files and we wanted to keep it as simple as possible with "sane defaults". If one requires specific arguments to be passed during resolution, it is therefore possible to run the commands on their own before running 'debricked resolve'.

If you would like to resolve manually, the exact way default resolution is being done in the command can be found in the README’s in each package managers folder here https://github.com/debricked/cli/tree/main/internal/resolution/pm.

To get some background for this particular issue, is the reason behind it to reduce the amount of commands that have to be run prior to a scan, or were you unaware of the default non-override behaviour of the ‘resolve’ command?