@deepstructure/cli
v0.4.74
Published
Command line interface to the DeepStructure platform
Downloads
1,183
Readme
DeepStructure CLI
The ds
CLI tool streamlines the development, deployment, and management of applications on the DeepStructure Cloud platform.
Installation
To start using ds
, you must have node.js and npm installed. You can use npx
to run the latest version without needing to install it globally on your system. This approach ensures you're always using the most up-to-date version of the tool.
npx @deepstructure/cli@latest <command>
We recommend installing ds
locally in your DeepStructure projects, which is done for you automatically when you use create-deepstructure-app.
npm install --save-dev @deepstructure/cli
Doing so will mean that your npm scripts can use the ds
command directly from node_modules/
:
"scripts": {
"deploy": "ds deploy"
"build": "ds build"
}
Example Usage
The following shows a typical way to use the ds
command to work with a DeepStructure app, including authentication, creating an application, and deploying.
$ ds login
Using DS Cluster: prod
Please use the following link to login:
https://auth-service.deepstructure.app/auth/verify?....
✔ Login success! The CLI has a JWT :)
Selected team deepstructure.io.
$ ds app add my-ds-app
Successfully created application
Created application: {
id: '8082c2ec-37f8-4165-80cc-a0ab6c2937dd',
name: 'my-ds-app',
repo: '[email protected]:Example/Example.git',
domain: '(not set)',
teamId: 'f0e0d40f-0e69-4b8c-858f-7a9f511a01f2',
createdAt: '2024-04-05T13:15:06.078',
updatedAt: '2024-04-05T13:15:06.078'
}
$ ds deploy
Commands
Below is a summary of the available commands and their primary functions. For detailed usage of each command, including options and examples, you can run ds <command> --help
.
Applications
- Add Application: Adds a new application to your DeepStructure Cloud account.
ds app add [name]
- Remove Application: Removes an existing application.
ds app rm [name]
- List Applications: Lists all applications associated with your account.
ds app list
Deployment
- Deploy Application: Deploys your application to DeepStructure Cloud.
ds deploy
- List Deployments: Lists all deployments for a specific application.
ds list [app]
- Tear Down Deployment: Removes a specific deployment.
ds down <id>
Development
- Run Development Server: Starts a local version of your application (currently only works in dev container).
ds dev
- Build Application: Builds your application for deployment to the
.ds/
directory.ds build
Environment and Secrets
- Set Environment Variable: Sets an environment variable for your application.
ds env set <name> <value>
- Unset Environment Variable: Removes an environment variable.
ds env unset <name>
- List Environment Variables: Lists all environment variables.
ds env list
- Set Secret: Sets a secret for your application.
ds secret set <name> <value>
- Unset Secret: Removes a secret.
ds secret unset <name>
- List Secrets: Lists all secrets.
ds secret list
Miscellaneous
- Login: Logs in to DeepStructure Cloud.
ds login
- Select Team: Selects the team to use for the logged-in user.
ds team
- Stream Logs: Streams logs from the current environment.
ds logs
- Open Shell: Opens a shell in a remote development environment.
ds shell