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

# Quick Start

> Choose the right Rehydra product for your workflow

Rehydra ships as three product surfaces: the SDK for application code, the CLI for terminal workflows, and the OpenCode plugin for agent privacy. Start with the one that matches how you work.

## Choose Your Starting Point

<CardGroup cols={3}>
  <Card title="SDK" icon="code" href="/installation">
    Add Rehydra to your app and control anonymization in code.
  </Card>

  <Card title="CLI Tool" icon="terminal" href="/guides/cli">
    Protect files and piped text from the terminal.
  </Card>

  <Card title="OpenCode Plugin" icon="shield" href="/guides/opencode-plugin">
    Scrub secrets before OpenCode sends them to an LLM.
  </Card>
</CardGroup>

## SDK

Use the SDK when you are building a product or integrating privacy into an existing system.

<CodeGroup>
  ```bash npm theme={null}
  npm install rehydra
  ```

  ```bash bun theme={null}
  bun add rehydra onnxruntime-web
  ```

  ```bash pnpm theme={null}
  pnpm add rehydra
  ```
</CodeGroup>

```typescript theme={null}
import { anonymizeRegexOnly } from 'rehydra';

const result = await anonymizeRegexOnly('Contact john@example.com');

console.log(result.anonymizedText);
// "Contact <PII type=\"EMAIL\" id=\"1\"/>"
```

Best for:

* Server-side apps and backend services
* Browser-based privacy workflows
* Agent, proxy, or streaming integrations
* Teams that need fine-grained control over detection and rehydration

## CLI Tool

Use the CLI when you want to protect text quickly without writing application code.

<CodeGroup>
  ```bash npm theme={null}
  npm install -g @rehydra/cli
  ```

  ```bash bun theme={null}
  bun add -g @rehydra/cli
  ```

  ```bash pnpm theme={null}
  pnpm add -g @rehydra/cli
  ```
</CodeGroup>

```bash theme={null}
rehydra anonymize input.txt -o output.txt
```

Best for:

* Local document processing
* Shell scripts and automation
* Inspecting sensitive text before sharing it
* Teams that want a no-code entry point

## OpenCode Plugin

Use the OpenCode plugin when your coding agent should never send raw secrets to an LLM provider.

<CodeGroup>
  ```bash npm theme={null}
  npm install @rehydra/opencode
  ```

  ```bash bun theme={null}
  bun add @rehydra/opencode
  ```

  ```bash pnpm theme={null}
  pnpm add @rehydra/opencode
  ```
</CodeGroup>

```json theme={null}
{
  "plugin": ["@rehydra/opencode"]
}
```

Best for:

* OpenCode-based agent workflows
* Repositories with sensitive `.env` files
* Local development environments using AI assistants
* Teams adding privacy guardrails to coding agents

## Shared Model

All three product surfaces follow the same core pattern:

<Steps>
  <Step title="Detect">
    Sensitive values are identified locally.
  </Step>

  <Step title="Protect">
    Originals are replaced with safe placeholders.
  </Step>

  <Step title="Restore">
    Original values can be rehydrated locally when needed.
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    View environment-specific install details for the SDK.
  </Card>

  <Card title="CLI Guide" icon="terminal" href="/guides/cli">
    Explore commands, options, and examples.
  </Card>

  <Card title="OpenCode Plugin Guide" icon="shield" href="/guides/opencode-plugin">
    Configure secret scrubbing for OpenCode.
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Dive into the SDK APIs and advanced features.
  </Card>
</CardGroup>
