CosmicAC Logo

Installation

Install and configure the CosmicAC CLI to interact with CosmicAC services from your terminal. The CLI lets you manage jobs, access containers, and run inference.

Prerequisites

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

Verify installation

Run the following command to verify the CLI is installed correctly:

cosmicac --help

If you see the list of available commands, you're all set.

Configure environment

Set the required environment variables to connect to CosmicAC services:

export BASE_URL={production-URL-tbd}
export APP_NODE_URL=https://$BASE_URL/api
export INFERENCE_APP_NODE_URL=https://$BASE_URL/inference
export WEB_UI_URL=https://$BASE_URL
export BASE_URL=stg-cosmicac.tail8a2a3f.ts.net
export APP_NODE_URL=https://$BASE_URL/api
export INFERENCE_APP_NODE_URL=https://$BASE_URL/inference
export WEB_UI_URL=https://$BASE_URL

Staging requires access to the Tailscale tailnet tether.to.

Make these permanent

Add the exports to your shell profile (~/.bashrc, ~/.zshrc, or equivalent) to persist them across sessions.

Authenticate

Signup/log in to your CosmicAC account:

cosmicac login

This opens your browser for authentication. If the browser doesn't open automatically, copy the URL from the terminal and paste it into your browser. Complete prompted steps to sign up or login.

Next steps

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 (e.g., "CosmicAC CLI").
  4. Select the read:packages scope.
  5. Click Generate token and copy it immediately (you won't see it again).
  6. Run the following 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.

Set up SSH for GitHub

How to set up SSH for GitHub
  1. Check for existing SSH keys:
ls -la ~/.ssh
  1. If you don't have id_ed25519 (or id_rsa), generate a new key:
ssh-keygen -t ed25519 -C "your_email@example.com"
  1. Add your SSH key to the ssh-agent:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
  1. Copy your public key and add it to GitHub (SettingsSSH and GPG keysNew SSH key):
cat ~/.ssh/id_ed25519.pub
  1. Test the connection:
ssh -T git@github.com

Learn more about connecting to GitHub with SSH.

On this page