Install the CLI
Install the CosmicAC CLI and point it at your deployment.
Install the CosmicAC CLI and point it at your deployment to create and manage jobs from your terminal.
Prerequisites
You need the following before you start:
- Node.js 20 or later.
- npm.
- GitHub personal access token (PAT) with
read:packagesscope. - A running CosmicAC deployment. See Installation to deploy CosmicAC.
Steps
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 the CLI is installed:
cosmicac --helpIf the CLI lists the available commands, the installation succeeded. See CLI commands for the full reference.
Authenticate as an admin
Run cosmicac admin init and enter your deployment's ORK RPC key when prompted:
cosmicac admin initRun task ork-key on the host machine where CosmicAC is deployed to print the ORK RPC key. If you cannot access it, ask the admin who deployed CosmicAC for the key.
Point the CLI at your deployment
Set the URLs, replacing https://cosmicac.example.com with your Base URL and keeping the /api and /inference paths:
cosmicac admin config set \
--app-url https://cosmicac.example.com/api \
--inference-url https://cosmicac.example.com/inference \
--web-url https://cosmicac.example.comThe Base URL is the address where your CosmicAC UI is reachable. It can be localhost, a server IP, or a domain name.
Confirm the configuration
Check that the CLI points at your deployment:
cosmicac config showThe active URLs should match your deployment.
Help and troubleshooting
Create a GitHub PAT with the read:packages scope
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic).
- Click Generate new token (classic).
- Give it a descriptive name ("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.