ArchitectLens
ArchitectLens is an automated reverse-engineering and architecture extraction tool. Point it at a codebase ZIP and it generates structured documentation from it: a Knowledge Sharing (KT) guide, and/or a formal SRS, BRD, HLD, and LLD document set — via a CLI or an MCP server, backed by Claude (default), OpenAI, Gemini, a local Ollama model, or AWS Bedrock.
Project status
Functional CLI and MCP server (v0.1.0). WBS.md tracks implementation progress against plan_doc.txt (the approved architecture plan).
Install
pip install -e .
# or, to enable specific extra providers:
pip install -e ".[openai]"
pip install -e ".[gemini]"
pip install -e ".[ollama]"
pip install -e ".[bedrock]"
# or all of them at once:
pip install -e ".[all-providers]"
This registers two console scripts: architectlens (CLI) and architectlens-mcp (MCP server).
CLI usage
# Knowledge Sharing / Framework Guide only
architectlens generate --zip ./codebase.zip --kt --out ./output
# Any combination of SRS/HLD/LLD (generated together, one coherent LLM call, split into separate files)
architectlens generate --zip ./codebase.zip --srs --hld --lld --brd --out ./output
# Every document type
architectlens generate --zip ./codebase.zip --all --out ./output
# Preview the composed prompts + codebase digest without calling any LLM
architectlens generate --zip ./codebase.zip --hld --dry-run
# Use a different provider/model
architectlens generate --zip ./codebase.zip --kt --provider openai --model gpt-4o
Run architectlens generate --help for the full flag reference. Output is written to <--out>/<project-name>/:
<project-name>/
KT-Docs/knowledge-sharing-guide.md
Reverse-Engineering/SRS.md
Reverse-Engineering/HLD.md
Reverse-Engineering/LLD.md
Reverse-Engineering/BRD.md
MCP server
Start it directly with architectlens-mcp, or register it with an MCP client, e.g. in claude_desktop_config.json:
{
"mcpServers": {
"architectlens": {
"command": "architectlens-mcp"
}
}
}
It exposes two tools:
list_doc_types()— the doc type identifiers accepted below.generate_documentation(zip_path, doc_types, output_dir, provider="anthropic", model=None, dry_run=False)— same behavior as the CLI'sgeneratecommand; returns{project_name, output_dir, files_written, warnings}.
Providers
--provider |
Extra to install | Model default | Credentials |
|---|---|---|---|
anthropic (default) |
(core dependency) | claude-opus-5 |
ANTHROPIC_API_KEY (or ANTHROPIC_AUTH_TOKEN / ant auth login) |
openai |
architectlens[openai] |
gpt-4o |
OPENAI_API_KEY |
gemini |
architectlens[gemini] |
gemini-2.5-flash |
GEMINI_API_KEY or GOOGLE_API_KEY |
ollama |
architectlens[ollama] |
llama3.1 |
none — talks to a local server (OLLAMA_HOST, default http://localhost:11434) |
bedrock |
architectlens[bedrock] |
anthropic.claude-3-5-sonnet-20241022-v2:0 |
resolved by boto3's own credential chain — see below |
fake |
(core dependency) | — | none — canned output, used for --dry-run-style testing |
Bedrock auth is handled entirely by boto3's standard credential chain, which already covers every AWS auth style without any special flags here — just set AWS_REGION/AWS_DEFAULT_REGION and, optionally, AWS_PROFILE:
- AWS SSO login — run
aws sso loginagainst a profile set up withaws configure sso, then setAWS_PROFILEto it. - IAM user — static
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY(env vars, the shared credentials file, or a profile). - Role / service account — an EC2 instance profile, ECS/Lambda execution role, or Kubernetes IRSA (
AWS_ROLE_ARN+AWS_WEB_IDENTITY_TOKEN_FILE); boto3 picks these up automatically when running in that environment, no configuration needed here.
Environment variables
Both the CLI and the MCP server auto-load a .env file (via python-dotenv, looked up from the current working directory) before resolving any of these — a project-root .env is picked up with no extra flags. .env is git-ignored; never commit it.
| Variable | Purpose | Default |
|---|---|---|
ANTHROPIC_API_KEY |
Anthropic credentials | resolved by the Anthropic SDK (env var, ANTHROPIC_AUTH_TOKEN, or an ant auth login profile) |
OPENAI_API_KEY |
OpenAI credentials | resolved by the OpenAI SDK |
GEMINI_API_KEY / GOOGLE_API_KEY |
Gemini credentials | resolved by the Gemini SDK |
OLLAMA_HOST |
Ollama server address | http://localhost:11434 |
AWS_PROFILE, AWS_REGION / AWS_DEFAULT_REGION |
Bedrock profile/region (credentials themselves via boto3's chain — see above) | boto3 defaults |
ARCHITECTLENS_PROVIDER |
Default --provider when not passed on the command line |
anthropic |
DEFAULT_LLM_PROVIDER |
Same as ARCHITECTLENS_PROVIDER; checked if that one isn't set |
anthropic |
ARCHITECTLENS_MODEL |
Default --model when not passed on the command line |
provider's own default |
Prompt templates
The LLM prompts that drive documentation generation live in src/architectlens/prompts/templates/:
knowledge_sharing_guide.md— KT / Framework Guide generationsrs_hld_lld.md— SRS, HLD, and LLD generation (section-selectable)brd.md— Business Requirements Document generation
Development
pip install -e ".[dev]"
pytest
# security checks (also run in CI on every push/PR)
bandit -r src
pip-audit
CI (.github/workflows/ci.yml) runs the test suite plus these two security checks on every push and pull request against main. Releases publish to PyPI via .github/workflows/publish-pypi.yml (trusted publishing, no stored token) on each GitHub Release.
Metadata
Release files for architectlens 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| architectlens-1.0.0.tar.gz | 36.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| architectlens-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 75.1 kB
Release files / architectlens-1.0.0.tar.gz
| Download URL | architectlens-1.0.0.tar.gz |
|---|---|
| Size | 36.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
581d0c03c9cd4326516671afed18aeeca6d02c97db0b137715ab5c54f9588e55
|
|
BLAKE2b-256 checksum How to use checksums |
071babeaa52142222907d8be6bd6852e1b078f3bf68f448669efa7609684f5e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / architectlens-1.0.0-py3-none-any.whl
| Download URL | architectlens-1.0.0-py3-none-any.whl |
|---|---|
| Size | 39.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4dcdf1ed6301c595d145f607d2ae0bbb21008ca13477e91ae533c34eecb77e13
|
|
BLAKE2b-256 checksum How to use checksums |
c6b0c405af72be8ea6f501d08a577ab85263bd5336f78823d09cd1ac81afc26f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log