Install & Authenticate The CLI
Install the CLI
Section titled “Install 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””Install the CLI
Section titled “Install the CLI”The CLI is distributed via multiple channels: Homebrew (recommended for macOS and Linux), direct download, and Windows package managers.
Homebrew (Recommended)
Section titled “Homebrew (Recommended)”brew install CosineAI/tap/coscos --versionDirect Download
Section titled “Direct Download”For users who prefer not to use Homebrew:
-
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
- Apple Silicon (M1/M2/M3):
-
Extract and install:
Terminal window unzip cos-darwin-arm64.zipsudo mv cos /usr/local/bin/cos --version -
(Optional) Remove quarantine attribute if prompted:
Terminal window xattr -dr com.apple.quarantine /usr/local/bin/cos
Homebrew
Section titled “Homebrew”brew install CosineAI/tap/coscos --versionDirect Download
Section titled “Direct Download”-
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
- x86_64 (most common):
-
Extract and install:
Terminal window unzip cos-linux-amd64.zipsudo mv cos /usr/local/bin/cos --version
One-line Install Script
Section titled “One-line Install Script”curl -fsSL https://cosine.sh/install | bashDependencies
Section titled “Dependencies”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:
sudo apt updatesudo apt install ripgrep fzfInstall on Fedora/RHEL:
sudo dnf install ripgrep fzfInstall on Arch:
sudo pacman -S ripgrep fzfWindows
Section titled “Windows”Winget (Recommended)
Section titled “Winget (Recommended)”winget install Cosine.CLIcos --versionDirect Download
Section titled “Direct Download”-
Download the Windows build from the releases page:
cos-windows-amd64.zip -
Extract the zip file to a location on your PATH, such as
C:\Program Files\Cosine\ -
Add to your PATH if needed:
- Open System Properties → Advanced → Environment Variables
- Edit the
Pathvariable and add the directory containingcos.exe
-
Verify installation in PowerShell or CMD:
Terminal window cos --version
Scoop (Community)
Section titled “Scoop (Community)”scoop bucket add cosine https://github.com/CosineAI/scoop-bucketscoop install cosAuthenticate the CLI
Section titled “Authenticate the CLI”First-Time Login
Section titled “First-Time Login”Sign in to Cosine: https://cosine.sh/login
Then, within your terminal:
cos loginThis will:
- Open your browser to the Cosine login page
- Ask you to sign in or create an account
- Redirect you back to confirm successful authentication
- Display a success page in your browser
In-App Login Dialog
Section titled “In-App Login Dialog”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:
- Press
Enterto open the login page in your browser - Complete the login flow
- The CLI will automatically detect successful authentication
- The dialog will close and you can continue working
Keyboard shortcuts:
Enter/y- Open browser and loginEsc/n/q- Close dialog and quit
Authentication Check
Section titled “Authentication Check”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.
Multiple Authentication Methods
Section titled “Multiple Authentication Methods”The CLI supports two authentication methods:
-
Cosine Account (default) - Use your Cosine credentials
Terminal window cos login -
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.
First-Time Login
Section titled “First-Time Login”Sign in to Cosine: https://cosine.sh/login
Then, within your terminal:
cos loginThis will:
- Open your browser to the Cosine login page
- Ask you to sign in or create an account
- Redirect you back to confirm successful authentication
- Display a success page in your browser
In-App Login Dialog
Section titled “In-App Login Dialog”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:
- Press
Enterto open the login page in your browser - Complete the login flow
- The CLI will automatically detect successful authentication
- The dialog will close and you can continue working
Keyboard shortcuts:
Enter/y- Open browser and loginEsc/n/q- Close dialog and quit
Authentication Check
Section titled “Authentication Check”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.
Multiple Authentication Methods
Section titled “Multiple Authentication Methods”The CLI supports two authentication methods:
-
Cosine Account (default) - Use your Cosine credentials
Terminal window cos login -
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.