Repo-native institutional memory CLI for Enterprise Architecture work.
Project description
cwmem
cwmem is a repo-native institutional memory CLI for Enterprise Architecture work.
It keeps fast operational state in SQLite, exports deterministic collaboration artifacts under memory/, and gives both humans and coding agents a consistent way to capture decisions, events, entities, and graph links inside a repository.
Who it is for
- AI coding agents that need a stable, scriptable memory layer next to the code they change
- Enterprise architects who want architecture decisions, milestones, and relationships stored in the repo
- Platform and delivery teams who need search, reviewable exports, and a shared institutional memory
What cwmem gives you
- entry CRUD with automatic lifecycle events
- tags, formal events, and entity / edge graph workflows
- lexical, semantic, hybrid, and graph-expanded retrieval
- deterministic
sync export/sync importfor checked-in artifacts - dry-run, idempotency keys, sidecar locking,
plan,validate,apply, andverify - a machine-first JSON-envelope CLI with human-readable help and version output
Installation
With pip:
pip install cwmem
With uv:
uv tool install cwmem
Check the installed version:
cwmem --version
Quick start
POSIX shells
# Initialize the repository memory surfaces
cwmem init
# Capture a decision or note
cwmem add --title "Adopt repo-native memory" --type decision \
"Store architectural context alongside the codebase."
# Or pipe a plain-text body explicitly
printf 'Store architectural context alongside the codebase.' | \
cwmem add --title "Adopt repo-native memory" --type decision --body-from-stdin
# Search and inspect what you stored
cwmem search "repo-native memory"
cwmem list
# Add structure with entities and graph edges
cwmem entity-add --entity-type system --name "cwmem"
cwmem link mem-000001 ent-000001 --relation references
# Refresh derived state when needed, then export and verify consistency
cwmem build
cwmem sync export
cwmem sync export --check
cwmem verify
PowerShell
# Initialize repository memory surfaces
cwmem init
# Capture a decision
cwmem add --title "Adopt repo-native memory" --type decision `
"Store architectural context alongside the codebase."
# Or pipe a plain-text body explicitly
Get-Content .\note.txt -Raw | `
cwmem add --title "Imported note" --type note --body-from-stdin
# Read JSON envelopes naturally in PowerShell
cwmem search "repo-native memory" | ConvertFrom-Json
# Refresh derived state when needed, then export and verify
cwmem build
cwmem sync export
cwmem verify
Without --body-from-stdin, piped stdin is reserved for JSON object input when
cwmem add is driven machine-to-machine.
How cwmem fits into a repository
cwmem keeps two views of the same memory system:
- runtime state in
.cwmem/for SQLite, indexes, lock files, and generated plans - tracked collaboration artifacts in
memory/for review, sync, and git history
The main tracked surfaces are:
memory/entries/memory/events/memory/graph/memory/taxonomy/memory/manifests/
This split gives you fast local operations without giving up reviewable, deterministic files in version control.
Core workflow
For everyday memory capture:
cwmem init
cwmem add --title "Architecture decision" --type decision "Capture the rationale."
cwmem event-add --event-type milestone "MVP shipped"
cwmem search "architecture decision"
cwmem related mem-000001
cwmem build
cwmem sync export
cwmem verify
After mutations that affect derived search state or tracked artifacts, the common
safe path is cwmem build, then cwmem sync export, then cwmem verify.
For higher-risk workflows that should be reviewed before mutating state:
cwmem plan sync-import --plan-out .cwmem/plans/import-plan.json
cwmem validate --plan .cwmem/plans/import-plan.json
cwmem apply --plan .cwmem/plans/import-plan.json
cwmem verify
Safety model
Every command writes exactly one JSON envelope to stdout. That makes the CLI easy to automate, inspect, and pipe into other tooling.
Reads are parallel-safe. Mutating commands serialize through .cwmem/memory.sqlite.lock and support safety flags such as:
--dry-run--idempotency-key--wait-lock--plan-out
Use cwmem guide when you want the machine-readable command catalog, schema information, and workflow contract.
Command groups
| Command | What it is for |
|---|---|
cwmem guide |
Machine-readable CLI contract and workflow metadata |
cwmem init / status |
Bootstrap and inspect repository memory surfaces |
cwmem add, update, tag-add, event-add, entity-add, link |
Capture or mutate memory records |
cwmem get, list, search, related, graph, log |
Read, retrieve, search, and traverse memory |
cwmem sync export / sync import |
Move between SQLite runtime state and checked-in artifacts |
cwmem build, stats, validate, plan, apply, verify |
Rebuild derived data, inspect health, and run safe workflows |
Deterministic collaboration surface
cwmem sync export writes a deterministic memory/ tree so that:
- pull requests can review memory changes like code changes
- the runtime database can be reconstructed from tracked artifacts
- CI can detect drift with
cwmem sync export --check
This makes architecture memory auditable rather than hidden in a local database.
Local quality gate
Run this before opening a PR or cutting a release:
uv run ruff check src tests
uv run pyright src
uv run pytest --tb=short
uv build
Release automation
- CI workflow:
.github/workflows/ci.yml - Publish workflow:
.github/workflows/publish.yml - Contributor guide:
CONTRIBUTING.md - Agent expectations:
AGENTS.md
PyPI publishing uses GitHub OIDC Trusted Publisher with the pypi environment and publishes automatically on pushes to master.
Repository docs
README.md— product overview and quick startCONTRIBUTING.md— local development and release checklistAGENTS.md— agent expectations and workflow conventions
If you want the CLI to explain itself interactively, start with:
cwmem --help
cwmem guide
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cwmem-0.2.3.tar.gz.
File metadata
- Download URL: cwmem-0.2.3.tar.gz
- Upload date:
- Size: 56.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d97120b5b71b91d4fd925b390637c505cdc398f5321af6af62fb382fb64368ae
|
|
| MD5 |
f0d6a431b483b84c42084ac2f9736925
|
|
| BLAKE2b-256 |
712054d10f64e5ac706713be5455a61f0caeaca0d631e1f2f506ec0863cb3a3c
|
Provenance
The following attestation bundles were made for cwmem-0.2.3.tar.gz:
Publisher:
publish.yml on ThomasRohde/cwmem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cwmem-0.2.3.tar.gz -
Subject digest:
d97120b5b71b91d4fd925b390637c505cdc398f5321af6af62fb382fb64368ae - Sigstore transparency entry: 1102553940
- Sigstore integration time:
-
Permalink:
ThomasRohde/cwmem@2f55850018e3e6fa97ea9d5697d06497967f259b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/ThomasRohde
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2f55850018e3e6fa97ea9d5697d06497967f259b -
Trigger Event:
push
-
Statement type:
File details
Details for the file cwmem-0.2.3-py3-none-any.whl.
File metadata
- Download URL: cwmem-0.2.3-py3-none-any.whl
- Upload date:
- Size: 28.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
037323c0eb82465976b2ee72729ffa3ce096879bf7e24437dd5e6f604fcc65d8
|
|
| MD5 |
d69becdb525602abf2edbc0b25a1a695
|
|
| BLAKE2b-256 |
3759be6d9489587f17d2bfbd61985559f4ee52d99e6137972869b07d35581609
|
Provenance
The following attestation bundles were made for cwmem-0.2.3-py3-none-any.whl:
Publisher:
publish.yml on ThomasRohde/cwmem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cwmem-0.2.3-py3-none-any.whl -
Subject digest:
037323c0eb82465976b2ee72729ffa3ce096879bf7e24437dd5e6f604fcc65d8 - Sigstore transparency entry: 1102553941
- Sigstore integration time:
-
Permalink:
ThomasRohde/cwmem@2f55850018e3e6fa97ea9d5697d06497967f259b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/ThomasRohde
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2f55850018e3e6fa97ea9d5697d06497967f259b -
Trigger Event:
push
-
Statement type: