{"id":23055603,"url":"https://github.com/vlazic/gpt-project-context","last_synced_at":"2025-08-15T05:32:19.867Z","repository":{"id":158168368,"uuid":"633793520","full_name":"vlazic/gpt-project-context","owner":"vlazic","description":"Easily provide project context to ChatGPT and boost your productivity with this CLI tool! Scan project files, generate output, and copy it on ChatGPT.","archived":false,"fork":false,"pushed_at":"2023-07-12T11:44:20.000Z","size":47,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-12T23:46:26.348Z","etag":null,"topics":["chatgpt","chatgpt4","cli","developer-tools","gpt","gpt3","gpt4","openai","productivity"],"latest_commit_sha":null,"homepage":"","language":"Go","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/vlazic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-04-28T09:40:03.000Z","updated_at":"2024-08-30T19:12:28.000Z","dependencies_parsed_at":"2023-07-27T18:15:53.183Z","dependency_job_id":null,"html_url":"https://github.com/vlazic/gpt-project-context","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlazic%2Fgpt-project-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlazic%2Fgpt-project-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlazic%2Fgpt-project-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlazic%2Fgpt-project-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vlazic","download_url":"https://codeload.github.com/vlazic/gpt-project-context/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229893881,"owners_count":18140620,"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":["chatgpt","chatgpt4","cli","developer-tools","gpt","gpt3","gpt4","openai","productivity"],"created_at":"2024-12-16T01:12:45.101Z","updated_at":"2024-12-16T01:12:45.611Z","avatar_url":"https://github.com/vlazic.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPT Project Context\n\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/vlazic/gpt-project-context)\n\n`gpt-project-context` is a command-line tool that allows you to swiftly copy the content of specific project files to your clipboard. This content can then be easily pasted into the ChatGPT interface as an initial prompt, providing more accurate and targeted assistance from ChatGPT.\n\nThis control enables you to create precise prompts and obtain accurate assistance from ChatGPT, surpassing the capabilities of Github Copilot.\n\n## Usage\n\n### Typicall workflow\n\nMy typical workflow with this tool involves the following steps:\n\n1. To obtain a list of files for a specific project, I run the command `gpt-project-context -i '**/*.js,README.md,package.json' -e '**/node_modules/**,**/dist/**'` (for a JavaScript project, for example). This command selects the desired files based on the specified patterns and copies their content to the clipboard.\n\n2. Next, I paste the copied content as the first message in ChatGPT or OpenAI Playground. This sets the initial context for the conversation, providing relevant information about the project to assist ChatGPT in generating accurate responses.\n\n3. I can then ask for assistance with specific tasks or questions, such as writing unit tests or debugging code.\n\n4. After making changes to the project files or progressing further in the development process, I return to step one. This can be done by regenerating the files' content using the `gpt-project-context` command, modifying the initial message in ChatGPT, or starting a new ChatGPT session with an updated project context. This iterative process ensures that ChatGPT always has the most up-to-date information about the project, enabling it to provide accurate and relevant assistance.\n\n![Sequence Diagram](.github/docs/workflow-sequence-diagram.svg)\n\n### Include and Exclude Flags\n\n`gpt-project-context` allows you to customize the files included in the output using the `-i` (include) and `-e` (exclude) flags. The `-i` flag specifies which file patterns to include, while the `-e` flag specifies which file patterns to exclude. Use standard Glob syntax for specifying file paths.\n\nAll available flags are listed below:\n\n```txt\nUsage of gpt-project-context:\n  -e string\n        exclude patterns (Glob syntax)\n  -i string\n        include patterns (Glob syntax)\n  -n    no action, do not copy or write to clipboard\n  -o string\n        output file path\n  -p string\n        prompt at the beginning (default \"Here is the context of my current project. Just respond with 'OK' and wait for the instructions:\")\n```\n\n### Examples\n\n#### Go:\n\n```sh\ngpt-project-context -i '**/*.go,**/*.md' -e '**/bin/*,**/specific_file.go'\n```\n\n#### JavaScript:\n\n```sh\ngpt-project-context -i '**/*.js,README.md,package.json' -e '**/node_modules/**,**/dist/**'\n```\n\nTo use this tool more conveniently in a JavaScript project, add it as an npm run script in your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"context\": \"gpt-project-context -i '**/*.js,README.md,package.json' -e '**/node_modules/**,**/dist/**'\"\n  }\n}\n```\n\nNow, you can simply run `npm run context` to execute the script.\n\n## Installation\n\nTo quickly install `gpt-project-context` using binaries from GitHub release, follow the instructions for your operating system:\n\n### macOS\n\n```sh\n# Download the binary for macOS\ncurl -L -o gpt-project-context \"https://github.com/vlazic/gpt-project-context/releases/download/v1.1.1/gpt-project-context-macos\"\n\n# Make it executable\nchmod +x gpt-project-context\n\n# Move it to your PATH\nsudo mv gpt-project-context /usr/local/bin/\n```\n\n### Windows\n\n1. Download the `.exe` file from the [GitHub releases page](https://github.com/vlazic/gpt-project-context/releases).\n2. Move the `.exe` file to a folder included in your `PATH` environment variable (e.g., `C:\\Windows\\System32`).\n\n### Linux\n\n```sh\n# Download the binary for Linux\ncurl -L -o gpt-project-context \"https://github.com/vlazic/gpt-project-context/releases/download/v1.1.1/gpt-project-context-linux\"\n\n# Make it executable\nchmod +x gpt-project-context\n\n# Move it to your PATH\nsudo mv gpt-project-context /usr/local/bin/\n```\n\n## Contributing\n\nWe welcome any issues and pull requests.\n\nIf you have any questions, please feel free to open an issue.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlazic%2Fgpt-project-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlazic%2Fgpt-project-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlazic%2Fgpt-project-context/lists"}