npm install -g @differentialhq/cli
To authenticate the CLI, run differential auth login
.
This will open a browser and prompt you to login to the management console.
The differential clusters
command contains subcommands for the management of clusters.
These include:
differential clusters create
Create a new Differential clusterdifferential clusters list
List Differential clusters [aliases: ls]differential clusters open
Open a Differential cluster in the consoledifferential clusters info
Display information about a Differential cluster
The differential deploy
command contains subcommands for the management of Differential Cloud deployments.
These include:
differential deploy create
Create a new Differential service deploymentdifferential deploy list
List Differential cloud deployments [aliases: ls]differential deploy info
Display information about a Differential cloud deploymentdifferential deploy logs
Retrieve logs for a service deployment
differential repl
will spawn an interactive NodeJS shell.
This shell is authenticated with your cluster and can be used to issue calls against it's functions.
The Differential CLI stores context in your project's directory. Context allows you to persist options which can be omitted from future use of the CLI.
Context values are set with differential context set
.
The following command will set a cluster
value in the context:
differential context set --cluster=my-favourite-cluster
Future calls can now omit the --cluster
option.
The context value can be unset by providing an empty option value.
differential context set --cluster
The CLI can maintain multiple named contexts for your project. This can be useful when working across multiple clusters, for example different environments.
To use a named context, provide the --context
option with your command:
differential --context=staging repl
All commands can be run with tsx:
tsx src/index.ts <cmd>
tsx src/index.ts auth login