> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sessionbase.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install and set up the SessionBase CLI

## Prerequisites

* **Node.js 18+**: The CLI requires Node.js version 18 or higher
* **npm**: Comes bundled with Node.js
* **AI Agent Platform**: One or more of:
  * [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
  * [Gemini CLI](https://github.com/google-gemini/gemini-cli)
  * [Amazon Q Chat](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html)
  * [OpenAI Codex CLI](https://developers.openai.com/codex/cli)

## Install the CLI

### Global Installation (Recommended)

Install the SessionBase CLI globally to access it from anywhere:

```bash theme={null}
npm install -g @sessionbase/cli
```

This provides two commands:

* `sessionbase` - Main CLI interface
* `sessionbase-mcp` - MCP server for AI platforms

### Verify Installation

Confirm the installation was successful:

```bash theme={null}
sessionbase --version
sessionbase --help
```

`sb` - Shortcut for `sessionbase`

## Authentication

After installation, authenticate using:

```bash theme={null}
sessionbase login
```

This will:

1. Open your browser to the SessionBase login page
2. Allow you to sign in with GitHub or Google
3. Provide an authentication token to copy into your terminal

### Manual Token Authentication

If you are already logged in to SessionBase in your browser, you can access your authentication token at [https://www.sessionbase.ai/settings](https://www.sessionbase.ai/settings) and provide the token directly:

```bash theme={null}
sessionbase login --token YOUR_TOKEN_HERE
```

## Verify Authentication

Check that you're logged in successfully:

```bash theme={null}
sessionbase whoami
```

This displays your username and authentication status.

## Next Steps

The SessionBase CLI is intended for consumption by AI agents via the SessionBase MCP server. While you can use the CLI directly, we recommend using the SessionBase MCP server directly from your AI agent of choice. This allows you to push sessions with rich contextual descriptions directly from Claude Code, Gemini CLI, Q Chat, or Codex CLI without breaking your workflow.

See our [MCP Server guide](/mcp-server/installation) for MCP installation instructions.

### Power User Tips

If you prefer to use the CLI, use the `sb` alias for faster typing:

```bash theme={null}
sb push --claude --title "Debug Session"
sb list --global
```

You can also use SessionBase CLI commands directly from within some AI chat agents using the `!` operator (supported by Claude Code, Gemini CLI, and Amazon Q Chat):

```bash theme={null}
# Push current session from within Claude Code
!sb push --claude --title "Current debugging session"

# List recent sessions
!sb list --claude

# Check authentication status
!sb whoami
```

This allows you to push sessions without leaving your AI conversation, even if you haven't set up the MCP server.
