archivebox.cli.archivebox_persona

archivebox persona [args…] [–filters]

Manage Persona records (browser profiles for archiving).

Actions: create - Create Personas list - List Personas as JSONL (with optional filters) update - Update Personas from stdin JSONL delete - Delete Personas from stdin JSONL

Examples: # Create a new persona archivebox persona create work archivebox persona create –import=chrome personal archivebox persona create –import=edge work

# List all personas
archivebox persona list

# Delete a persona
archivebox persona list --name=old | archivebox persona delete --yes

Module Contents

Functions

get_chrome_user_data_dir

Get the default Chrome user data directory for the current platform.

get_brave_user_data_dir

Get the default Brave user data directory for the current platform.

get_edge_user_data_dir

Get the default Edge user data directory for the current platform.

get_browser_binary

_parse_netscape_cookies

_write_netscape_cookies

_merge_netscape_cookies

extract_cookies_via_cdp

Launch Chrome with the given user data dir and extract cookies via CDP.

validate_persona_name

Validate persona name to prevent path traversal attacks.

ensure_path_within_personas_dir

Verify that a persona path is within PERSONAS_DIR.

create_personas

Create Personas from names.

list_personas

List Personas as JSONL with optional filters.

update_personas

Update Personas from stdin JSONL.

delete_personas

Delete Personas from stdin JSONL.

main

Manage Persona records (browser profiles).

create_cmd

Create Personas, optionally importing from a browser profile.

list_cmd

List Personas as JSONL.

update_cmd

Update Personas from stdin JSONL.

delete_cmd

Delete Personas from stdin JSONL.

Data

__command__

BROWSER_PROFILE_FINDERS

CHROMIUM_BROWSERS

NETSCAPE_COOKIE_HEADER

API

archivebox.cli.archivebox_persona.__command__[source]

‘archivebox persona’

archivebox.cli.archivebox_persona.get_chrome_user_data_dir() pathlib.Path | None[source]

Get the default Chrome user data directory for the current platform.

archivebox.cli.archivebox_persona.get_brave_user_data_dir() pathlib.Path | None[source]

Get the default Brave user data directory for the current platform.

archivebox.cli.archivebox_persona.get_edge_user_data_dir() pathlib.Path | None[source]

Get the default Edge user data directory for the current platform.

archivebox.cli.archivebox_persona.get_browser_binary(browser: str) str | None[source]
archivebox.cli.archivebox_persona.BROWSER_PROFILE_FINDERS[source]

None

archivebox.cli.archivebox_persona.CHROMIUM_BROWSERS[source]

None

[’# Netscape HTTP Cookie File’, ‘# https://curl.se/docs/http-cookies.html’, ‘# This file was generat…

archivebox.cli.archivebox_persona._parse_netscape_cookies(path: pathlib.Path) OrderedDict[tuple[str, str, str], tuple[str, str, str, str, str, str, str]][source]
archivebox.cli.archivebox_persona._write_netscape_cookies(path: pathlib.Path, cookies: OrderedDict[tuple[str, str, str], tuple[str, str, str, str, str, str, str]]) None[source]
archivebox.cli.archivebox_persona._merge_netscape_cookies(existing_file: pathlib.Path, new_file: pathlib.Path) None[source]
archivebox.cli.archivebox_persona.extract_cookies_via_cdp(user_data_dir: pathlib.Path, output_file: pathlib.Path, profile_dir: str | None = None, chrome_binary: str | None = None) bool[source]

Launch Chrome with the given user data dir and extract cookies via CDP.

Returns True if successful, False otherwise.

archivebox.cli.archivebox_persona.validate_persona_name(name: str) tuple[bool, str][source]

Validate persona name to prevent path traversal attacks.

Returns: (is_valid, error_message): tuple indicating if name is valid

archivebox.cli.archivebox_persona.ensure_path_within_personas_dir(persona_path: pathlib.Path) bool[source]

Verify that a persona path is within PERSONAS_DIR.

This is a safety check to prevent path traversal attacks where a malicious persona name could cause operations on paths outside the expected PERSONAS_DIR.

Returns: True if path is safe, False otherwise

archivebox.cli.archivebox_persona.create_personas(names: collections.abc.Iterable[str], import_from: str | None = None, profile: str | None = None) int[source]

Create Personas from names.

If –import is specified, copy the browser profile to the persona directory and extract cookies.

Exit codes: 0: Success 1: Failure

archivebox.cli.archivebox_persona.list_personas(name: str | None = None, name__icontains: str | None = None, limit: int | None = None) int[source]

List Personas as JSONL with optional filters.

Exit codes: 0: Success (even if no results)

archivebox.cli.archivebox_persona.update_personas(name: str | None = None) int[source]

Update Personas from stdin JSONL.

Reads Persona records from stdin and applies updates. Uses PATCH semantics - only specified fields are updated.

Exit codes: 0: Success 1: No input or error

archivebox.cli.archivebox_persona.delete_personas(yes: bool = False, dry_run: bool = False) int[source]

Delete Personas from stdin JSONL.

Requires –yes flag to confirm deletion.

Exit codes: 0: Success 1: No input or missing –yes flag

archivebox.cli.archivebox_persona.main()[source]

Manage Persona records (browser profiles).

archivebox.cli.archivebox_persona.create_cmd(names: tuple, import_from: str | None, profile: str | None)[source]

Create Personas, optionally importing from a browser profile.

archivebox.cli.archivebox_persona.list_cmd(name: str | None, name__icontains: str | None, limit: int | None)[source]

List Personas as JSONL.

archivebox.cli.archivebox_persona.update_cmd(name: str | None)[source]

Update Personas from stdin JSONL.

archivebox.cli.archivebox_persona.delete_cmd(yes: bool, dry_run: bool)[source]

Delete Personas from stdin JSONL.