codetwin
Zero-config, language-agnostic CLI that turns any git repository into high-quality visual documentation — useful from first
git cloneto ongoing refactoring.
Status: v2 architecture scaffold. Phase 1 of
ROADMAP.mdis underway; the binary builds and runs end-to-end but drivers currently produce emptyCodeModels. See theTODO(Phase N.x)markers in the source for concrete work items.
Install
cargo install codetwin # crates.io
uv tool install codetwin # PyPI wrapper (native binary under the hood)
npm install -g codetwin # npm wrapper
All three package managers install the same native binary. The npm/PyPI wrappers bootstrap the
binary on first run via the cargo-dist installer.
Quick start
# Zero-config run — writes docs/architecture.md with the project-overview layout.
codetwin gen
# Inspect what CodeTwin detected.
codetwin list --drivers --layouts
# Re-render on every filesystem change.
codetwin gen --watch
# Dump the intermediate representation as JSON.
codetwin gen --dump-ir > codemodel.json
# Capture / diff architectural snapshots between commits.
codetwin snapshot --ref HEAD~5
codetwin diff HEAD~5 HEAD
Global flags work on every subcommand: --verbose, --quiet, -C/--cwd, --json.
Layouts
| Name | Audience | Status |
|---|---|---|
project-overview |
Developer who just cloned the repo | Scaffolded |
architecture-map |
Architect reviewing the system | Scaffolded |
c4 |
C4-model consumers | Phase 6.a |
metrics |
Coupling / circular-dep reporting | Phase 6.b |
codetwin list --layouts prints the live registry.
Configuration (codetwin.toml)
Everything is optional. See the checked-in codetwin.toml for an annotated
starting point.
source_dirs = ["src"]
output_file = "docs/architecture.md"
layout = "project-overview"
format = "markdown" # "html" is reserved for Phase 7
exclude_patterns = ["**/target/**", "**/node_modules/**"]
# Override auto-detected drivers:
# drivers = ["rust", "python"]
[[layers]]
name = "CLI"
patterns = ["src/cli/**"]
Development
Requires Rust 1.93+ (edition 2024).
cargo fmt --all
cargo clippy --all-targets -- -D warnings
cargo test --all
cargo run -- list # exercise the CLI
See tests/README.md for the testing cheatsheet (TDD + non-TDD workflows).
Release pipeline
cargo release → git-cliff → cargo-dist, with PyPI and npm wrapper workflows publishing
after GitHub Releases. This is out of roadmap scope.
Repository
- GitHub: https://github.com/carlosferreyra/codetwin
- Roadmap:
ROADMAP.md - Changelog:
CHANGELOG.md
License
MIT
Metadata
Release files for codetwin 0.2.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 | Provenance | Actions |
|---|---|---|---|---|
| codetwin-0.2.0.tar.gz | 2.8 kB | Without provenance | Details for codetwin-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codetwin-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for codetwin-0.2.0-py3-none-any.whl |
Total release size: 6.4 kB
Release files / codetwin-0.2.0.tar.gz
| Download URL | codetwin-0.2.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c6cbd5cc3db3891126631b2366c8de9486209e41f78e9bfa8ac812668564d7b
|
|
BLAKE2b-256 checksum How to use checksums |
e85dc0e01c2fb71f57da45c80db7fd3634d5b5f10ededd620e7054ae00786ec1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / codetwin-0.2.0-py3-none-any.whl
| Download URL | codetwin-0.2.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e667cc221ff105b4d906b3cc5c7a9c37244d3bd67112a6d1d8c8e333059bb79
|
|
BLAKE2b-256 checksum How to use checksums |
671a66d02820e3691642a56808ac696ec66de2df5a5cc6ea05c4d2b9ed88a37f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for codetwin 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.