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

# Commands

> Complete CLI command reference

# Command Reference

All examples use `npx agentlogs`. If you have the package installed globally, replace `npx agentlogs` with
`agentlogs`.

## Authentication

### login

Authenticate with an AgentLogs server.

```bash theme={null}
npx agentlogs login <hostname> [options]
```

**Arguments:**

* `hostname` - Required. AgentLogs server hostname, for example `agentlogs.ai` or `localhost:3000`

**Options:**

* `--token <token>` - OAuth access token for direct authentication. This skips the browser-based device flow.

**Examples:**

```bash theme={null}
# Log in to the hosted AgentLogs service
npx agentlogs login agentlogs.ai

# Log in to a self-hosted server
npx agentlogs login localhost:3000

# Log in non-interactively with an access token
npx agentlogs login agentlogs.ai --token "$AGENTLOGS_AUTH_TOKEN"
```

Without `--token`, the CLI starts a device authorization flow, prints a verification URL and user code, and stores the
access token locally for the selected host.

### logout

Remove stored authentication credentials.

```bash theme={null}
npx agentlogs logout [hostname]
```

**Arguments:**

* `hostname` - Optional. Hostname to log out from. When omitted, logs out from all configured hosts.

### status

Show current authentication status and account info for configured hosts.

```bash theme={null}
npx agentlogs status
```

**Output (example):**

```
🔐 AgentLogs Authentication Status

agentlogs.ai (https://agentlogs.ai)
  ✅ Logged in
  👤 Example User
  📧 user@example.com
```

***

## Upload

### upload

Interactively browse and upload transcripts from supported agents.

```bash theme={null}
npx agentlogs upload [directory] [options]
```

**Arguments:**

* `directory` - Optional. Filter discovered transcripts to sessions from this directory.

**Options:**

* `-s, --source <source>` - Filter by source. Valid values are `claude-code`, `cline`, `codex`, `opencode`, and `pi`.
* `-l, --latest` - Upload the most recent matching transcript without showing the picker.

**Examples:**

```bash theme={null}
# Interactive picker with all discovered transcripts
npx agentlogs upload

# Only show transcripts from the current directory
npx agentlogs upload .

# Only show Claude Code transcripts
npx agentlogs upload --source claude-code

# Only show Cline transcripts
npx agentlogs upload --source cline

# Upload the most recent transcript without showing the picker
npx agentlogs upload --latest

# Upload the most recent transcript from the current directory
npx agentlogs upload . --latest
```

***

## Claude Code

### claudecode sync

Upload local Claude Code transcripts that are missing or outdated on the server.

```bash theme={null}
npx agentlogs claudecode sync [claudeDir] [options]
```

**Arguments:**

* `claudeDir` - Optional. Claude data directory. Defaults to `~/.claude`.

**Options:**

* `-r, --repo <repoId>` - Only sync transcripts for the provided repository identifier.

**Examples:**

```bash theme={null}
# Sync all Claude Code transcripts from the default Claude data directory
npx agentlogs claudecode sync

# Sync all Claude Code transcripts from an explicit Claude data directory
npx agentlogs claudecode sync ~/.claude

# Sync only transcripts for a specific repository ID
npx agentlogs claudecode sync --repo github.com/myorg/myrepo
```

### claudecode upload

Upload a specific Claude Code transcript.

```bash theme={null}
npx agentlogs claudecode upload <transcript>
```

**Arguments:**

* `transcript` - Required. Path or alias for a transcript JSONL file.

### claudecode hook

Process Claude Code hook input from stdin.

```bash theme={null}
npx agentlogs claudecode hook
```

This command is intended to be called by Claude Code hooks.

***

## Codex

### codex upload

Upload a Codex transcript.

```bash theme={null}
npx agentlogs codex upload <transcript>
```

**Arguments:**

* `transcript` - Required. Path or alias for a Codex transcript JSONL file.

**Example:**

```bash theme={null}
npx agentlogs codex upload ~/.codex/sessions/2025/01/25/session-abc123.jsonl
```

### codex hook

Process Codex hook input from stdin.

```bash theme={null}
npx agentlogs codex hook
```

This command is intended to be called by Codex hooks.

### codex install

Install AgentLogs Codex hooks into `~/.codex`.

```bash theme={null}
npx agentlogs codex install
```

This command enables Codex hooks and writes AgentLogs hook entries to `~/.codex/hooks.json`. Installed hooks prefer
`AGENTLOGS_CLI_PATH` when set and otherwise run `npx -y agentlogs@latest codex hook`.

***

## OpenCode

### opencode upload

Upload an OpenCode session.

```bash theme={null}
npx agentlogs opencode upload <sessionId>
```

**Arguments:**

* `sessionId` - Required. OpenCode session ID to upload.

**Example:**

```bash theme={null}
npx agentlogs opencode upload ses_abc123def456
```

### opencode hook

Process OpenCode hook input from stdin.

```bash theme={null}
npx agentlogs opencode hook
```

This command is intended to be called by the OpenCode plugin.

***

## Cline

### cline upload

Upload a Cline task transcript.

```bash theme={null}
npx agentlogs cline upload [taskIdOrPath]
```

**Arguments:**

* `taskIdOrPath` - Optional. Cline task ID or path to a task directory/file. When omitted, the CLI lists recent tasks.

**Examples:**

```bash theme={null}
# List recent Cline task IDs
npx agentlogs cline upload

# Upload by task ID
npx agentlogs cline upload 01234567-89ab-cdef-0123-456789abcdef

# Upload by task directory or file path
npx agentlogs cline upload ~/.cline/data/tasks/01234567-89ab-cdef-0123-456789abcdef
```

### cline hook

Process Cline hook input from stdin.

```bash theme={null}
npx agentlogs cline hook
```

This command is intended to be called by Cline hooks.

### cline install

Install AgentLogs hooks into Cline's global hooks directory.

```bash theme={null}
npx agentlogs cline install
```

***

## Pi

### pi upload

Upload a Pi session transcript.

```bash theme={null}
npx agentlogs pi upload [sessionIdOrPath]
```

**Arguments:**

* `sessionIdOrPath` - Optional. Pi session ID or path to a session file. When omitted, the CLI lists recent sessions.

**Examples:**

```bash theme={null}
# List recent Pi session IDs
npx agentlogs pi upload

# Upload by session ID
npx agentlogs pi upload abc123

# Upload by session file path
npx agentlogs pi upload ~/.pi/agent/sessions/--myproject--/2025-01-25_abc123.jsonl
```

### pi hook

Process Pi hook input from stdin.

```bash theme={null}
npx agentlogs pi hook
```

Reads hook data from stdin and outputs a JSON response. This command handles:

* **tool\_call** - Intercepts git commits to add transcript links.
* **tool\_result** - Tracks commit metadata, including SHA, branch, and title.
* **agent\_end** - Uploads the transcript after each agent turn completes.
* **session\_shutdown** - Uploads the complete transcript when the session ends.

This command is intended to be called by the Pi extension, not manually.

***

## Settings

### settings

View or modify AgentLogs settings.

```bash theme={null}
npx agentlogs settings [options]
```

**Options:**

* `--allowMode <mode>` - Set capture mode. Valid values are `allowlist` and `denylist`.

**Examples:**

```bash theme={null}
# View current settings
npx agentlogs settings

# Switch to allowlist mode
npx agentlogs settings --allowMode allowlist

# Switch back to denylist mode
npx agentlogs settings --allowMode denylist
```

### allow

Allow capture for the current repository.

```bash theme={null}
npx agentlogs allow [options]
```

The repository is detected from the current working directory. Run this command from a git repository with a remote
origin configured.

**Options:**

* `--visibility <visibility>` - Set visibility. Valid values are `public`, `team`, and `private`.
* `--public` - Set visibility to `public`.
* `--team` - Set visibility to `team`.
* `--private` - Set visibility to `private`.

**Examples:**

```bash theme={null}
# Allow the current repository with the server default visibility
npx agentlogs allow

# Allow the current repository and force private visibility
npx agentlogs allow --visibility private

# Allow the current repository and force team visibility
npx agentlogs allow --team
```

### deny

Deny capture for the current repository.

```bash theme={null}
npx agentlogs deny
```

The repository is detected from the current working directory. Run this command from a git repository with a remote
origin configured.

***

## Help

Use `--help` or `-h` with any command to show its CLI help.

```bash theme={null}
# Show top-level CLI help
npx agentlogs --help

# Show help for one command
npx agentlogs upload --help

# Show help for a nested command
npx agentlogs claudecode sync --help
```


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