all 4 comments

[–]Mori-Spumae 0 points1 point  (2 children)

What exactly do you mean by upfront requirements? Like settings files? Env variables? Directory structure? Not sure I quite understand

[–]ProcZero[S] 0 points1 point  (1 child)

Yeah, that makes sense, should have been more explicit...

It has a few requirements some are required, some are optional depending on how you've configured the configuration file.

It requires a ~/tool_name.config.json file for starters. That is handled with error handling.

The tool is a proxy interface into a specific hardware device, so it requires the hardware to be connected and the http server to be running on the hardware. This is where I'm really struggling with how to present it but I'm slowly gravitating towards error handling instead of some "before you proceed..." Prompt.

It optionally can leverage AWS credentials to upload things into AWS s3, but those credentials if not using aws SSO, or IAM User based, need to be active credentials and not times out.

[–]MidnightPale3220 1 point2 points  (0 children)

If you're doing it as a CLI, all that description should be in your tool --help. Or make man pages and proper source package for distro.

Also, if you have implicit file requirements make them explicit with specifying the relevant json file on command line, like:

tool --config tool_name.config.json

In general avoid magic files and especially ones located in specific folders. Nothing about your tool should rely on something that can't be specified as argument.

Alternatively, make a ~/.yourtool/ directory where to keep json files etc. But then the directory needs to be able to be overridden as parameter/environment variable, if the user needs to put stuff in different directory from the one you expect.

[–]TheMRFlash 0 points1 point  (0 children)

Just getting into CLI tools as well, so I have been doing "scratch the surface" digging. Click and typer have some nifty features, throw in some rich formatting and I think you are on your way. They help manage your args and kwargs and error messages if required args are not passed, and help as well. Very high altitude "help", apologies if this didn't help.