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
- Node.js v20+
- npm
- GitHub PAT with
read:packagesscope - SSH key configured with GitHub
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-cliVerify installation
Run the following command to verify the CLI is installed correctly:
cosmicac --helpIf 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_URLexport 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_URLStaging 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 loginThis 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
- Create a GPU container job using the CLI
- Send your first inference request using the CLI
- Explore all available commands with output examples
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 (e.g., "CosmicAC CLI").
- Select the
read:packagesscope. - Click Generate token and copy it immediately (you won't see it again).
- 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
- Check for existing SSH keys:
ls -la ~/.ssh- If you don't have
id_ed25519(orid_rsa), generate a new key:
ssh-keygen -t ed25519 -C "your_email@example.com"- Add your SSH key to the ssh-agent:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519- Copy your public key and add it to GitHub (Settings → SSH and GPG keys → New SSH key):
cat ~/.ssh/id_ed25519.pub- Test the connection:
ssh -T git@github.comLearn more about connecting to GitHub with SSH.