clarifai-python
clarifai-python copied to clipboard
Concept to Clarifai-cli : 'configure' capability for profiles, PATs
What
- A CLI capability as
clarifai-cli, to ease: §. configuration: config creation/maintenance w.r.t various "profiles" associated with the same userid but different Namespaces, for instance. §. C|R|U|D|List APIs for various resources: e.g a command-line-utility to manage the lifecycle of entities like datasets, models, workflows, applications etc. owned/controlled by a user, subject to the profile ('default' or any other) in context. §. This utility can come in handy, akin to howaws configure|s3|ec2 etc.as a CLI is - better interaction, automation and integration, and more power to the users.
Why
- Whilst overall, writing a very comprehensive CLI utility has to be at first a thought-through, well brain-stormed decision, to for example, include:
§. what all actions/flows are to be supported. e.g
configure§. what all functionalities within each action are to be supported. e.g '--help', '--profile' §. how to vet and vouch for it, cross OSes/platforms, and general nuances of what/where to support It was nevertheless thought to be a good-to-have capability and as an Idea to contribute to the OSS further, I have:
- created a rudimentary action of
clarifai-cli configure, and whilst unit tests along with custom test scripts are necessary and shall/can be added, it supports creation of aconfig.json(other formats like YAML are possible) inside:$HOME/.clarifaifolder. - supported a few functionalities vis-a-vis --help as a customized "man(ual)" per (sub-)command, and support for multiple profiles, just like AWS CLI has.
How
- Giving a blueprint biased for an action to create a prototype, as is walked through in this Draft PR, to support for atleast the "creation of" a config file that keeps our PATs and other config metadata.
Tests
- Best effort, manual tests only. This is a draft PR, and complete test cases, strategies, assurances shall be laid out.
Notes
- [please dont merge it], unless it matures - but your reviews and take to better the strategy and user experience, capabilities of this functionality are highly appreciated, albeit I believe that making it to master for this utility, even still as an experimental offering replete with caveats, shall be a long(er) journey.
Supported aspects in this Prototype:
clarifai-cli -h clarifai-cli configure clarifai-cli configure -h clarifai-cli configure --profile
@sainivedh @sanjaychelliah @luv-bansal @zeiler I believe this idea around a clarifai-cli capability (trying to take it to the mights of how aws-cli operate and come in handy), can be bettered with your views, directions and contributions.