This command line interface is used to manage OpenTDF Platform.
The main goals are to:
- simplify setup
- facilitate migration
- aid in configuration management
- Add support for json input as piped input
- Add help level handler for each command
- Add support for
--verbosepersistent flag - Helper functions to support common tasks like pretty printing and json output
Install the pre-reqs:
For MacOS: brew install hugo git-lfs
The CLI is configured via the otdfctl.yaml. There is an example provided in otdfctl-example.yaml.
Run cp otdfctl-example.yaml otdfctl.yaml to copy the example config when running the CLI.
Load up the platform (see its README for instructions).
The CLI is built using cobra.
The primary function is to support CRUD operations using commands as arguments and flags as the values.
The output format (currently styled or json) is configurable in the otdfctl.yaml or via CLI flag.
- Capture the flag value and validate the values
- Alt support JSON input as piped input
- Run the handler which is located in
pkg/handlersand pass the values as arguments - Handle any errors and return the result in a lite TUI format
Caution
This is a work in progress please avoid touching until framework is defined
The TUI will be used to create an interactive experience for the user.
Documentation drives the CLI in this project. This can be found in /docs/man and is used in the
CLI via the man.Docs.GetDoc() function.
To run the documentation locally, run hugo server --buildDrafts --disableFastRender. This will
start a local server at http://localhost:1313/.