---
title: Command-line client
path: user-guide/command-line
status: published
---

The `scaidrive` CLI is for scripting, automation, and people who prefer a terminal. It exposes the full set of file operations, sharing, sync, and search — every API endpoint that makes sense from a shell.

## Installing

```bash
pip install scaidrive-cli
```

(Or download a single-file binary from your organization's downloads page if your team distributes one.)

Verify:

```bash
scaidrive --version
```

## Signing in

```bash
scaidrive auth login --server https://drive.example.com
```

This opens a browser tab to complete SSO. After authenticating, the CLI stores a refresh token in `~/.config/scaidrive/` (`%APPDATA%\scaidrive\` on Windows) and reuses it on subsequent calls.

Check status:

```bash
scaidrive status
```

## Common commands

### Shares

```bash
scaidrive shares list                      # list all shares you can access
```

Output is a table with share ID, name, and your role on it.

### Browsing files

```bash
scaidrive files ls engineering:/             # list root of share "engineering"
scaidrive files ls engineering:/specs -l     # long format with sizes and dates
scaidrive files ls engineering:/specs -a     # include hidden files
```

The address syntax is `<share-name>:<path>` — same shape across upload, download, share, and link commands.

### Uploading and downloading

```bash
scaidrive files upload report.pdf engineering:/reports/
scaidrive files upload -r ./build engineering:/artifacts/2026-Q2/

scaidrive files download engineering:/reports/Q1-2026.pdf
scaidrive files download -r engineering:/artifacts/2026-Q2/ ./local-copy/
```

Uploads are chunked and resumable; if your connection drops, re-running the command picks up where it left off.

### Search

```bash
scaidrive search find "deployment runbook"    # keyword (BM25) search
scaidrive search ai "how do we rotate the staging certificates"  # semantic
```

Semantic search requires your organization to have vectorization enabled.

### Sharing

```bash
# Invite a team member as a contributor
scaidrive members add engineering alice@example.com --role contributor

# List members of a share
scaidrive members list engineering

# Create an external password-protected link
scaidrive links create engineering:/reports/Q1-2026.pdf \
  --password "hunter2" --expires 2026-06-30 --download-limit 5
```

The output of `links create` includes a `url` you can share with the recipient.

### Sync (background daemon)

The CLI can run a background sync daemon that mirrors selected shares to local folders — the same engine as the desktop app, without a GUI:

```bash
scaidrive sync add engineering ~/work/engineering
scaidrive sync start          # runs in the foreground; Ctrl-C to stop
```

For long-running use, wrap it in `systemd --user` or `launchd`.

### Configuration

```bash
scaidrive config get default_share        # show current value
scaidrive config set default_share engineering
```

Defaults live in `~/.config/scaidrive/config.toml`.

## Scripting tips

- All list commands accept `--format json` for clean machine output.
- Exit code is `0` on success, non-zero on error; check it in scripts.
- The CLI never prints your access token — for automated CI pipelines, use a service-account API key (provided by your administrator) via `SCAIDRIVE_TOKEN=...` in the environment.

## What's next

- [Sharing with your team](/docs/scaidrive/user-guide/sharing-with-your-team).
- [External sharing](/docs/scaidrive/user-guide/external-sharing).