Skip to content

Configuration reference

ConverterConfig is the single source of truth for all converter settings. It reads values from CLI flags, environment variables, and .env files.

Class

from chatgpt_to_markdown.config import ConverterConfig

ConverterConfig extends pydantic_settings.BaseSettings. Environment variables use the CONVERTER_ prefix and are loaded from .env if present.

Fields

input_dir

Type pathlib.Path
Default ./export
Env var CONVERTER_INPUT_DIR
CLI Positional argument INPUT_DIR

Path to the ChatGPT export. Accepts either:

  • An extracted directory containing export_manifest.json
  • A ZIP file directly (extracted to a temporary directory automatically)

output_dir

Type pathlib.Path
Default ./archive
Env var CONVERTER_OUTPUT_DIR
CLI Positional argument OUTPUT_DIR

Path where the Markdown archive is written. Created automatically if it does not exist.


redact_pii

Type bool
Default True
Env var CONVERTER_REDACT_PII
CLI --redact-pii / --no-redact-pii

When True, replaces personally identifiable information in user metadata (user.json) with [REDACTED]. Affected fields: email address, phone number, birth year.

Conversation content is not redacted — only the user profile metadata file.


include_thinking

Type bool
Default False
Env var CONVERTER_INCLUDE_THINKING
CLI --include-thinking

When True, renders thinking/reasoning blocks from o-series models (content type thoughts) into the output Markdown. When False, thinking blocks are filtered out during the filter step.


deduplicate_by_hash

Type bool
Default True
Env var CONVERTER_DEDUPLICATE_BY_HASH
CLI --deduplicate / --no-deduplicate

When True, identical media files are stored once and linked from multiple conversations. Deduplication uses SHA-256 content hashing. Reduces archive size when the same image appears in multiple conversations.


max_filename_length

Type int
Default 200
Env var CONVERTER_MAX_FILENAME_LENGTH
CLI

Maximum character length for generated output filenames. Enforced to keep filenames within cross-platform limits (FAT32, macOS HFS+, Windows NTFS).

Precedence

Configuration values are resolved in this order (highest to lowest priority):

  1. CLI flags (when running chatgpt-to-markdown directly)
  2. Environment variables (CONVERTER_*)
  3. Values in .env file
  4. Field defaults

.env file

Create a .env file in the working directory to persist settings:

CONVERTER_REDACT_PII=false
CONVERTER_INCLUDE_THINKING=true
CONVERTER_MAX_FILENAME_LENGTH=150

The .env file is loaded automatically. Never commit secrets to .env.

See also