{"id":13584913,"url":"https://github.com/tddschn/chatgpt-alfred-workflow","last_synced_at":"2025-04-15T11:37:32.840Z","repository":{"id":172976108,"uuid":"638957537","full_name":"tddschn/chatgpt-alfred-workflow","owner":"tddschn","description":"An Alfred workflow that supports full-text search and metadata filtering on ChatGPT chat history, conversation preview, and opening them on ChatGPT and TypingMind","archived":false,"fork":false,"pushed_at":"2024-08-08T21:51:46.000Z","size":3692,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T19:38:12.065Z","etag":null,"topics":["alfred-workflow","chatgpt","python3","typingmind"],"latest_commit_sha":null,"homepage":"https://github.com/tddschn/chatgpt-alfred-workflow","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tddschn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-10T13:10:53.000Z","updated_at":"2024-12-27T21:34:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"b57602a8-c14f-45f0-b727-ef75103e3d7d","html_url":"https://github.com/tddschn/chatgpt-alfred-workflow","commit_stats":null,"previous_names":["tddschn/chatgpt-alfred-workflow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tddschn%2Fchatgpt-alfred-workflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tddschn%2Fchatgpt-alfred-workflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tddschn%2Fchatgpt-alfred-workflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tddschn%2Fchatgpt-alfred-workflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tddschn","download_url":"https://codeload.github.com/tddschn/chatgpt-alfred-workflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249061817,"owners_count":21206568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alfred-workflow","chatgpt","python3","typingmind"],"created_at":"2024-08-01T15:04:35.976Z","updated_at":"2025-04-15T11:37:32.751Z","avatar_url":"https://github.com/tddschn.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# ChatGPT Alfred Workflow\n\n[Alfred](https://www.alfredapp.com/) Workflow that imports ChatGPT [exported](https://help.openai.com/en/articles/7260999-how-do-i-export-my-chatgpt-history-and-data) `conversations.json` file  \nand provides a [`List Filter`](https://www.alfredapp.com/help/workflows/inputs/list-filter/) that let you do [**full-text search**](#chat-history-full-text-search)  and [**metadata filtering**](#metadata-filtering) on your chat history,  \nsupports [**previewing conversations**](#preview-of-conversations--opening-on-chatgpt--typingmind) (by using QuickLook on Markdown files generated from conversations)  \nand opening them on ChatGPT or TypingMind.\n\n- [ChatGPT Alfred Workflow](#chatgpt-alfred-workflow)\n  - [Demo](#demo)\n  - [Setting Up](#setting-up)\n  - [Usage](#usage)\n    - [Chat history full text search](#chat-history-full-text-search)\n    - [Metadata filtering](#metadata-filtering)\n    - [Preview of conversations \\\u0026 Opening on ChatGPT / TypingMind](#preview-of-conversations--opening-on-chatgpt--typingmind)\n    - [Searchable Fields](#searchable-fields)\n  - [How it works](#how-it-works)\n\n## Demo\n\n\u003c!-- \u003cvideo\u003e\nhttps://github.com/tddschn/chatgpt-alfred-workflow/assets/45612704/da97397a-4813-4e16-b483-69d55e49c813\n\u003c/video\u003e --\u003e\n\n\u003c!-- ![Video](https://github.com/tddschn/chatgpt-alfred-workflow/assets/45612704/da97397a-4813-4e16-b483-69d55e49c813) --\u003e\n\nhttps://github.com/tddschn/chatgpt-alfred-workflow/assets/45612704/da97397a-4813-4e16-b483-69d55e49c813\n\n\n## Setting Up\n\nPrerequisites: Install Alfred app and buy the PowerPack.\n\n1. Clone this repository, edit `Makefile`'s first target (`update-workflow`) so that the `rsync` command syncs from the repo to your Alfred workflow directory.\n\n```bash\ngit clone https://github.com/tddschn/chatgpt-alfred-workflow.git\ncd chatgpt-alfred-workflow\n\n# edit Makefile\n\n# This workflow requires Python\u003e=3.10\npython3 -m pip install -r requirements.txt\n# generate_preview_files.py requires tqdm\n```\n\n2. Export ChatGPT chat history, make sure the downloaded zip file is saved to `~/Downloads` for automatic imports and processing.  \nSee the official guide: https://help.openai.com/en/articles/7260999-how-do-i-export-my-chatgpt-history-and-data\n\n3. Import the chat history to Alfred workflow by running `make regen-and-update-all` in the repo directory, or use the type in `cgupdate` in Alfred and press \u003ckbd\u003eEnter\u003c/kbd\u003e, as shown in below.\n\nPlease note that the path to the this repo in the `cgupdate` script is hardcoded, so if you've cloned this repo to a different directory, you'll need to edit the script in Alfred Preferences.\n\nYou can also modify the hotkeys and keywords to your liking in Alfred Preferences.\n\n![](./screenshots/cgupdate.png)\n\n## Usage\n\nUse the hotkey \u003ckbd\u003eCmd-Control-N\u003c/kbd\u003e or the keyword `cg` to see a the full list of conversations, and start typing to search.\n\n![](./screenshots/cg.png)\n\n### Chat history full text search\n\n![](./screenshots/cg-query-hyper.png)\n\n### Metadata filtering\n\nFiltering with metadata (model, model slug, creation time etc) is also supported:\n\n![](./screenshots/cg-query-gpt-4.png)\n\n### Preview of conversations \u0026 Opening on ChatGPT / TypingMind\n\nPress \u003ckbd\u003eEnter\u003c/kbd\u003e or click on the selected entry to open the conversation on ChatGPT,  \n press \u003ckbd\u003eCommand-Enter\u003c/kbd\u003e to open it on TypingMind (you'll need to import the `conversations.json` first on https://TypingMind.com),\n press \u003ckbd\u003eShift\u003c/kbd\u003e to preview the conversation in Alfred.\n\n\n### Searchable Fields\n\n```json\n  {\n    \"id\": \"9b0891b4-19be-4275-9a34-44b9fec72f5b\",\n    \"title\": \"ChatGPT Alfred Workflow Demo\",\n    \"update_time\": \"2023-05-30T18:15:50\",\n    \"create_time\": \"2023-05-30T18:15:32\",\n    \"model_slug\": \"text-davinci-002-render-sha\",\n    \"plugin_enabled\": false,\n    \"linear_messages\": [\n      \"say 'hi' and nothing more\",\n      \"hi\",\n      \"say it again\",\n      \"hi\"\n    ]\n  }\n```\n\n## How it works\n\n- Making conversations linear  \n  A conversation can have branches / forks if you've used the Edit feature in ChatGPT,  \n  and from the exported JSON, you can see that a parent message contains a list of child messages. The `convert_chatgpt_conversations_json.py` script converts the exported json by extracting the last edited messages in the forks, i.e. the messages displayed in the ChatGPT UI, and outputs them to a new json file `linear_conversations.json`.\n- Automatic discovery of exported ChatGPT `.zip` file (via filename regex matching and selecting the last-created one that matches) in `~/Downloads`,  \n  and extracting the `conversations.json` file from it to the workflow directory:  \n  handled by `update_conversations_json.py`.\n- `generate_preview_files.py` generates a Markdown file for each of your conversations from `linear_conversations.json` and saves them to `./generated`, so that you can press \u003ckbd\u003eShift\u003c/kbd\u003e to preview the conversation in Alfred.\n- [This function](https://github.com/tddschn/chatgpt-alfred-workflow/blob/77f49c98b00a0e1fc2b5eeb596608af4d655a8bc/utils.py#L58) make sure that the Alfred List Filter subtitles generated contains the user query in the middle ([example](#chat-history-full-text-search)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftddschn%2Fchatgpt-alfred-workflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftddschn%2Fchatgpt-alfred-workflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftddschn%2Fchatgpt-alfred-workflow/lists"}