Skip to content

Configure the converter

The converter accepts configuration from three sources, in order of precedence:

  1. CLI flags — highest priority, override everything else
  2. Environment variablesCONVERTER_ prefix, loaded from .env or the shell
  3. Defaults — sensible defaults defined in ConverterConfig

CLI flags

Pass flags directly on the command line:

uv run chatgpt-to-markdown ./export ./archive --no-redact-pii --include-thinking

See the CLI reference for the full flag list.

Environment variables

Set any ConverterConfig field via an environment variable with the CONVERTER_ prefix:

export CONVERTER_REDACT_PII=false
export CONVERTER_INCLUDE_THINKING=true
uv run chatgpt-to-markdown ./export ./archive

Or create a .env file in the project root (never commit secrets):

CONVERTER_REDACT_PII=false
CONVERTER_INCLUDE_THINKING=false
CONVERTER_DEDUPLICATE_BY_HASH=true
CONVERTER_MAX_FILENAME_LENGTH=200

The converter loads .env automatically on startup.

Configuration reference

Field Env var CLI flag Default Description
input_dir CONVERTER_INPUT_DIR positional ./export Path to export directory or ZIP
output_dir CONVERTER_OUTPUT_DIR positional ./archive Path to output directory
redact_pii CONVERTER_REDACT_PII --redact-pii / --no-redact-pii true Redact email, phone, birth year
include_thinking CONVERTER_INCLUDE_THINKING --include-thinking false Include thinking/reasoning blocks
deduplicate_by_hash CONVERTER_DEDUPLICATE_BY_HASH --deduplicate / --no-deduplicate true SHA-256 dedup for media
max_filename_length CONVERTER_MAX_FILENAME_LENGTH 200 Maximum output filename length

Common configurations

Archive with full metadata (no redaction)

CONVERTER_REDACT_PII=false

Include o-series thinking blocks

CONVERTER_INCLUDE_THINKING=true

Disable deduplication

Keep all files as separate copies:

CONVERTER_DEDUPLICATE_BY_HASH=false

Next steps