Getting started¶
From a fresh checkout to a first local archive: install the two commands, create the user-level config, choose a cookie channel, and walk through a first export.
Requirements¶
- Python ≥ 3.11
- uv — used to install the tools and run the test suite
- A desktop browser logged into Perplexity — the tools reuse its session cookies; no token is ever stored in the config
Cookie decryption uses browser_cookie3. Auto-detect covers Edge, Chrome, Firefox and
Safari; Brave, Chromium, Opera and Vivaldi work via --cookies-from.
1. Install¶
From the repo root:
uv tool install . # or development mode: uv tool install --editable .
This installs two commands: pplx-export (archiving) and pplx-ask (interactive
queries). Verify:
pplx-export --version
pplx-export --help # overview with examples; each subcommand has its own --help
pplx-ask --help
uvx --from . pplx-export runs a one-off command without installing.
2. Create the user-level config¶
The account registry (display name / email / user_id) and the BOT space are personal
data and are not committed to the repo; they live in an external TOML file.
Template: config.example.toml at the repo root.
mkdir -p ~/.config/pplx-export
cp config.example.toml ~/.config/pplx-export/config.toml
chmod 600 ~/.config/pplx-export/config.toml # personal data — keep it owner-only
# edit and fill in your real account values
- Create the config directory.
- Copy the template to the default path.
chmod 600— the file holds personal data; keep it owner-only.- Fill in
[accounts.<name>]— the key is the account username (as it appears in thread URLs / the library); setdisplay_name,email,user_id, and pick adefault_account. - Fill in
[bot_space]— where threads created bypplx-askare collected after completion (a real space can be created withpplx-ask space-create).
The full field reference lives in Configuration.
Load priority (highest first):
| # | Source |
|---|---|
| 1 | --config PATH |
| 2 | PPLX_EXPORT_CONFIG environment variable |
| 3 | ~/.config/pplx-export/config.toml (default) |
When the config is missing
Commands without --account run in a degraded mode — the email ownership check is
skipped with a warning (offline commands are unaffected); an explicit --account
raises an error pointing at config.example.toml. When --account is omitted,
default_account from the config is used.
3. Choose a cookie channel¶
Credentials come from your local browser's logged-in Perplexity session cookies, read
via browser_cookie3 — including multi-account token enumeration and automatic
switching. Four channels:
| Channel | How | Notes |
|---|---|---|
| Auto-detect (default) | no flag | fresh 12 h cache first, then browser stores in the order edge→chrome→firefox→safari |
| Named browser | --cookies-from <browser> |
edge / chrome / firefox / safari / brave … |
| Cookie file | --cookies /path/to/cookies.txt |
Netscape cookie file or exported JSON |
| WebBridge | --transport webbridge |
page-context fetch — the fallback channel, only used when explicitly requested |
pplx-export export <thread_url> # default: auto-detect browser store
pplx-export export <thread_url> --cookies-from edge # import from a specific browser
pplx-export export <thread_url> --cookies /path/to/cookies.txt # use a cookie file
pplx-export export <thread_url> --transport webbridge # WebBridge page context (explicit fallback)
After cookies are obtained, the tool calls /api/auth/session and prints the current
account email so you can confirm the right account is in use — watch out if --account
disagrees with the cookie account. The transport/credential design is covered in
Ask & accounts.
4. First run¶
pplx-export index --account alice # fetch the library index
pplx-export export <thread_url> # export a single thread
pplx-export batch --account alice # batch (incremental early-stop by default; --full for a full sweep)
pplx-export re-render --dry-run # offline re-render, zero network
indexfetches the account's library index — the entry point thatbatchand the other account-wide commands build on.exportarchives one thread end to end: raw API responses are persisted first (raw_*.json), then rendered to Markdown.batchsweeps the whole library. It stops early once everything remaining is already archived (incremental early-stop), writes resumable checkpoints, and accepts--fullfor a full sweep. Details: Incremental sync.re-render --dry-runproves the offline path: it regeneratesconversation.mdturns/from local raw files with zero network. Drop--dry-runto write the results. See Offline operations.
Once that works, pplx-ask ask "<prompt>" runs a streaming query and archives the
resulting thread automatically — see pplx-ask.
5. Where archives land¶
Archives are written to ./web_archive/ by default (override with --out): one
directory per thread.
| Path | Content |
|---|---|
conversation.md, turns/ |
rendered conversation |
thread.json |
thread metadata + interruptions registry |
sources.md / sources.json |
citations |
report.md |
deep-research / council / study report |
assets/ |
downloaded assets (computer mode) |
raw_*.json |
raw API responses — persisted first, so re-rendering is always possible offline |
The full directory contract: Archive layout.
Next steps¶
- Something went wrong? → Troubleshooting
- Command-by-command reference → pplx-export · pplx-ask · Maintenance commands
- The five conversation modes → Modes