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

# CLI Tool

> Command-line interface for OathNet API

## Installation

<CodeGroup>
  ```bash npm (Global) theme={null}
  npm install -g oathnet
  ```

  ```bash npx (No Install) theme={null}
  npx oathnet --help
  ```

  ```bash Go theme={null}
  go install github.com/oathnet/oathnet-go/cmd/oathnet@latest
  ```
</CodeGroup>

**Source:** npm CLI in [oathnet/oathnet-js](https://github.com/oathnet/oathnet-js); Go CLI in [oathnet/oathnet-go](https://github.com/oathnet/oathnet-go)

## Authentication

Set your API key using environment variable (recommended):

```bash theme={null}
export OATHNET_API_KEY="your-api-key"
```

Or pass it with each command:

```bash theme={null}
oathnet -k "your-api-key" search breach -q "user@example.com"
```

## Global Options

| Option                  | Description                                |
| ----------------------- | ------------------------------------------ |
| `-k, --api-key <key>`   | OathNet API key                            |
| `-f, --format <format>` | Output format: `table` (default) or `json` |
| `-h, --help`            | Display help                               |
| `-V, --version`         | Display version                            |

## Commands Overview

| Command       | Description                         |
| ------------- | ----------------------------------- |
| `search`      | Search breach and stealer databases |
| `stealer`     | V2 Stealer search commands          |
| `victims`     | V2 Victims commands                 |
| `file-search` | V2 File search commands             |
| `export`      | V2 Export commands                  |
| `osint`       | OSINT lookups                       |
| `util`        | Utility commands                    |

***

## Search Commands

### Breach Search

```bash theme={null}
oathnet search breach -q "user@example.com"

# With database filter
oathnet search breach -q "user@example.com" --dbnames "linkedin_2012"

# Save to file
oathnet search breach -q "user@example.com" -o results.json

# JSON output
oathnet search breach -q "user@example.com" -f json
```

### Stealer Search

```bash theme={null}
oathnet search stealer -q "user@example.com"
```

### Initialize Session

```bash theme={null}
oathnet search init -q "user@example.com"
```

***

## V2 Stealer Commands

### Search

```bash theme={null}
# Basic search
oathnet stealer search -q "user@example.com"

# With domain filter
oathnet stealer search -q "user@example.com" --domain "google.com"

# Only results with log IDs
oathnet stealer search -q "user@example.com" --has-log-id

# Wildcard search
oathnet stealer search -q "user@example.com" --wildcard

# Custom page size
oathnet stealer search -q "user@example.com" --page-size 50

# Auto file-search on results
oathnet stealer search -q "user@example.com" --file-search "password" --file-search-mode literal
```

### Subdomain Extraction

```bash theme={null}
oathnet stealer subdomain -d "example.com"
```

***

## V2 Victims Commands

### Search Victims

```bash theme={null}
# Basic search
oathnet victims search -q "user@example.com"

# With email filter
oathnet victims search --email "user@example.com"

# With IP filter
oathnet victims search --ip "192.168.1.1"

# With Discord ID
oathnet victims search --discord-id "123456789012345678"

# Wildcard mode
oathnet victims search -q "user@example" --wildcard

# Auto file-search on results
oathnet victims search -q "user@example.com" --file-search "password"
```

### Get Manifest

```bash theme={null}
oathnet victims manifest <log_id>
```

### Download Archive

```bash theme={null}
oathnet victims archive <log_id> -o ./victim_archive.zip
```

***

## V2 File Search Commands

### Create Job

```bash theme={null}
# Literal search
oathnet file-search create -e "password"

# Regex search
oathnet file-search create -e "pass.*word" --mode regex

# Wildcard search
oathnet file-search create -e "pass*" --mode wildcard
```

### Check Status

```bash theme={null}
oathnet file-search status <job_id>
```

### Search and Wait

```bash theme={null}
# Create job and wait for results
oathnet file-search search -e "password" --mode literal

# With timeout
oathnet file-search search -e "password" --timeout 300000
```

***

## V2 Export Commands

### Create Export

```bash theme={null}
# Export stealer data
oathnet export create --type stealer --format jsonl --limit 1000

# Export victims data
oathnet export create --type victims --format csv

# With search query
oathnet export create --type stealer -q "example.com"
```

### Check Status

```bash theme={null}
oathnet export status <job_id>
```

### Download Export

```bash theme={null}
oathnet export download <job_id> -o ./export.jsonl
```

### Create, Wait, and Download

```bash theme={null}
oathnet export run --type stealer -o ./export.jsonl --limit 1000
```

***

## OSINT Commands

### IP Info

```bash theme={null}
oathnet osint ip 8.8.8.8
```

### Steam Profile

```bash theme={null}
oathnet osint steam 76561198012345678
```

### Xbox Profile

```bash theme={null}
oathnet osint xbox "GamerTag123"
```

### Discord Lookups

```bash theme={null}
# User info
oathnet osint discord user 123456789012345678

# Username history
oathnet osint discord history 123456789012345678
```

### Roblox User Info

```bash theme={null}
# By user ID
oathnet osint roblox --user-id 123456789

# By username
oathnet osint roblox --username "PlayerName"
```

### Holehe (Email Account Detection)

```bash theme={null}
oathnet osint holehe user@example.com
```

### GHunt (Google Account)

```bash theme={null}
oathnet osint ghunt user@gmail.com
```

### Subdomain Extraction

```bash theme={null}
# All subdomains
oathnet osint subdomain example.com

# Only alive subdomains
oathnet osint subdomain example.com --alive
```

### Minecraft History

```bash theme={null}
oathnet osint minecraft PlayerName
```

***

## Utility Commands

### Database Name Autocomplete

```bash theme={null}
oathnet util dbnames -q "link"
```

***

## Output Formats

### Table Format (Default)

```bash theme={null}
oathnet search breach -q "user@example.com"
```

```
Found 15 results (showing 15)

━━━ Result 1 ━━━
  email: user@example.com
  password: mypassword123
  dbname: linkedin_2012
  ...

━━━ Result 2 ━━━
  ...
```

### JSON Format

```bash theme={null}
oathnet search breach -q "user@example.com" -f json
```

<Note>
  This is CLI output shape, not the raw HTTP response body.
</Note>

```json theme={null}
{
  "success": true,
  "data": {
    "results_found": 15,
    "results_shown": 15,
    "results": [...]
  }
}
```

***

## Examples

### Complete Workflow: Find Credentials and Search Files

```bash theme={null}
# 1. Search for stealer data with log IDs
oathnet stealer search -q "user@example.com" --has-log-id

# Output shows:
# ═══ LOG IDs (use with file-search/victims) ═══
#   abc123def456
#   xyz789ghi012

# 2. Search within those logs for passwords
oathnet file-search search -e "password" --mode literal

# 3. Get the victim manifest
oathnet victims manifest abc123def456

# 4. Download the full archive
oathnet victims archive abc123def456 -o ./victim.zip
```

### Export Large Dataset

```bash theme={null}
# Create and download export in one command
oathnet export run --type stealer -q "@company.com" --limit 10000 -o ./company_export.jsonl
```

### OSINT Investigation

```bash theme={null}
# Check IP reputation
oathnet osint ip 185.220.101.1

# Look up Discord user
oathnet osint discord user 123456789012345678

# Check email on various services
oathnet osint holehe target@email.com
```

### Bulk Processing

```bash theme={null}
# Create a file with emails (one per line)
cat > emails.txt << EOF
user1@example.com
user2@example.com
user3@example.com
EOF

# Process with xargs
cat emails.txt | xargs -I {} oathnet search breach -q "{}" -f json >> all_results.json
```

***

## Tips

### Pretty Print JSON

```bash theme={null}
oathnet search breach -q "user@example.com" -f json | jq .
```

### Save Results with Timestamp

```bash theme={null}
oathnet stealer search -q "user@example.com" -o "results_$(date +%Y%m%d_%H%M%S).json"
```

### Use in Scripts

```bash theme={null}
#!/bin/bash
export OATHNET_API_KEY="your-api-key"

result=$(oathnet search breach -q "$1" -f json)
count=$(echo "$result" | jq '.data.results_found')
echo "Found $count results for $1"
```

### Environment Variables

```bash theme={null}
# Set API key
export OATHNET_API_KEY="your-api-key"
```

<CardGroup cols={2}>
  <Card title="cURL Examples" icon="code" href="/sdks/curl">
    Next: cURL examples
  </Card>

  <Card title="Go SDK" icon="golang" href="/sdks/go">
    Previous: Go SDK
  </Card>
</CardGroup>
