Advanced › CLI
CLI
Download variables and secure files on your machine or in CI.
Install
npm install -g @smart-dev-agency/smart-grow-secure-cliThe command is smart-grow.
Sign in
smart-grow cloud_loginThe CLI creates a key for this device and shows a code with a link. Open the link, check the code and approve the device. The session lasts 7 days, you can have up to 5 devices, and you can revoke any of them from CLI Sessions.
Download on your machine
smart-grow cloud_download
smart-grow cloud_download_filecloud_download asks for the organization, application and environment, and writes the variables to smart-grow.env unless you choose another name. cloud_download_file downloads a secure file the same way.
Use in CI/CD
In a pipeline, use an API key with cloud_sync. It reads its settings from environment variables and writes smart-grow.env. Copy the organization, application and environment IDs from the environment's Export → CLI Integration Guide.
- name: Pull secrets
run: npx -y @smart-dev-agency/smart-grow-secure-cli cloud_sync
env:
SMARTGROW_API_KEY: ${{ secrets.SMARTGROW_API_KEY }}
SMARTGROW_ORG_ID: ${{ vars.SMARTGROW_ORG_ID }}
SMARTGROW_APP_ID: ${{ vars.SMARTGROW_APP_ID }}
SMARTGROW_ENV_ID: ${{ vars.SMARTGROW_ENV_ID }}Set SMARTGROW_FORMAT to dotenv, env or json, and SMARTGROW_OUTPUT to change the file name. For a secure file, run cloud_sync_file with --file <file-id>.
Other commands
smart-grow cloud_statusshows the current session.smart-grow cloud_logoutsigns this device out.
The full reference is on npm.