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.
- Node.js 20 or later
- npm
- GitHub PAT with
read:packagesscope - A running CosmicAC deployment. See Installation to deploy CosmicAC.
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-cliConfirm that the CLI installed.
cosmicac --helpIf 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 ~/.bashrcAdd 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.comSave the file, then reload your shell profile.
# zsh
source ~/.zshrc
# bash
source ~/.bashrcConfirm that the CLI points at your deployment.
cosmicac config showThe 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 loginThis 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
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic).
- Click Generate new token (classic).
- Give it a descriptive name, for example "CosmicAC CLI".
- Select the
read:packagesscope. - Click Generate token and copy it immediately, because you won't see it again.
- 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.