{"id":18488763,"url":"https://github.com/samk13/ccprompt","last_synced_at":"2025-04-08T21:30:38.668Z","repository":{"id":257811894,"uuid":"867878147","full_name":"Samk13/ccprompt","owner":"Samk13","description":"AI Code Context Extractor for Prompts ✨","archived":false,"fork":false,"pushed_at":"2024-10-09T22:10:25.000Z","size":42,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T18:54:25.674Z","etag":null,"topics":["ai","code","context","python","tooling","workflow"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ccprompt","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samk13.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","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":"2024-10-04T23:01:36.000Z","updated_at":"2025-02-16T03:01:16.000Z","dependencies_parsed_at":"2024-11-06T12:55:35.306Z","dependency_job_id":"262c2541-ac4d-49e2-b589-24803f541f03","html_url":"https://github.com/Samk13/ccprompt","commit_stats":null,"previous_names":["samk13/ccprompt"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samk13%2Fccprompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samk13%2Fccprompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samk13%2Fccprompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samk13%2Fccprompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samk13","download_url":"https://codeload.github.com/Samk13/ccprompt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247931012,"owners_count":21020149,"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":["ai","code","context","python","tooling","workflow"],"created_at":"2024-11-06T12:52:46.597Z","updated_at":"2025-04-08T21:30:38.663Z","avatar_url":"https://github.com/Samk13.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CCprompt\n\n## Code Context Prompt\n\n### The Problem\n\nWhen working with AI prompts, it is often necessary to provide code context to the model to generate useful responses. This can be a time-consuming task, especially when working with large codebases.\nCCprompt is a tool designed to extract code context for AI prompts based on provided function or class names. It supports both Python and JavaScript/TypeScript codebases.\nProviding such context can help AI models generate more accurate and relevant responses.\n\n## Features\n\n- Supports Python languages, JavaScript/TypeScript support coming soon.\n- Extracts functions or classes and their inheritance chains.\n- Configurable via a JSON configuration file or command-line arguments.\n- Excludes virtual environment directories if needed.\n- zero dependencies if you are using it for python.\n\n## Installation\n\n```bash\npip install ccprompt\n```\n\n## Usage\n\n### first time usage\n\nrun `ccprompt` it will create a configuration file `ccprompt_config.json` in the current directory.\nfill in the configuration file with the required information. Alternatively, you can pass the required information as command-line arguments.\n`ccprompt --config CONFIG`. The configuration file should be in the following format:\n\n```json\n{\n    \"target_name\": [\"YourClassName\", \"your_function_name\"],\n    \"project_path\": \"/full/path/to/project\",\n    \"venv_site_packages_path\": \"/full/path/to/venv/lib/python3.x/site-packages\",\n    \"exclude_venv\": false,\n    \"output_file\": \"extracted_code.txt\",\n    \"language\": \"python\"\n}\n\n```\n\nthen run `ccprompt`, it will extract the code context based on the configuration file. and create `extracted_code.txt` that include extracted code context.\n\nthe extracted code will include file path, functions or classes and their inheritance chains.\n\nStar and share the repository if you find it useful.\n\n```bash\n# Update your configuration file then run\nccprompt\n\n# Also possible to pass the configuration file as arguments\nccprompt --target_names YourClassName your_function_name\n\n# See all available options\nccprompt --help\n```\n\n## Development\n\n```bash\npip install -e .[\"dev\"]\n```\n\n## Commands\n\n```bash\n#  installs development dependencies specified in setup.py\nmake install\n\n#  Runs tests\nmake test\n\n#  Check linting issues\nmake lint-check\n\n#  Runs linting and fixes issues\nmake lint-fix\n\n#  Formats code using Ruff\nmake format\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamk13%2Fccprompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamk13%2Fccprompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamk13%2Fccprompt/lists"}