Skip to main content

Copy all non-git-ignored files from any subdirectory into llm-context for LLM consumption

Project description

lc-dir

Instantly copy all relevant Python files from any folder in your project to your clipboard—perfect for use with AI code assistants and LLMs.


Why use lc-dir?

When working with LLMs (like ChatGPT, Claude, or Copilot), you often need to share only part of your codebase—a single directory, a feature, or a component, not the whole repo.

lc-dir lets you do exactly that.

  • No more zipping folders or hand-pasting dozens of files.
  • No more sending the entire project when only one area matters.
  • Get context for refactoring, debugging, or reviewing code fast.

Key Features

  • Easy: Instantly copies all .py files under any directory (recursively) to your clipboard, ready for LLMs.
  • Flexible: Works from any subfolder, or specify any target directory.
  • Search: Give it a folder name; it’ll find the match for you.
  • Integrated: Uses your llm-context workflow for formatting and clipboard.

Installation

first install llm-context CLI if you haven't already:

pipx install llm-context

Then, install lc-dir:

pipx install lc-dir

(or use pip install --user lc-dir if you prefer)

Requirements:

  • Python 3.10+
  • The llm-context CLI, initialized in your project (run lc-init once per repo).

How to Use

Example: Copy all .py files from the current directory and below:

lc-dir

Example: Copy all .py files from a specific subdirectory (recursively):

lc-dir path/to/subdir

Example: Search for a folder by name, even if you’re not sure where it is:

lc-dir common

If more than one match is found, you’ll be prompted to choose.


Typical Workflow

  1. Navigate anywhere in your project directory tree.

  2. Run lc-dir [optional-subfolder]

  3. Paste in your LLM interface.

    • The clipboard will contain all relevant code, formatted for LLMs, just as if you ran llm-context but limited to your chosen scope.

Use Cases

  • LLM-powered code review: Share just the area you want help with.
  • Refactoring: Provide only the module or feature you’re working on.
  • Bug fixing: Send just the files around the problem.
  • Onboarding: Give teammates or LLMs a focused view of part of the repo.

Troubleshooting

  • If the clipboard isn’t updated, ensure you’ve initialized your repo with lc-init.
  • If you see “ModuleNotFoundError”, re-install with pipx install lc-dir and check your Python version.
  • You must have llm-context CLI installed in the project for this to work.

License

MIT


Contributions and issues welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lc_dir-0.1.10.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lc_dir-0.1.10-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file lc_dir-0.1.10.tar.gz.

File metadata

  • Download URL: lc_dir-0.1.10.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.8 Windows/11

File hashes

Hashes for lc_dir-0.1.10.tar.gz
Algorithm Hash digest
SHA256 a0f05f401c5ddb53d39b94a8a7dae5c9bcef7f561d66b09655688cc1f59fb322
MD5 e3f1542b8c788421d82c8307a72b6389
BLAKE2b-256 798c68c9eb4b80cbfbad37e070676e2c15415c30986e3e58f902384056b8832b

See more details on using hashes here.

File details

Details for the file lc_dir-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: lc_dir-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.8 Windows/11

File hashes

Hashes for lc_dir-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 da3b255882ce7b5f4de6a542807b518e68eaa7cef4b95c220d16344f2b19ec69
MD5 00885147a481ae7568f291f9fa983fbe
BLAKE2b-256 8d9918b2fc41d2558f71f8f537ca21723c499b0ffde01e87d02e8a3f66ed3410

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page