# CodeSight
[](https://github.com/mattsilv/codesight/actions/workflows/ci.yml)
[](https://badge.fury.io/py/codesight)
[](https://www.python.org/downloads/release/python-3120/)
[](https://opensource.org/licenses/MIT)
[](https://codecov.io/gh/mattsilv/codesight)
CodeSight is a developer tool designed to enhance your LLM-powered coding experience. When you're stuck in a complex debugging session or need help understanding a codebase, CodeSight makes it easy to get assistance from powerful LLMs like ChatGPT, Claude, or other AI models.
## What's New in 0.1.32
- **Improved File Organization**: Enhanced file grouping logic with 8 distinct categories for better code organization
- **Better Error Messages**: Configuration validation now provides clear, actionable error messages
- **Unicode Support**: Full support for Unicode paths and filenames
- **Enhanced Testing**: Comprehensive test suite with edge case coverage
- **Improved CI**: Clean environment builds with full linting and test coverage
See the [CHANGELOG](CHANGELOG.md) for full details.
## See it in Action
<div align="center">
<img src="https://raw.githubusercontent.com/mattsilv/codesight/main/docs/assets/sample-report.png" width="70%" alt="Sample CodeSight Report"/>
_A clean, organized summary of your codebase with file statistics and token counts_
<img src="https://raw.githubusercontent.com/mattsilv/codesight/main/docs/assets/sample-structure.png" width="70%" alt="Sample Structure View"/>
_Automatically generated project structure for better context_
<img src="https://raw.githubusercontent.com/mattsilv/codesight/main/docs/assets/sample-code.png" width="70%" alt="Sample Code View"/>
_Neatly formatted code snippets with syntax highlighting_
</div>
With a single command (`codesight`), it:
- Intelligently gathers all relevant code from your project
- Formats it for optimal LLM consumption
- Copies it to your clipboard, ready to paste into any AI assistant
- Provides a summary of files and token usage
This is particularly useful when:
- You're stuck in a complex debugging loop in Cursor or your IDE
- You need to escalate to a more powerful model like gpt o3-mini-high or o1-pro
- You want to get a second opinion on your code from a different LLM
- You need to share your codebase context with an AI assistant quickly
## About the Creator
CodeSight was created by Matt Silverman, a developer focused on enhancing the AI-powered coding experience. To learn more about Matt and his journey in AI development, visit [silv.blog/about](https://silv.blog/about).
## Installation
For users:
```bash
pip install codesight
```
For developers:
```bash
git clone https://github.com/mattsilv/codesight.git
cd codesight
poetry install
```
## Quick Start
### Using CodeSight as a Tool
Basic usage (analyzes current directory):
```bash
codesight
```
Use custom configuration:
```bash
codesight -c .codesight_config.toml
```
Save output to file:
```bash
codesight -o output.txt
```
### Developing CodeSight
When working on CodeSight itself, use Poetry to run commands:
```bash
# Run tests
poetry run pytest tests/
# Run CodeSight on a project
poetry run codesight
# Run CodeSight on itself
poetry run codesight . -o codesight_source.txt
```
## Configuration
Create a `.codesight_config.toml` file to customize behavior. Here's a complete example with all available options:
```toml
# File extensions to include (must start with '.')
include_extensions = [".py", ".md", ".rst", ".sql", ".toml"]
# Files to always exclude (supports glob patterns)
exclude_files = ["*.pyc", "*.pyo", "*.pyd", "*.so"]
# Files to always include, even if they match exclude patterns
include_files = ["README.md", "pyproject.toml"]
# Additional glob patterns to exclude
exclude_patterns = ["**/temp/*", "**/cache/*"]
# Maximum number of elements to keep in Python literals (lists/dicts)
truncate_py_literals = 5
# Key directories to focus on (empty means scan everything)
key_directories = ["src", "tests"]
# Documentation for specific files
file_docs = {
"README.md" = "Project documentation and usage guide",
"pyproject.toml" = "Project configuration and dependencies"
}
# Project type templates
[templates.python]
exclude_extensions = [".csv", ".pkl", ".db"]
key_directories = ["src", "tests"]
file_docs = {
"pyproject.toml" = "Project configuration and dependencies",
"README.md" = "Project documentation and usage guide"
}
[templates.javascript]
exclude_extensions = [".map", ".lock"]
key_directories = ["src", "test"]
file_docs = {
"package.json" = "Project configuration and dependencies",
"README.md" = "Project documentation and usage guide"
}
```
## Features
- Auto-detects project type (Python/JavaScript)
- Respects `.gitignore` patterns
- Truncates large Python data structures
- Markdown-formatted output
- Optional clipboard integration
- Customizable via TOML config
- Token counting for LLM context limits
- Rich console output with file statistics
- Full Unicode support for paths and filenames
- Comprehensive error messages
## File Organization
CodeSight organizes files into priority groups for better context:
1. Core project files (README, pyproject.toml, etc.)
2. Configuration and hidden files
3. Entry points (**init**.py, main.py)
4. Core source code (src/, lib/, core/)
5. Tests (test\_\*.py, tests/)
6. Documentation and examples
7. Build artifacts
8. Other files
## Contributing to CodeSight
If you're interested in contributing to the CodeSight project:
1. Fork and clone the repository:
```bash
git clone https://github.com/mattsilv/codesight.git
cd codesight
poetry install
```
2. Run development commands with Poetry:
```bash
# Run tests
poetry run pytest tests/
# Try CodeSight on itself
poetry run codesight . -o codesight_source.txt
```
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development setup and guidelines.
## License
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/mattsilv/codesight",
"name": "codesight",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": "llm, code, collation, gpt, context, python",
"author": "Matt Silverman",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/da/33/b0966c9cb5464588842f54c197e4f26083305ecb1bc6fa44e96d9b656dd7/codesight-0.1.32.tar.gz",
"platform": null,
"description": "# CodeSight\n\n[](https://github.com/mattsilv/codesight/actions/workflows/ci.yml)\n[](https://badge.fury.io/py/codesight)\n[](https://www.python.org/downloads/release/python-3120/)\n[](https://opensource.org/licenses/MIT)\n[](https://codecov.io/gh/mattsilv/codesight)\n\nCodeSight is a developer tool designed to enhance your LLM-powered coding experience. When you're stuck in a complex debugging session or need help understanding a codebase, CodeSight makes it easy to get assistance from powerful LLMs like ChatGPT, Claude, or other AI models.\n\n## What's New in 0.1.32\n\n- **Improved File Organization**: Enhanced file grouping logic with 8 distinct categories for better code organization\n- **Better Error Messages**: Configuration validation now provides clear, actionable error messages\n- **Unicode Support**: Full support for Unicode paths and filenames\n- **Enhanced Testing**: Comprehensive test suite with edge case coverage\n- **Improved CI**: Clean environment builds with full linting and test coverage\n\nSee the [CHANGELOG](CHANGELOG.md) for full details.\n\n## See it in Action\n\n<div align=\"center\">\n\n<img src=\"https://raw.githubusercontent.com/mattsilv/codesight/main/docs/assets/sample-report.png\" width=\"70%\" alt=\"Sample CodeSight Report\"/>\n\n_A clean, organized summary of your codebase with file statistics and token counts_\n\n<img src=\"https://raw.githubusercontent.com/mattsilv/codesight/main/docs/assets/sample-structure.png\" width=\"70%\" alt=\"Sample Structure View\"/>\n\n_Automatically generated project structure for better context_\n\n<img src=\"https://raw.githubusercontent.com/mattsilv/codesight/main/docs/assets/sample-code.png\" width=\"70%\" alt=\"Sample Code View\"/>\n\n_Neatly formatted code snippets with syntax highlighting_\n\n</div>\n\nWith a single command (`codesight`), it:\n\n- Intelligently gathers all relevant code from your project\n- Formats it for optimal LLM consumption\n- Copies it to your clipboard, ready to paste into any AI assistant\n- Provides a summary of files and token usage\n\nThis is particularly useful when:\n\n- You're stuck in a complex debugging loop in Cursor or your IDE\n- You need to escalate to a more powerful model like gpt o3-mini-high or o1-pro\n- You want to get a second opinion on your code from a different LLM\n- You need to share your codebase context with an AI assistant quickly\n\n## About the Creator\n\nCodeSight was created by Matt Silverman, a developer focused on enhancing the AI-powered coding experience. To learn more about Matt and his journey in AI development, visit [silv.blog/about](https://silv.blog/about).\n\n## Installation\n\nFor users:\n\n```bash\npip install codesight\n```\n\nFor developers:\n\n```bash\ngit clone https://github.com/mattsilv/codesight.git\ncd codesight\npoetry install\n```\n\n## Quick Start\n\n### Using CodeSight as a Tool\n\nBasic usage (analyzes current directory):\n\n```bash\ncodesight\n```\n\nUse custom configuration:\n\n```bash\ncodesight -c .codesight_config.toml\n```\n\nSave output to file:\n\n```bash\ncodesight -o output.txt\n```\n\n### Developing CodeSight\n\nWhen working on CodeSight itself, use Poetry to run commands:\n\n```bash\n# Run tests\npoetry run pytest tests/\n\n# Run CodeSight on a project\npoetry run codesight\n\n# Run CodeSight on itself\npoetry run codesight . -o codesight_source.txt\n```\n\n## Configuration\n\nCreate a `.codesight_config.toml` file to customize behavior. Here's a complete example with all available options:\n\n```toml\n# File extensions to include (must start with '.')\ninclude_extensions = [\".py\", \".md\", \".rst\", \".sql\", \".toml\"]\n\n# Files to always exclude (supports glob patterns)\nexclude_files = [\"*.pyc\", \"*.pyo\", \"*.pyd\", \"*.so\"]\n\n# Files to always include, even if they match exclude patterns\ninclude_files = [\"README.md\", \"pyproject.toml\"]\n\n# Additional glob patterns to exclude\nexclude_patterns = [\"**/temp/*\", \"**/cache/*\"]\n\n# Maximum number of elements to keep in Python literals (lists/dicts)\ntruncate_py_literals = 5\n\n# Key directories to focus on (empty means scan everything)\nkey_directories = [\"src\", \"tests\"]\n\n# Documentation for specific files\nfile_docs = {\n \"README.md\" = \"Project documentation and usage guide\",\n \"pyproject.toml\" = \"Project configuration and dependencies\"\n}\n\n# Project type templates\n[templates.python]\nexclude_extensions = [\".csv\", \".pkl\", \".db\"]\nkey_directories = [\"src\", \"tests\"]\nfile_docs = {\n \"pyproject.toml\" = \"Project configuration and dependencies\",\n \"README.md\" = \"Project documentation and usage guide\"\n}\n\n[templates.javascript]\nexclude_extensions = [\".map\", \".lock\"]\nkey_directories = [\"src\", \"test\"]\nfile_docs = {\n \"package.json\" = \"Project configuration and dependencies\",\n \"README.md\" = \"Project documentation and usage guide\"\n}\n```\n\n## Features\n\n- Auto-detects project type (Python/JavaScript)\n- Respects `.gitignore` patterns\n- Truncates large Python data structures\n- Markdown-formatted output\n- Optional clipboard integration\n- Customizable via TOML config\n- Token counting for LLM context limits\n- Rich console output with file statistics\n- Full Unicode support for paths and filenames\n- Comprehensive error messages\n\n## File Organization\n\nCodeSight organizes files into priority groups for better context:\n\n1. Core project files (README, pyproject.toml, etc.)\n2. Configuration and hidden files\n3. Entry points (**init**.py, main.py)\n4. Core source code (src/, lib/, core/)\n5. Tests (test\\_\\*.py, tests/)\n6. Documentation and examples\n7. Build artifacts\n8. Other files\n\n## Contributing to CodeSight\n\nIf you're interested in contributing to the CodeSight project:\n\n1. Fork and clone the repository:\n\n```bash\ngit clone https://github.com/mattsilv/codesight.git\ncd codesight\npoetry install\n```\n\n2. Run development commands with Poetry:\n\n```bash\n# Run tests\npoetry run pytest tests/\n\n# Try CodeSight on itself\npoetry run codesight . -o codesight_source.txt\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development setup and guidelines.\n\n## License\n\nMIT\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tool for collating code and generating LLM context",
"version": "0.1.32",
"project_urls": {
"Documentation": "https://github.com/mattsilv/codesight#readme",
"Homepage": "https://github.com/mattsilv/codesight",
"Repository": "https://github.com/mattsilv/codesight"
},
"split_keywords": [
"llm",
" code",
" collation",
" gpt",
" context",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c3f081242589a6cde6ae7e4f4dd4589a7030e5bc797e6a64803cdf179e2c8285",
"md5": "9935fbc0e407e05bfb095e85dd000c2d",
"sha256": "fae95522f8e018853edb3e0540a55ab18326c6e9d6d017d606d350b8a6c01ebd"
},
"downloads": -1,
"filename": "codesight-0.1.32-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9935fbc0e407e05bfb095e85dd000c2d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 15172,
"upload_time": "2025-02-14T03:12:57",
"upload_time_iso_8601": "2025-02-14T03:12:57.333803Z",
"url": "https://files.pythonhosted.org/packages/c3/f0/81242589a6cde6ae7e4f4dd4589a7030e5bc797e6a64803cdf179e2c8285/codesight-0.1.32-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "da33b0966c9cb5464588842f54c197e4f26083305ecb1bc6fa44e96d9b656dd7",
"md5": "67c46cbd72c25696ba862cdc46219f6f",
"sha256": "03bd5de660ef7e2b8d731c15469a3330564859e55af105e81dea8bde985845af"
},
"downloads": -1,
"filename": "codesight-0.1.32.tar.gz",
"has_sig": false,
"md5_digest": "67c46cbd72c25696ba862cdc46219f6f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 13999,
"upload_time": "2025-02-14T03:12:59",
"upload_time_iso_8601": "2025-02-14T03:12:59.160775Z",
"url": "https://files.pythonhosted.org/packages/da/33/b0966c9cb5464588842f54c197e4f26083305ecb1bc6fa44e96d9b656dd7/codesight-0.1.32.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-14 03:12:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mattsilv",
"github_project": "codesight",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "codesight"
}