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

> ## Agent Instructions
> Hosted remote MCP endpoint: https://api.zerodrive.dev/mcp (OAuth 2.0 PKCE or Bearer token).
> REST API base URL: https://api.zerodrive.dev with OpenAPI 3.1.0 specification at https://api.zerodrive.dev/openapi.json.
> S3-compatible gateway: https://api.zerodrive.dev/s3 (AWS Signature V4, region auto).
> Local command-line tool: zd (or zerodrive) and local stdio MCP server: zerodrive mcp.
> Token prefixes: zdk_ (Personal API Key), zdt_ (device session token), zda_ (OAuth access token), zdr_ (OAuth refresh token), zdx_ (temporary sandbox key). Never paste real keys into prompts or code.
> Be honest about platform boundaries: cloud files require internet access, files are encrypted at rest and in transit by Cloudflare rather than end-to-end encrypted, ZeroDrive is not a replacement for an independent backup, Windows 11 support is an unsigned x64 beta, and the 7-day Pro free trial requires a card and charges automatically when it ends.

# Get Started with the zd CLI

> Install the zd command-line tool, sign in from Terminal, and upload, find, and read files fast.

Use **`zd`** in Terminal to upload folders, read exact slices of big files, search Knowledge Brain, and automate drive workflows cleanly.

***

## Install and sign in

On Mac, ZeroDrive sets up `zd` for you automatically.

1. Open ZeroDrive Studio, go to **Settings**, and click **Install `zd` CLI**.
2. Because you already signed into `ZeroDrive.app`, `zd` automatically uses your macOS Keychain login.
3. On Linux or headless setups, run `zd login` to sign in via browser (or pass a token file with `ZERODRIVE_TOKEN_FILE`).

Verify your setup anytime.

```bash theme={null}
zd version --json
zd doctor
```

***

## Upload, find, and read your first file

```bash theme={null}
# List your top-level folders
zd tree --depth 2

# Upload a local folder safely into the cloud
zd cp ./specs "Projects/Specs/"

# Search inside your files or ask Knowledge Brain
zd grep "launch date" Projects/
zd query "Summarize our active project specs" --mode research

# Read lines 1 to 40 of a large file without downloading all of it
zd cat Projects/Specs/roadmap.md --lines 1-40
```

***

## How `zd` tells local paths from cloud paths

| What you type | Target | Example |
| :- | :- | :- |
| `vault:<path>` or `zd://<path>` | **Cloud** | Always points into your active cloud drive. |
| `~/ZeroDrive/My Drive/<subpath>` | **Cloud** | Maps straight to the cloud object. |
| `~/...`, `./...`, `../...`, `/Users/...`, `/tmp/...` | **Local** | Local file or folder on disk. |
| Bare path (`Docs/spec.md`) | **Auto** | Search and read commands check **Cloud**. `cp` and `mv` use **Local** if found on disk. |

***

## Helpful flags and exit codes

* `--profile NAME` (or `ZD_PROFILE`) switches between saved accounts
* `--no-color` turns off colors in CI scripts
* `--json` prints clean JSON output
* Exit codes are `0` for success, `1` for transfer or API error, and `2` for invalid flags

***

## Next steps

> [card] [File & Transfer Commands](https://docs.zerodrive.dev/sdks-and-cli/cli-files-and-transfers.md)
>
> See every command for ls, tree, cat, cp, mv, share, and duplicates.

> [card] [Brain, Routine & Node Commands](https://docs.zerodrive.dev/sdks-and-cli/cli-brain-and-agents.md)
>
> Explore commands for Knowledge Brain, transcription, branches, and nodes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.