# Install the Glass CLI

Glass brings hosted single-cell RNA-seq data to your terminal and coding agent.
Search public datasets, explore gene expression, inspect cell types, and compare cell populations.

This guide is for an agent or a person. Use the public Glass Bio deployment at `https://demo.glass.bio`.
For dev, use the installation command at `https://dev.glass.bio/toolkit` and its linked skill.
Keep the installer, API address, and skill on the same deployment.
The CLI requires Python 3.11 or later, Bash, and curl on macOS or Linux.

## 1. Install

Run these commands in the terminal:

```sh
curl -fsSL https://demo.glass.bio/api/scripts/install-glass.sh | bash -s -- --api-base https://demo.glass.bio/api/v1
export PATH="$HOME/.local/bin:$PATH"
glass --version
```

The installer puts `glass` in `~/.local/bin` and its Python environment in `~/.local/share/glassbio/cli`.
It saves the API address in the local Glass configuration.
Add `~/.local/bin` to your shell's PATH for future terminal sessions.

## 2. Give your agent the Glass skill

Read the current command guide:

```sh
curl -fsSL https://demo.glass.bio/api/scripts/glass-skill.md
```

Use this guide for Glass commands in the current conversation.
If your agent supports skills, save the guide as `glass-toolkit/SKILL.md` in its user skills directory.
Use the skill installation instructions for your agent. New agent sessions load the installed skill.
The CLI works directly in a terminal, including Codex CLI and Claude Code. A desktop app is not required.

## 3. Sign in

Catalog searches and dataset commands require sign-in, including searches of public datasets.
Public Astral reads work without sign-in. For example:

```sh
glass astral schema --organism human --json
glass astral rows --organism human --genes INS GCG --output expression.parquet
```

For an agent, run:

```sh
glass auth login --no-browser
```

Show the user the sign-in URL and confirmation code that the command prints.
Ask the user to open the URL, sign in, and approve the matching code.
Keep the command alive while the user completes sign-in. It waits for approval and saves the session locally.
Wait for that process to finish before running authenticated commands.
If the code expires, run the login command again for a new URL and code.
Keep passwords, access tokens, refresh tokens, and saved session files private.

For a person in a terminal, run `glass auth login`. This command opens the sign-in page in your browser.

After sign-in, check the connection:

```sh
glass status --json
```

Report the signed-in account and API address to the user.

## 4. Start with a search

```sh
glass search datasets --query "lung fibrosis" --organism Homo_sapiens --json
```

Or ask your agent: "Find public human lung fibrosis datasets on Glass Bio."

Use `glass --help` or `glass COMMAND --help` for command details.
The [CLI reference](https://demo.glass.bio/toolkit) lists more examples.
Commands use the signed-in account's permissions. Uploads, annotations, subsets, and merges can start paid jobs.
Get the user's agreement before those jobs. Dataset deletion requires explicit confirmation.
