{"id":28447561,"url":"https://github.com/expelledboy/chatgpt-zod-schema","last_synced_at":"2026-04-20T10:05:40.876Z","repository":{"id":296857378,"uuid":"994696874","full_name":"expelledboy/chatgpt-zod-schema","owner":"expelledboy","description":"A community-driven effort to define and maintain a comprehensive Zod schema for ChatGPT conversation exports","archived":false,"fork":false,"pushed_at":"2025-06-02T12:48:21.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-03T01:35:54.874Z","etag":null,"topics":["chatgpt","chatgpt-export","data-validator","json","openai","schema","typescript","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/expelledboy.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,"zenodo":null}},"created_at":"2025-06-02T10:45:25.000Z","updated_at":"2025-06-02T12:54:11.000Z","dependencies_parsed_at":"2025-06-03T01:36:02.928Z","dependency_job_id":"89552440-7b57-4877-a1e0-5fe39942eb9c","html_url":"https://github.com/expelledboy/chatgpt-zod-schema","commit_stats":null,"previous_names":["expelledboy/chatgpt-zod-schema"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/expelledboy/chatgpt-zod-schema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expelledboy%2Fchatgpt-zod-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expelledboy%2Fchatgpt-zod-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expelledboy%2Fchatgpt-zod-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expelledboy%2Fchatgpt-zod-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/expelledboy","download_url":"https://codeload.github.com/expelledboy/chatgpt-zod-schema/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expelledboy%2Fchatgpt-zod-schema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32042309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chatgpt","chatgpt-export","data-validator","json","openai","schema","typescript","zod"],"created_at":"2025-06-06T12:06:00.538Z","updated_at":"2026-04-20T10:05:40.871Z","avatar_url":"https://github.com/expelledboy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatGPT Zod Schema\n\nThis project provides Zod schemas for validating ChatGPT conversation exports. The goal is to collaboratively build a comprehensive schema for type-safe data handling.\n\n## How to Contribute\n\nHelp us improve the schema by testing it with your ChatGPT export.\n\n### 1. Get Your ChatGPT Export\n\n1.  In ChatGPT: `Settings` \u003e `Data controls` \u003e `Export data`.\n2.  Download the `.zip` file from the email and extract `conversations.json`.\n\n### 2. Set Up the Project\n\n```bash\n# Install bun (if you haven't already)\ncurl -fsSL https://bun.sh/install | bash\n\n# Install dependencies\nbun install\n\n# Install just (if you haven't already)\n# See https://just.systems/man/en/chapter_4.html for installation instructions\n# e.g. on macOS:\nbrew install just\n```\n\nAlternatively, if you use Nix and direnv:\n```bash\ndirenv allow . # uses flake.nix\n```\n\n### 3. Configure Your Data File\n\nThe application reads the path to your `conversations.json` file from the `CHATGPT_CONVERSATION_FILE` environment variable.\n\n1.  Place your `conversations.json` file in the project (e.g., in the root directory or a `data/` subdirectory).\n2.  Set the `CHATGPT_CONVERSATION_FILE` environment variable to point to this file.\n    You can do this by creating a `.env` file in the project root with the following content:\n    ```env\n    CHATGPT_CONVERSATION_FILE=./path/to/your/conversations.json\n    ```\n    If you use `direnv`, it will automatically load this `.env` file (as configured in `.envrc`).\n    The `src/data.ts` script will fall back to `./data/chatgpt-export/conversations.json` if the environment variable is not set.\n\n### 4. Run Tests\n\nExecute the tests to validate your data against the schema:\n```bash\njust test\n```\n\n### 5. Improve the Schema\n\nIf tests fail:\n1.  Examine the Zod validation errors in the test output (they show the problematic `path` and `message`).\n2.  Update the Zod schemas in `src/schema.ts` to accommodate your data structure (e.g., add missing fields, mark fields as optional, adjust types).\n3.  Re-run `just test` until all tests pass.\n\n### 6. (Optional) Analyze Data Structure\n\nTo understand the structure of your export, run the analysis script:\n```bash\njust analysis\n```\nThis script identifies unique object shapes in your data, which can help in refining or adding new schemas.\n\n### 7. Share Your Improvements\n\nOpen a Pull Request with your changes to `src/schema.ts`.\n\n## Project Structure\n\n*   `README.md`: This file.\n*   `justfile`: Task definitions for `just`.\n*   `flake.nix`, `.envrc`: For Nix and direnv based environment setup.\n*   `src/`:\n    *   `schema.ts`: **The Zod schema definitions (the main file you'll edit).**\n    *   `schema.test.ts`: Tests for the schemas.\n    *   `analysis.ts`: Script for data structure analysis.\n    *   `data.ts`: Loads your `conversations.json` based on the `CHATGPT_CONVERSATION_FILE` environment variable.\n*   `conversations.json`: (You provide this) Your exported ChatGPT data.\n\n---\n\nLet's build the most accurate Zod schema for ChatGPT exports together!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpelledboy%2Fchatgpt-zod-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpelledboy%2Fchatgpt-zod-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpelledboy%2Fchatgpt-zod-schema/lists"}