keyshade
keyshade copied to clipboard
CLI: Add functionality to operate on Variables
Description
We would like to perform the following operations for variable using our CLI:
- List all variables under a project (
keyshade variable list <projectId>
) - Fetch all revisions of a variable (
keyshade variable revisions <variableId>
) - Create a variable (
keyshade variable create <projectId>(refer postman for parameters)
) - Update a variable (
keyshade variable update <variableId> (refer postman for parameters)
) - Rollback a variable (
keyshade variable rollback <variableId> --environment-slug/-e <> --version/-v <>
) - Delete a variable (
keyshade variable delete <variableId>
)
Solution
- Create an implementation of
command.interface.ts
and name ifVariableCommand
. - Stash all the functions in
src/commands/variable
. - Use the
variableController
fromControllerInstance
to make the API calls.