DevRev CLI reference
The following is a list of DevRev CLI commands:
CLI version
Check the version of CLI:
CLI help
To check all the available commands, run the following command:
Use devrev [command] --help
for more information about a command.
Authentication
Authenticate
To authenticate, run the following command:
Arguments:
-
<DevOrg-slug-name>
: The unique slug name of your DevOrg to which you want to log in. -
<your-email@example.com>
: Your registered user email for profile.
The browser opens up and asks you to log in to DevRev. Once you log in, a local dev org profile is created and an access token is stored.
Authenticate using dev token
To set up authentication using the DevRev token, run the following command:
Using DevRev’s interface, you can generate a DevRev token.
It enables CLI operations on the dev org.
Snap-in package
Create a snap-in package
To create a snap-in package, run the following command:
For example:
When the snap-in package is created, its ID is stored in the snap-in context. Run the following command to view the ID:
For example:
[id]
is optional. If not provided, it uses the snap-in package ID from the snap-in context.
Delete a snap-in package
To delete a snap-in package, run the following command:
For example:
If id
isn’t provided, it picks up the snap-in package id
from the snap-in context.
List the snap-in package
To list the snap-in package, run the following command:
For example:
Logs for the snap-in package
To view the snap-in package logs, run the following command:
For example:
Additional flags:
--after
string timestamp after which to fetch logs. For example, 2023-01-15T10:24:17Z. Defaults to 15 minutes earlier.--before
string timestamp before which to fetch logs. For example, 2023-02-15T10:24:17Z. Defaults to now.--filters
string Filters for the log message as a JSON. For example,{"level": {"values": ["info"]}, "dev_org": {"exclude": true, "values": ["don:identity:<partition>:devo/<dev-org-id>"]} }
--limit
uint32 Number of logs to fetch.
Snap-in version
Create a snap-in version
To create a snap-in version, run the following command:
For example:
Once the snap_in_version is created, its ID is stored in the snap-in context too.
Additional flags:
--package <id>
: Optional. If not provided, it uses the id from the snap-in context.--manifest <path>
: specify the path to the manifest.yaml file using this flag.--archive <path>
: specify the path to the archive file (build.tar.gz) using this flag.--create-package
: creates a new snap_in_package in interactive mode and then creates a snap-in version using the newly created snap-in package id.
Show the snap-in version
To show the snap-in version, run the following command:
For example:
[id]
is optional. If not provided, it uses the snap_in_version id stored in the snap-in context.
Delete the snap-in version
To delete a snap-in version, run the following command:
For example:
[id]
is optional. If not provided, it uses the id stored in the snap-in context.
List the snap-in versions
To list the snap-in version, run the following command:
For example:
Additional flags:
--package <id>
: Optional. If not provided, it uses the id from the snap-in context.
Snap-in
Create a snap-in draft
To create a snap-in draft instance, run the following command:
For example:
Additional flags:
--snap_in_version [id]
: Optional. If not provided, it uses the snap-in version ID from the snap-in context.
Once the snap_in draft command is successful, it also generates the interface link.
Update the snap-in with keyrings and inputs
To update the snap-in with keyrings and inputs, run the following command:
For example:
[id]
is optional. If not provided, it uses the snap_in id stored in the snap-in context.
For non-interactive mode, use the following command with the appropriate values:
Activate the snap-in
To activate a snap-in, run the following command:
[id]
is optional. If not provided, it uses the ID stored in the local profile.
Deactivate the snap-in
To deactivate a snap-in, run the following command:
[id]
is optional. If not provided, it uses the ID stored in the local profile.
--force
flag deactivates the snap-in even if the deactivate
hook fails. If the flag isn’t specified, then the snap-in moves to the Error state if the deactivate
hook fails.
Show the snap-in details
To show the snap-in details, run the following command:
[id]
is optional. If not provided, it uses the ID stored in the local profile.
List the snap-ins
To list the snap-ins, run the following command:
For example:
Delete a snap-in
To delete a snap-in, run the following command:
[id]
is optional. If not provided, it uses the id stored in the snap-in context.
The --force
flag deletes the snap-in even if the deactivate
hook fails. If the flag isn’t specified, then the snap-in moves to the Error state if the deactivate
hook fails.
Snap-in context
The CLI persists in the context of the CLI in a snap-in context. The context is used to store the following information per snap-in package slug:
- The ID of the snap-in package owning the slug.
- The ID of the last created/upgraded snap-in version, if any.
- The ID of the latest deployed snap-in, if any.
Show the snap-in context
To show the current snap-in context, run the following command:
For example:
Output:
List the snap-in context
To list the snap-in context, run the following command:
For example:
Checkout a snap-in context
To check a different snap-in context, run the following command:
For example: