Usage

First download your ChatGPT conversations from the OpenAI API:

  • Sign in to ChatGPT.

  • In the top right corner of the page click on your profile icon.

  • Click Settings.

  • Click Data Controls menu.

  • Under Export Data click Export.

  • In the confirmation screen click Confirm export.

  • You should receive an email with your data. Note: The link in the email expires after 24 hours

  • From the email, click the “Download data export” button to download a .zip file. The file will usually end up in your Downloads folder.

Next, run the command chatgpt-conversation-finder update-data with the path to the downloaded .zip file. Alternatively, you can omit the path and the program will present a file dialog for you to select the file. The dialog is by default initialized with the newest .zip file in your Downloads folder.

After the data has been extracted, you can search for conversations using the command chatgpt-conversation-finder gui. This will open a GUI where you can search for conversations by entering a search term in the search bar.

By clicking on a conversation in the list, it will open in your default browser.

Commands

Note

This documentation can also be obtained by running chatgpt-conversation-finder --help from the terminal window.

Or, to get help for a specific subcommand, run chatgpt-conversation-finder <subcommand> --help.

chatgpt-conversation-finder

chatgpt-conversation-finder let’s you open a ChatGPT conversation in your default web browser. It has the following sub commands:

  • create-search-index: generates a search index for the conversations.json file.

  • extract-conversations: extracts conversations from the conversations.json file.

  • edit-confg: opens the config.ini file in your default text editor.

  • grep: runs grep on the conversations.json file for a given regex.

  • gui: opens a GUI for searching conversations. Let’s you open a conversation in your default web browser.

  • open: opens a conversation with a given ID in your default web browser.

  • pretty-print: pretty prints the conversations.json file to stdout.

  • search-term: searches the conversations.json file for all conversations matching the given search term.

  • update-data: updates the conversations.json data file from a downloaded chat data file in .zip format from OpenAI website.

  • validate-conversations: validates the conversations.json file.

chatgpt-conversation-finder [OPTIONS] COMMAND [ARGS]...

Options

-v, --verbose

Show verbose output

create-search-index

chagpt-conversation-finder create-search-index generates a search index for the conversations.json file. You most likely do not need to run this command as the update-data command automatically creates the search index.

chatgpt-conversation-finder create-search-index [OPTIONS]

edit-config

chatgpt-conversation-finder edit-config lets you edit the config file

chatgpt-conversation-finder edit-config [OPTIONS]

grep

chatgpt-conversation-finder grep runs grep on the conversations.json file. Valid values for the --flags option are: IGNORECASE, MULTILINE, and DOTALL. See the Python documentation for their meaning. Multiple flags can be combined, e.g. IGNORECASE|MULTILINE. The shortcut forms I, M, and S can also be used. Further, flag names can also be given in lowercase. Examples: IGNORECASE, IGNORECASE|MULTILINE, I|M, i|m, i|s, i|s, i|s|m.

chatgpt-conversation-finder grep [OPTIONS] REGEX

Options

-f, --flags <flags>

Regex flags

Arguments

REGEX

Required argument

gui

chagpt-conversation-finder gui opens the GUI. This will open a GUI where you can search for conversations by entering a search term in the search bar. By clicking on a conversation in the list, it will open in your default browser.

chatgpt-conversation-finder gui [OPTIONS]

open

chagpt-conversation-finder open opens a conversation with a given ID in your default web browser. This is most useful after running the grep command to find a conversation. Then you will have the ID of the conversation you want to open.

chatgpt-conversation-finder open [OPTIONS] CONVERSATION_ID

Arguments

CONVERSATION_ID

Required argument

pretty-print

chagpt-conversation-finder pretty-print pretty prints the conversations.json file to stdout. This is the file that will be extracted by the update-data command.

chatgpt-conversation-finder pretty-print [OPTIONS]

search-term

Search for an exact term in the conversations or in their titles. This will print out the title, ID, and creation time of all conversations that contain the search term. The search is case-insensitive. This command has been superceded by the grep command which is more powerful.

chatgpt-conversation-finder search-term [OPTIONS] SEARCH_TERM

Arguments

SEARCH_TERM

Required argument

update-data

chagpt-conversation-finder update-data updates the conversations.json data file from a downloaded chat data file in .zip format from OpenAI website. The FILENAME is copied to the user’s data directory (as defined by the platformdirs package). Then extracts the .zip file and replaces any existing conversations.json file with the new one. If FILENAME is not provided, a dialog will open to select the file. The default directory for the download dialog is the user’s Downloads directory. If you wish, you can change the default directory by editing the config.ini file.

Args: FILENAME is the path to the .zip file containing the chat data. If not given, a dialog will open to select the file.

Example: chatgpt-conversation-finder update-data ~/Downloads/chat_data.zip

chatgpt-conversation-finder update-data [OPTIONS] [FILENAME]

Arguments

FILENAME

Optional argument

validate-conversations

chagpt-conversation-finder validate-conversations validates the conversations.json file. Currently, this only checks for conversations with no title.

chatgpt-conversation-finder validate-conversations [OPTIONS]