codeindexer


Namecodeindexer JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
SummaryA lightweight CLI to index a codebase and create a context-ready prompt file for LLM.
upload_time2025-07-13 01:55:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords productivity open-source code prompt indexing gemini codebase llama cursor copilot copy-paste claude groq llm prompt-engineering llms chatgpt deepseek
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CodeIndexer

[![PyPI version](https://badge.fury.io/py/codeindexer.svg)](https://badge.fury.io/py/codeindexer)

A lightweight CLI tool for indexing codebases to provide context for LLMs.

## Why ?

Still doing some finger-hurting typing or copy-pasting just to update your LLM about code changes or set up context in new chats (the old way πŸ˜…, without copilots)?

I run this tool to generate a structured prompt with my project files, so all I have to do is copy, paste, and the model is ready to go! βŒ›β±οΈβœ¨

## Installation ℹ️

```bash
pip install codeindexer

# Basic usage
codeindexer --index ./my_repo --format md index_file.md

# Filter by file extensions (create a txt prompt file index_file.txt)
codeindexer --index ./my_repo --only .py,.js,.md --format txt index_file.txt

# Skip specific directories or files (create a json prompt file index_file.json)
codeindexer --index ./my_repo --skip node_modules/,venv/,*.log --format json index_file.json

# Explicitly include files/paths (even if ignored by .gitignore)
codeindexer --index ./my_repo --include important.log,temp/config.json --format md index_file.md

# Add a custom prompt at the end
codeindexer --index ./my_repo --prompt "Analyze and suggest improvements." --format md index_file.md

# Disable .gitignore parsing
codeindexer --index ./my_repo --no-gitignore --format md index_file.md

# Split the prompt into multiple parts e.g 1000 lines max (place prompt parts in the index_file/... folder)
codeindexer --index ./my_repo --format md index_file.md --split 1000
````

Example of indexed output file (index_file.md) πŸ“‹

```tree
# Repo: my_repo
# Folder structure:
my_repo/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ utils.py
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_main.py
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt

# Files  
# my_repo/requirements.txt  
{contents of my_repo/requirements.txt}  

# my_repo/README.md  
{contents of my_repo/README.md}  

# my_repo/src/main.py  
{contents of my_repo/src/main.py}  

...  
________________________________________

Acknowledge the project's description and files, do no provide additional explanation, wait for instructions

```

## Options πŸ”§

- `--index`: Directory to index (required)
- `--only`: Comma-separated list of file extensions to include (e.g., .py,.js,.md)
- `--skip`: Comma-separated list of patterns to skip (e.g., node_modules/,venv/,*.log)
- `--include`: Comma-separated list of patterns to explicitly include even if in .gitignore
- `--format`: Output format (md, txt, json) - default is md
- `--prompt`: Custom prompt to add at the end of the index
- `--no-skip-env`: Include .env files (by default they are skipped)
- `--no-gitignore`: Disable automatic parsing of .gitignore files (enabled by default)
- `--split`: Split output into chunks with specified max lines per file (default: 1000)


## Features ✨
- βœ… Generate a single file with your repo’s structure and files
- βœ… Automatically respects .gitignore rules πŸ“‹
- βœ… Filters files by extension and skips binaries πŸ”
- βœ… Multiple output formats: Markdown, text, JSON πŸ“
- βœ… Add a custom prompt for LLM context πŸ€–
- βœ… Split output files into small parts

## Contributing 🀝
Contributions are welcome! Please check out our [Contributing Guide](CONTRIBUTING.md) for details on how to get started.

## License

MIT

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "codeindexer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "productivity, open-source, code, prompt, indexing, gemini, codebase, llama, cursor, copilot, copy-paste, claude, groq, llm, prompt-engineering, llms, chatgpt, deepseek",
    "author": null,
    "author_email": "Franklin Kemta <hi@franklinkemta.com>",
    "download_url": "https://files.pythonhosted.org/packages/3c/98/2fd5d79cb05d84164e7806303a2840bf0b7bb741e15d91baa49ae43fd004/codeindexer-0.1.2.tar.gz",
    "platform": null,
    "description": "# CodeIndexer\n\n[![PyPI version](https://badge.fury.io/py/codeindexer.svg)](https://badge.fury.io/py/codeindexer)\n\nA lightweight CLI tool for indexing codebases to provide context for LLMs.\n\n## Why ?\n\nStill doing some finger-hurting typing or copy-pasting just to update your LLM about code changes or set up context in new chats (the old way \ud83d\ude05, without copilots)?\n\nI run this tool to generate a structured prompt with my project files, so all I have to do is copy, paste, and the model is ready to go! \u231b\u23f1\ufe0f\u2728\n\n## Installation \u2139\ufe0f\n\n```bash\npip install codeindexer\n\n# Basic usage\ncodeindexer --index ./my_repo --format md index_file.md\n\n# Filter by file extensions (create a txt prompt file index_file.txt)\ncodeindexer --index ./my_repo --only .py,.js,.md --format txt index_file.txt\n\n# Skip specific directories or files (create a json prompt file index_file.json)\ncodeindexer --index ./my_repo --skip node_modules/,venv/,*.log --format json index_file.json\n\n# Explicitly include files/paths (even if ignored by .gitignore)\ncodeindexer --index ./my_repo --include important.log,temp/config.json --format md index_file.md\n\n# Add a custom prompt at the end\ncodeindexer --index ./my_repo --prompt \"Analyze and suggest improvements.\" --format md index_file.md\n\n# Disable .gitignore parsing\ncodeindexer --index ./my_repo --no-gitignore --format md index_file.md\n\n# Split the prompt into multiple parts e.g 1000 lines max (place prompt parts in the index_file/... folder)\ncodeindexer --index ./my_repo --format md index_file.md --split 1000\n````\n\nExample of indexed output file (index_file.md) \ud83d\udccb\n\n```tree\n# Repo: my_repo\n# Folder structure:\nmy_repo/\n\u251c\u2500\u2500 src/\n\u2502   \u251c\u2500\u2500 main.py\n\u2502   \u251c\u2500\u2500 utils.py\n\u251c\u2500\u2500 tests/\n\u2502   \u251c\u2500\u2500 test_main.py\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 requirements.txt\n\n# Files  \n# my_repo/requirements.txt  \n{contents of my_repo/requirements.txt}  \n\n# my_repo/README.md  \n{contents of my_repo/README.md}  \n\n# my_repo/src/main.py  \n{contents of my_repo/src/main.py}  \n\n...  \n________________________________________\n\nAcknowledge the project's description and files, do no provide additional explanation, wait for instructions\n\n```\n\n## Options \ud83d\udd27\n\n- `--index`: Directory to index (required)\n- `--only`: Comma-separated list of file extensions to include (e.g., .py,.js,.md)\n- `--skip`: Comma-separated list of patterns to skip (e.g., node_modules/,venv/,*.log)\n- `--include`: Comma-separated list of patterns to explicitly include even if in .gitignore\n- `--format`: Output format (md, txt, json) - default is md\n- `--prompt`: Custom prompt to add at the end of the index\n- `--no-skip-env`: Include .env files (by default they are skipped)\n- `--no-gitignore`: Disable automatic parsing of .gitignore files (enabled by default)\n- `--split`: Split output into chunks with specified max lines per file (default: 1000)\n\n\n## Features \u2728\n- \u2705 Generate a single file with your repo\u2019s structure and files\n- \u2705 Automatically respects .gitignore rules \ud83d\udccb\n- \u2705 Filters files by extension and skips binaries \ud83d\udd0d\n- \u2705 Multiple output formats: Markdown, text, JSON \ud83d\udcdd\n- \u2705 Add a custom prompt for LLM context \ud83e\udd16\n- \u2705 Split output files into small parts\n\n## Contributing \ud83e\udd1d\nContributions are welcome! Please check out our [Contributing Guide](CONTRIBUTING.md) for details on how to get started.\n\n## License\n\nMIT\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A lightweight CLI to index a codebase and create a context-ready prompt file for LLM.",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/franklinkemta/codeindexer/issues",
        "Homepage": "https://github.com/franklinkemta/codeindexer"
    },
    "split_keywords": [
        "productivity",
        " open-source",
        " code",
        " prompt",
        " indexing",
        " gemini",
        " codebase",
        " llama",
        " cursor",
        " copilot",
        " copy-paste",
        " claude",
        " groq",
        " llm",
        " prompt-engineering",
        " llms",
        " chatgpt",
        " deepseek"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f01396357e58db5f48171c162d9b858666e0b419e7c9fdc6a593350431ee0132",
                "md5": "92ffa151bce72fbcf935b2903b00eec3",
                "sha256": "3f329e97695ce29b1d52b4b8faf80e1473746768cc54c21e5ca976e916044107"
            },
            "downloads": -1,
            "filename": "codeindexer-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "92ffa151bce72fbcf935b2903b00eec3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 14045,
            "upload_time": "2025-07-13T01:55:08",
            "upload_time_iso_8601": "2025-07-13T01:55:08.742580Z",
            "url": "https://files.pythonhosted.org/packages/f0/13/96357e58db5f48171c162d9b858666e0b419e7c9fdc6a593350431ee0132/codeindexer-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3c982fd5d79cb05d84164e7806303a2840bf0b7bb741e15d91baa49ae43fd004",
                "md5": "98a078af8d813b9a835154728803804b",
                "sha256": "36669cc665e52e1b85c687c989ac2137c107de3034b2c0a710673022ffd51c19"
            },
            "downloads": -1,
            "filename": "codeindexer-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "98a078af8d813b9a835154728803804b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 13798,
            "upload_time": "2025-07-13T01:55:09",
            "upload_time_iso_8601": "2025-07-13T01:55:09.848207Z",
            "url": "https://files.pythonhosted.org/packages/3c/98/2fd5d79cb05d84164e7806303a2840bf0b7bb741e15d91baa49ae43fd004/codeindexer-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-13 01:55:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "franklinkemta",
    "github_project": "codeindexer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "codeindexer"
}
        
Elapsed time: 0.41801s