SnapMaster is the definitive DevOps integration platform.
snap
is the command-line interface (CLI) for SnapMaster.
On a Mac: brew tap snapmaster-io/snap && brew install snap
If you have go installed: go get github.com/snapmaster-io/snap
make
in the root directory will invoke go build -o bin/snap
and embed the latest git hash into the version.
snap --help
or snap command --help
makes it easy to learn about all of snap's commands, thanks to Cobra.
snap init
will create a config file (defaults to $HOME/.config/snap/config.json). This has the most important configuration for snap:
- API URL: the URL for the API. Currently defaults to https://www.snapmaster.io
- Client ID: the OAuth2 Client ID for the app.
- Redirect URL: This is the localhost URL where snap expects the OAuth2 callback. Defaults to http://localhost:8085
- Auth Domain: the OAuth2 server that will handle the PKCE flow. Defaults to snapmaster-dev.auth0.com
snap init
allows any of these to be overridden.
snap login
will initiate the login flow. If you don't have a SnapMaster
account, you can create one.
snap logout
will remove the API access token and log out the current user.
snap gallery
will retrieve all the snaps in the gallery
snap gallery get {snapname}
will get the YAML description of a snap
snap snaps fork {snapname}
will fork a public snap into the user's account
snap snaps list
will list all snaps in the user's account
snap snaps get {snapname}
will get the YAML description of a snap
snap snaps list --format=json | jq '.[] | .snapId'
will grab the user's snaps in JSON format and pipe through jq, returning a list of the snapId's
snap snaps delete {snapname}
will delete a snap from the user's account
snap snaps publish/unpublish {snapname}
will make a snap public (discoverable) or switch it back to private
snap activate {snapname}
will prompt for parameters and activate a snap
snap active list
will list all activated snaps
snap active get {active snap ID}
will get information about the active snap
snap active logs {active snap ID}
will get all logs for the active snap
snap active logs {active snap ID} details {log ID}
will retrieve log details for a particular log entry
snap active pause/resume {active snap ID}
will pause or resume an active snap
snap active deactivate {active snap ID}
will deactivate and active snap and REMOVE ALL LOGS
snap logs
will retrieve all logs from all active snaps
snap logs details {logID}
will retrieve log details for a particular log entry
snap tools list
will retrieve all available tools and their connection state
snap tools get {toolname}
will retrieve the YAML definition of a tool
snap connect {toolname}
will connect a tool that has a 'simple' type by prompting for credentials
snap connections list
will list all connections
snap connections get {toolname}
will get credential-sets associated with the connection
snap connections credential-set add {toolname}
will add a new credential for the tool
snap connections credential-set list {toolname}
will list named credentials for the tool
snap connections credential-set remove {toolname} {cred-name}
will remove a credential for the tool
snap
is written in golang and communicates with the SnapMaster-API as a back-end. It utilizes Cobra for command processing and Viper for config abstraction.
Since SnapMaster currently uses Auth0 for its authentication and authorization, an important part of snap is handling the Proof Key for Code Exchange (PKCE) OAuth2 flow. The auth
package provides an implementation of this flow.