codebase2prompt


Namecodebase2prompt JSON
Version 0.1.4 PyPI version JSON
download
home_pagehttps://github.com/epicshardz/codebase2prompt
SummaryGenerate prompts from codebase structure and content
upload_time2025-01-23 04:15:25
maintainerNone
docs_urlNone
authorDevin Bates
requires_python<4.0,>=3.8
licenseMIT
keywords llm prompt-engineering code-analysis ai developer-tools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Codebase2Prompt

## Description
Codebase2Prompt is a minimal command-line tool that generates structured prompts from codebases. It does not provide the full function code, but purely the method addresses. It supports multiple output formats (Markdown, JSON, YAML) and automatically copies results to your clipboard. The tool is particularly useful for:
- Creating codebase overviews for AI prompts
- Generating documentation templates
- Sharing code context with collaborators

## Purpose

There are many times the LLM context window is maxed out when providing the full codebase. Because it is good practice to name functions with logical addresses, it goes to reason that a LLM will be able to intuit what a class, method, etc contains based on its naming and location in the folder structure. This is meant to provide high level understanding to the LLM in times where LLM drift becomes and issue. 

## Installation

### PyPI Installation
Install directly from PyPI:
```bash
pip install codebase2prompt
```

Verify installation:
```bash
c2p --version
```

### Development Installation
For local development:

1. Clone the repository:
```bash
git clone https://github.com/epicshardz/codebase2prompt
cd codebase2prompt
```

2. Install dependencies using Poetry:
```bash
poetry install
```

3. Install the CLI tool:
```bash
poetry shell
pip install .
```

## Configuration
The tool can be configured using a `config.ini` file. Copy the example configuration:
```bash
c2p config.ini.example config.ini
```

### Configuration Options
- **Default Path**: Set the default directory to scan
- **File Extensions**: Specify which file types to include
- **Exclusion Patterns**: Define patterns to exclude files/directories
- **Output Format**: Choose between markdown, json, or yaml
- **Clipboard Settings**: Enable/disable automatic clipboard copying

## Usage

### Basic Usage
Scan the current directory:
```bash
c2p
```

Scan a specific directory:
```bash
c2p /path/to/codebase
```

### Excluding Files/Directories
Exclude specific patterns:
```bash
c2p --exclude node_modules --exclude .git
```

### Output Formats
Generate JSON output:
```bash
c2p --output-format json
```

Generate YAML output:
```bash
c2p --output-format yaml
```

### Clipboard Integration
Disable clipboard copying:
```bash
c2p --no-clipboard
```

Force clipboard copying:
```bash
c2p --clipboard
```

## Development

### Setting Up
1. Install development dependencies:
```bash
poetry install --with dev
```

2. Activate the virtual environment:
```bash
poetry shell
```

### Running Tests
Run all tests:
```bash
pytest
```

Run tests with coverage:
```bash
pytest --cov=Codebase2Prompt
```

### Code Formatting
Format code with Black:
```bash
black .
```

Sort imports with isort:
```bash
isort .
```

### Building and Releasing
Build the package:
```bash
poetry build
```

Publish to PyPI:
```bash
poetry publish
```

## Contributing
We welcome contributions! Please follow these guidelines:
1. Open an issue to discuss proposed changes
2. Fork the repository and create a feature branch
3. Submit a pull request with:
   - Clear description of changes
   - Updated tests
   - Documentation updates if needed

For bug reports, please include:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment details

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/epicshardz/codebase2prompt",
    "name": "codebase2prompt",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "llm, prompt-engineering, code-analysis, ai, developer-tools",
    "author": "Devin Bates",
    "author_email": "devinlbates@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/85/d0/d6e255ce8798d6a6fcff6121f7a16f3294ecf8188d03a546c10d6a32e68b/codebase2prompt-0.1.4.tar.gz",
    "platform": null,
    "description": "# Codebase2Prompt\n\n## Description\nCodebase2Prompt is a minimal command-line tool that generates structured prompts from codebases. It does not provide the full function code, but purely the method addresses. It supports multiple output formats (Markdown, JSON, YAML) and automatically copies results to your clipboard. The tool is particularly useful for:\n- Creating codebase overviews for AI prompts\n- Generating documentation templates\n- Sharing code context with collaborators\n\n## Purpose\n\nThere are many times the LLM context window is maxed out when providing the full codebase. Because it is good practice to name functions with logical addresses, it goes to reason that a LLM will be able to intuit what a class, method, etc contains based on its naming and location in the folder structure. This is meant to provide high level understanding to the LLM in times where LLM drift becomes and issue. \n\n## Installation\n\n### PyPI Installation\nInstall directly from PyPI:\n```bash\npip install codebase2prompt\n```\n\nVerify installation:\n```bash\nc2p --version\n```\n\n### Development Installation\nFor local development:\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/epicshardz/codebase2prompt\ncd codebase2prompt\n```\n\n2. Install dependencies using Poetry:\n```bash\npoetry install\n```\n\n3. Install the CLI tool:\n```bash\npoetry shell\npip install .\n```\n\n## Configuration\nThe tool can be configured using a `config.ini` file. Copy the example configuration:\n```bash\nc2p config.ini.example config.ini\n```\n\n### Configuration Options\n- **Default Path**: Set the default directory to scan\n- **File Extensions**: Specify which file types to include\n- **Exclusion Patterns**: Define patterns to exclude files/directories\n- **Output Format**: Choose between markdown, json, or yaml\n- **Clipboard Settings**: Enable/disable automatic clipboard copying\n\n## Usage\n\n### Basic Usage\nScan the current directory:\n```bash\nc2p\n```\n\nScan a specific directory:\n```bash\nc2p /path/to/codebase\n```\n\n### Excluding Files/Directories\nExclude specific patterns:\n```bash\nc2p --exclude node_modules --exclude .git\n```\n\n### Output Formats\nGenerate JSON output:\n```bash\nc2p --output-format json\n```\n\nGenerate YAML output:\n```bash\nc2p --output-format yaml\n```\n\n### Clipboard Integration\nDisable clipboard copying:\n```bash\nc2p --no-clipboard\n```\n\nForce clipboard copying:\n```bash\nc2p --clipboard\n```\n\n## Development\n\n### Setting Up\n1. Install development dependencies:\n```bash\npoetry install --with dev\n```\n\n2. Activate the virtual environment:\n```bash\npoetry shell\n```\n\n### Running Tests\nRun all tests:\n```bash\npytest\n```\n\nRun tests with coverage:\n```bash\npytest --cov=Codebase2Prompt\n```\n\n### Code Formatting\nFormat code with Black:\n```bash\nblack .\n```\n\nSort imports with isort:\n```bash\nisort .\n```\n\n### Building and Releasing\nBuild the package:\n```bash\npoetry build\n```\n\nPublish to PyPI:\n```bash\npoetry publish\n```\n\n## Contributing\nWe welcome contributions! Please follow these guidelines:\n1. Open an issue to discuss proposed changes\n2. Fork the repository and create a feature branch\n3. Submit a pull request with:\n   - Clear description of changes\n   - Updated tests\n   - Documentation updates if needed\n\nFor bug reports, please include:\n- Steps to reproduce\n- Expected behavior\n- Actual behavior\n- Environment details\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Generate prompts from codebase structure and content",
    "version": "0.1.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/epicshardz/codebase2prompt/issues",
        "Documentation": "https://github.com/epicshardz/codebase2prompt#readme",
        "Homepage": "https://github.com/epicshardz/codebase2prompt",
        "Repository": "https://github.com/epicshardz/codebase2prompt"
    },
    "split_keywords": [
        "llm",
        " prompt-engineering",
        " code-analysis",
        " ai",
        " developer-tools"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2272db68ef7a09e252f2adcc6fff79c1634ad209de3d2b4d13e423be33c53678",
                "md5": "84ccfcd8f0a8ea99d7af10725fe4d97b",
                "sha256": "dd68a048504974ef45ab4369c2bd546c912e0fcf2c4c72bc440dcad204d59533"
            },
            "downloads": -1,
            "filename": "codebase2prompt-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "84ccfcd8f0a8ea99d7af10725fe4d97b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 18889,
            "upload_time": "2025-01-23T04:15:23",
            "upload_time_iso_8601": "2025-01-23T04:15:23.708005Z",
            "url": "https://files.pythonhosted.org/packages/22/72/db68ef7a09e252f2adcc6fff79c1634ad209de3d2b4d13e423be33c53678/codebase2prompt-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "85d0d6e255ce8798d6a6fcff6121f7a16f3294ecf8188d03a546c10d6a32e68b",
                "md5": "03a13548718bf8d79021b24a9dd4ecf3",
                "sha256": "b292423a7c35fe84597a2d3a31d45452238e9556a2914dd4c589611a6249fe2d"
            },
            "downloads": -1,
            "filename": "codebase2prompt-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "03a13548718bf8d79021b24a9dd4ecf3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 15588,
            "upload_time": "2025-01-23T04:15:25",
            "upload_time_iso_8601": "2025-01-23T04:15:25.471605Z",
            "url": "https://files.pythonhosted.org/packages/85/d0/d6e255ce8798d6a6fcff6121f7a16f3294ecf8188d03a546c10d6a32e68b/codebase2prompt-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-23 04:15:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "epicshardz",
    "github_project": "codebase2prompt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "codebase2prompt"
}
        
Elapsed time: 0.42732s