Skip to content

Install & Authenticate The CLI

The CLI is distributed via multiple channels: Homebrew (recommended for macOS and Linux), direct download, and Windows package managers.


title: “Install & Authenticate The CLI”

Section titled “title: “Install & Authenticate The CLI””

The CLI is distributed via multiple channels: Homebrew (recommended for macOS and Linux), direct download, and Windows package managers.

Terminal window
brew install CosineAI/tap/cos
cos --version

For users who prefer not to use Homebrew:

  1. Download the latest release for your architecture from the releases page

    • Apple Silicon (M1/M2/M3): cos-darwin-arm64.zip
    • Intel Macs: cos-darwin-amd64.zip
  2. Extract and install:

    Terminal window
    unzip cos-darwin-arm64.zip
    sudo mv cos /usr/local/bin/
    cos --version
  3. (Optional) Remove quarantine attribute if prompted:

    Terminal window
    xattr -dr com.apple.quarantine /usr/local/bin/cos
Terminal window
brew install CosineAI/tap/cos
cos --version
  1. Download the appropriate build for your system from the releases page

    • x86_64 (most common): cos-linux-amd64.zip
    • ARM64: cos-linux-arm64.zip
    • x86_64 (Ubuntu 22.04/glibc 2.35): cos-linux-amd64-glibc2.35.zip
  2. Extract and install:

    Terminal window
    unzip cos-linux-amd64.zip
    sudo mv cos /usr/local/bin/
    cos --version
Terminal window
curl -fsSL https://cosine.sh/install | bash

For the CLI to function correctly, the following tools are required:

  • fzf - Fuzzy finder for interactive prompts
  • ripgrep - Fast code search

Install on Debian/Ubuntu:

Terminal window
sudo apt update
sudo apt install ripgrep fzf

Install on Fedora/RHEL:

Terminal window
sudo dnf install ripgrep fzf

Install on Arch:

Terminal window
sudo pacman -S ripgrep fzf
Terminal window
winget install Cosine.CLI
cos --version
  1. Download the Windows build from the releases page: cos-windows-amd64.zip

  2. Extract the zip file to a location on your PATH, such as C:\Program Files\Cosine\

  3. Add to your PATH if needed:

    • Open System Properties → Advanced → Environment Variables
    • Edit the Path variable and add the directory containing cos.exe
  4. Verify installation in PowerShell or CMD:

    Terminal window
    cos --version
Terminal window
scoop bucket add cosine https://github.com/CosineAI/scoop-bucket
scoop install cos

Sign in to Cosine: https://cosine.sh/login

Then, within your terminal:

Terminal window
cos login

This will:

  1. Open your browser to the Cosine login page
  2. Ask you to sign in or create an account
  3. Redirect you back to confirm successful authentication
  4. Display a success page in your browser

If you’re not logged in or your authentication expires, the CLI will automatically show a login dialog when you start the application:

┌─────────────────────────────────────────┐
│ Login Required │
│ │
│ Press Enter to login in your browser │
│ or Esc to quit │
└─────────────────────────────────────────┘

To login:

  1. Press Enter to open the login page in your browser
  2. Complete the login flow
  3. The CLI will automatically detect successful authentication
  4. The dialog will close and you can continue working

Keyboard shortcuts:

  • Enter / y - Open browser and login
  • Esc / n / q - Close dialog and quit

When you start the CLI, it automatically verifies your authentication in the background. If your token has expired or is invalid, you’ll see the login dialog immediately - even from the home page.

This ensures you’re always prompted to re-authenticate when needed without interrupting your workflow.

The CLI supports two authentication methods:

  1. Cosine Account (default) - Use your Cosine credentials

    Terminal window
    cos login
  2. ChatGPT Subscription - Use your OpenAI subscription for direct Codex access

    Terminal window
    cos login-with-chatgpt

See Login with ChatGPT for details on using your OpenAI subscription.

Sign in to Cosine: https://cosine.sh/login

Then, within your terminal:

Terminal window
cos login

This will:

  1. Open your browser to the Cosine login page
  2. Ask you to sign in or create an account
  3. Redirect you back to confirm successful authentication
  4. Display a success page in your browser

If you’re not logged in or your authentication expires, the CLI will automatically show a login dialog when you start the application:

┌─────────────────────────────────────────┐
│ Login Required │
│ │
│ Press Enter to login in your browser │
│ or Esc to quit │
└─────────────────────────────────────────┘

To login:

  1. Press Enter to open the login page in your browser
  2. Complete the login flow
  3. The CLI will automatically detect successful authentication
  4. The dialog will close and you can continue working

Keyboard shortcuts:

  • Enter / y - Open browser and login
  • Esc / n / q - Close dialog and quit

When you start the CLI, it automatically verifies your authentication in the background. If your token has expired or is invalid, you’ll see the login dialog immediately - even from the home page.

This ensures you’re always prompted to re-authenticate when needed without interrupting your workflow.

The CLI supports two authentication methods:

  1. Cosine Account (default) - Use your Cosine credentials

    Terminal window
    cos login
  2. ChatGPT Subscription - Use your OpenAI subscription for direct Codex access

    Terminal window
    cos login-with-chatgpt

See Login with ChatGPT for details on using your OpenAI subscription.