Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 16 additions & 22 deletions app/(docs)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';
import SearchButton from '@/components/SearchButton';
import { AskAITrigger } from '@/components/AskAI';
import { BookOpen, Terminal } from 'lucide-react';

export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout
tree={source.getPageTree()}
<DocsLayout
tree={source.getPageTree()}
{...baseOptions}
searchToggle={{
components: {
Expand All @@ -17,27 +18,20 @@ export default function Layout({ children }: { children: ReactNode }) {
},
}}
sidebar={{
tabs: {
transform(option, node) {
if (!node.icon) return option;
const color = `var(--${node.name?.toString().toLowerCase().replace(/[- ]/g, '-')}-color, var(--color-fd-foreground))`;

return {
...option,
icon: (
<div
className="[&_svg]:size-full rounded-lg size-full max-md:bg-[var(--tab-color)]/10 max-md:border max-md:p-1.5"
style={{
'--tab-color': color,
color: color,
} as React.CSSProperties}
>
{node.icon}
</div>
),
};
tabs: [
{
title: 'Parseable',
description: 'Docs & Guides',
url: '/docs',
icon: <BookOpen className="size-4" />,
},
},
{
title: 'pb CLI',
description: 'Command-line interface',
url: '/docs/pb-cli',
icon: <Terminal className="size-4" />,
},
],
}}
>
{children}
Expand Down
113 changes: 113 additions & 0 deletions content/docs/pb-cli/admin.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
title: "Users and Roles"
description: "Manage users and role-based access control with pb user and pb role."
---

<Callout type="info">
These commands require admin privileges on the Parseable server.
</Callout>

Parseable uses role-based access control (RBAC). Roles define what a user can do on which datasets. You create roles first, then assign them to users.

## Roles

### Create a role

```bash
pb role add <name>
```

This starts an interactive prompt where you choose a privilege level and the dataset it applies to.

**Privilege levels:**

| Privilege | Access |
|---|---|
| `reader` | Read-only access to a specific dataset |
| `writer` | Read and write access to a specific dataset |
| `ingestor` | Write-only (ingest) access to a specific dataset |
| `admin` | Full system-wide access |

```bash
pb role add log-readers
```

### List roles

<Tabs items={['Table', 'JSON']}>
<Tab value="Table">

```bash
pb role list
```

</Tab>
<Tab value="JSON">

```bash
pb role list --output json
```

</Tab>
</Tabs>

### Delete a role

```bash
pb role remove <name>
```

## Users

### Create a user

```bash
pb user add <username>
```

The server generates a password and prints it. Save it — it cannot be retrieved later.

Assign roles at creation time:

```bash
pb user add bob --role log-readers,developers
```

### List users

<Tabs items={['Table', 'JSON']}>
<Tab value="Table">

```bash
pb user list
```

</Tab>
<Tab value="JSON">

```bash
pb user list --output json
```

</Tab>
</Tabs>

### Update user roles

```bash
pb user set-role <username> <roles>
```

```bash
pb user set-role bob log-readers,admins
```

### Delete a user

```bash
pb user remove <username>
```

<Callout type="warn">
Roles must exist before they can be assigned to a user. Create roles with `pb role add` first.
</Callout>
95 changes: 95 additions & 0 deletions content/docs/pb-cli/connect.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: "Connecting to a Server"
description: "Create a profile and authenticate with your Parseable instance."
---

`pb` stores server connections as named **profiles**. A profile holds the server URL and credentials for one Parseable instance. You can have multiple profiles and switch between them, useful when working with separate staging and production deployments.

## Interactive login (recommended)

Run `pb login` to start the interactive wizard. It walks you through selecting a server type, entering your URL, choosing an authentication method, and saving the profile.

```bash
pb login
```

The wizard prompts you for:
- Server type (self-hosted or cloud)
- Server URL (e.g. `https://logs.mycompany.com`)
- Auth method — username/password or API key
- Credentials
- Profile name (defaults to `default`)

Once complete, the profile is saved and set as the active default.

## Non-interactive login

For scripts and CI pipelines, use `pb profile add` to create a profile without prompts:

```bash
pb profile add <name> <url> <username> <password>
```

With username and password:

```bash
pb profile add production https://logs.mycompany.com admin s3cr3t
```

With an API key:

```bash
pb profile add ci https://logs.mycompany.com --token myapikey
```

## Managing profiles

List and switch profiles:

```bash
pb profile list
pb profile default staging
```

Update or remove a profile:

```bash
pb profile update production https://new-url.mycompany.com
pb profile remove old-staging
```

## Check connection status

```bash
pb status
```

This validates that the active profile can reach the server and shows the server version:

```
Profile : production
URL : https://logs.mycompany.com
User : admin
Status : ✓ Connected (server v1.4.2)
```

## Logout

```bash
pb logout
```

Removes credentials from the active profile. To log out of a specific profile, switch to it first with `pb profile default <name>`, then run `pb logout`.

## Config file location

Profiles are stored in a TOML config file on disk:

| Platform | Path |
|---|---|
| macOS / Linux | `~/.config/pb/config.toml` |
| Windows | `%AppData%\pb\config.toml` |

<Callout type="info">
All commands use the active default profile automatically. Use `pb profile default <name>` to switch between servers without specifying a profile on every command.
</Callout>
78 changes: 78 additions & 0 deletions content/docs/pb-cli/datasets.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: "Dataset Management"
description: "Create, inspect, and delete datasets with pb dataset."
---

Datasets are the top-level containers for log and metrics data in Parseable. Use the `pb dataset` subcommands to manage them from the terminal.

## List datasets

<Tabs items={['Table', 'JSON']}>
<Tab value="Table">

```bash
pb dataset list
```

</Tab>
<Tab value="JSON">

```bash
pb dataset list --output json
```

</Tab>
</Tabs>

## Create a dataset

```bash
pb dataset add <name>
```

```bash
pb dataset add backend_logs
pb dataset add otel_metrics
```

Dataset names must be lowercase and contain no spaces.

## Inspect a dataset

<Tabs items={['Table', 'JSON']}>
<Tab value="Table">

```bash
pb dataset info backend_logs
```

</Tab>
<Tab value="JSON">

```bash
pb dataset info backend_logs --output json
```

</Tab>
</Tabs>

Shows:
- Event count and ingestion size
- Storage size and compression ratio
- Retention period (if configured)
- Active alerts (if any)
- Dataset type (logs or metrics)

## Delete a dataset

```bash
pb dataset remove <name>
```

```bash
pb dataset remove old_logs
```

<Callout type="warn">
Deleting a dataset removes all data it contains. This action cannot be undone.
</Callout>
Loading