CosmicAC Logo

Install the CLI

Install the CosmicAC CLI, point it at your deployment, and log in.

Install the CosmicAC CLI, point it at your deployment, and log in so you can work with CosmicAC from the terminal.

Prerequisites

You need the following before you start.

Install the CLI

Configure npm to use the GitHub Packages registry for the @tetherto scope, then install the CLI globally.

npm config set @tetherto:registry https://npm.pkg.github.com
npm install -g @tetherto/cosmicac-cli

Confirm that the CLI installed.

cosmicac --help

If the CLI lists the available commands, the installation succeeded. See CLI commands for the full reference.

Point the CLI at your deployment

By default, the CLI points at the hosted CosmicAC service. Set three environment variables to point it at your own deployment. Open your shell profile in a text editor.

# zsh
nano ~/.zshrc

# bash
nano ~/.bashrc

Add these variables. Replace https://cosmicac.example.com with your Base URL, keeping the /api and /inference paths.

The Base URL is the address where your CosmicAC UI is reachable. It can be localhost, a server IP, or a domain name.

export APP_NODE_URL=https://cosmicac.example.com/api
export INFERENCE_APP_NODE_URL=https://cosmicac.example.com/inference
export WEB_UI_URL=https://cosmicac.example.com

Save the file, then reload your shell profile.

# zsh
source ~/.zshrc

# bash
source ~/.bashrc

Confirm that the CLI points at your deployment.

cosmicac config show

The active URLs should match your deployment. If they still show the hosted defaults, you have not set the variables in your current shell.

Set for the current session only

To set the variables temporarily, run the export commands directly in your terminal without adding them to your shell profile. They do not persist after the session ends.

Log in

Log in to your CosmicAC account.

cosmicac login

This opens your browser for authentication. If the browser does not open, copy the URL from the terminal into your browser.

Help and troubleshooting

Create a PAT with read:packages scope

How to create a PAT
  1. Go to GitHub SettingsDeveloper settingsPersonal access tokensTokens (classic).
  2. Click Generate new token (classic).
  3. Give it a descriptive name, for example "CosmicAC CLI".
  4. Select the read:packages scope.
  5. Click Generate token and copy it immediately, because you won't see it again.
  6. Run this command, replacing {YOUR_PAT_HERE} with your token.
npm config set //npm.pkg.github.com/:_authToken {YOUR_PAT_HERE}

Learn more about creating a personal access token.

Next steps

On this page