DEV Community

zonal
zonal

Posted on

I built a local CLI that prepares repository context for AI coding tools

I built Codebase Brief to help with the step before asking a coding assistant to work on an unfamiliar repository: gathering a useful amount of project context without copying in a pile of files by hand.

Codebase Brief is a Python command-line tool. Give it a repository and a coding task. It suggests files, shows why they were selected, and creates a Markdown brief with short excerpts and paths back to the source files. If you provide a Git base ref, it also prioritizes changed files.
It runs locally and makes no AI calls. Its file selection is heuristic, not semantic code analysis, so it can miss useful files or include irrelevant ones. Review the brief before sharing it, especially if the repository contains private code.
To try it, install from GitHub and point it at a repository:
python -m pip install git+https://github.com/mohamed1111111m/codebase-brief.git
python -m context_inject "/path/to/your/repo" --task "Trace the login flow" --base main
If your repository has no main branch or isn’t using Git, leave off --base main.
The README has the full instructions and screenshots.
I’d like feedback from developers who try it on a repository they know: Which useful file did it miss, or which suggested file wasn’t relevant?
What to do before publishing: replace /path/to/your/repo in the example with a real example path—or leave it as a placeholder—and preview the article to check the image and code formatting. Don’t claim it improves coding results; that hasn’t been measured yet.

Top comments (0)