Expand description
opys — a file-based inventory of typed markdown documents: one markdown file
per document, with YAML frontmatter, stable IDs, tags, configurable types,
test plans, and a verify gate for CI.
The binary is a thin wrapper around run. The modules are public so the
crate can be used as a library.
Re-exports§
pub use error::OpysError;pub use error::Result;pub use frontmatter::Frontmatter;pub use project::Project;
Modules§
- backend
- The storage backend seam.
- body
- Parsing of the markdown body: title, sections, and checklist items.
- cli
- Command-line interface (clap derive).
- commands
- Subcommand implementations. Each
runtakes the invocationCtxplus its parsed arguments. - config
- Shared field-spec types used by the universal config (
opys.toml). Seecrate::project_configfor the engine config. - doc
- A single inventory document in memory — the unified representation of every
configured type. This collapses the former
FeatureandWorkItem, which were identical{path, frontmatter, body, title}structs; a doc’s type is derived from its ID prefix via the config, not stored here. - error
- file_
refs - Scan source files for textual references to document ids.
- frontmatter
- Frontmatter parsing and canonical serialization.
- links
- Cross-reference auto-sync: keep every doc’s
referencesmap bidirectional and title-fresh, and rewrite bareFEAT-XXXX/WI-XXXXmentions in body prose into readable markdown links. Run bysyncafter every mutating command. - mdprism
- mdprism — markdown ⇄ data, via a template
- palette
- Configurable presentation rules for the TUI (
[palette]in opys.toml). - project
- The project:
opys.tomlat the project root (found by searching upward), plus the inventory base it points at (defaultopys/, holding the document files and_retired.txt). - project_
config - The universal typed-document config (
opys.toml) — the sole source of truth for the engine. - refs
- The uniform
referencesfield: an ID->title map linking a feature or work item to other features and work items. - retired
- The retired-id ledger:
_retired.md, a frontmatter map of reservedid -> title. Closing, retiring, renumbering, or deleting a document records its id here so the global id sequence never hands the number out again; the title is kept for human reference (git records the when and why). - rules
- The conditional validation-rules engine for the universal config.
- store
- The in-memory SQL store — the internal working representation of the
inventory. Markdown files remain the durable storage; per CLI invocation
the corpus is loaded and decomposed into GlueSQL tables (
schema), commands operate on those tables (plus reconstructedDocs for the Rust-side invariants: rules, linkify, mdprism), and [Store::flush] writes changed documents back to disk (create/rename/delete/ledger included). - templates
- String templates emitted by
opys initandopys agent-rules.
Structs§
- Ctx
- Shared invocation context: where the inventory lives, global flags, and the storage backend the commands load/flush through.
Functions§
- run
- Execute a parsed CLI invocation, returning the process exit code.