The original Codedocent showed you code structure from the bottom up: functions inside files inside directories. That's useful for drilling into specifics, but it doesn't answer the first question most people have: how does this whole thing fit together?
Architecture mode answers that question.
What's new
Run codedocent /path/to/code --arch and instead of nested blocks, you get a dependency graph — a visual map showing which modules depend on which. Files are nodes. Import statements become arrows. Tightly coupled code clusters together; isolated utilities drift to the edges. You can see at a glance what's foundational and what's peripheral.
Three zoom levels:
- Level 0 — All modules as nodes with dependency edges
- Level 1 — Drill into a module to see individual files
- Level 2 — Click through to the existing file view
There's an "Export MD" button at each level that generates structured context you can paste into any AI tool for deeper analysis.
Smarter AI summaries
The AI analysis got a major upgrade. Previously, each file was explained in isolation. Now the prompt includes dependency context — what this file imports and what imports it. The AI understands role: is this a foundation that everything else builds on, or a leaf utility that nobody depends on?
Summaries now include a KEY CONCEPTS section listing the main functions, classes, and data structures with one-line descriptions. Faster to scan, easier to find what you're looking for.
Cloud AI is official
Since v0.5.0, you can use OpenAI, Groq, OpenRouter, or any OpenAI-compatible endpoint instead of running Ollama locally. Set an API key in an environment variable and go. For people without a local GPU, this is often faster and easier.
The GUI launcher and setup wizard now offer both options equally.
Install / upgrade
###b class="inline-flex items-center justify-center relative shrink-0 can-focus select-none disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none disabled:drop-shadow-none border-transparent transition font-base duration-300 ease-[cubic-bezier(0.165,0.85,0.45,1)] h-8 w-8 rounded-md active:scale-95 backdrop-blur-md Button_ghost__BUAoh" type="button" aria-label="Copy to clipboard" data-state="closed"###
pip install --upgrade codedocent
That's it. If you've used it before, same commands work. Architecture mode is --arch. Everything else is the same.
Brandon
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.