Skip to content

Advanced › CLI

CLI

Download variables and secure files on your machine or in CI.

Install

Terminal
npm install -g @smart-dev-agency/smart-grow-secure-cli

The command is smart-grow.

Sign in

Terminal
smart-grow cloud_login

The 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

Terminal
smart-grow cloud_download
smart-grow cloud_download_file

cloud_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.

.github/workflows/deploy.yml
- 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_status shows the current session.
  • smart-grow cloud_logout signs this device out.

The full reference is on npm.