Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 20 variants Init, New { type_name: String, title: String, tags: String, status: String, features: String, reason: Option<String>, field: Vec<String>, }, Import { type_name: String, file: String, }, Show { id: String, refs: bool, }, List { type_name: Option<String>, tag: Option<String>, status: Option<String>, field: Vec<String>, format: ListFormat, }, Tags { keys: bool, }, SetStatus { ids: String, status: String, reason: Option<String>, }, Tag { ids: String, add: Option<String>, remove: Option<String>, }, Retire { ids: String, reason: String, }, Block { ids: String, by: String, }, Unblock { ids: String, by: String, }, Verify, Sync, Stats { plain: bool, }, Query { sql: String, plain: bool, stdin: bool, write: bool, }, Close { ids: String, force: bool, }, Renumber { base: Option<String>, }, Cleanup, Config(ConfigCommand), AgentRules { tool: AgentTool, stdout: bool, },
}

Variants§

§

Init

Bootstrap the inventory directory and config; print the CLAUDE.md snippet.

§

New

Create a document of a configured type with the next ID.

Fields

§type_name: String

Document type (configured in opys.toml; default feature).

§title: String
§tags: String

Comma-separated, kebab-case (required when the type requires tags).

§status: String

Defaults to the type’s default_status.

§features: String

Comma-separated IDs this document references (e.g. linked features).

§reason: Option<String>

Sets <status>_reason (e.g. wontfix/blocked/archived).

§field: Vec<String>

Custom field key=value (repeatable).

§

Import

Bulk-create documents of one type from a JSONL file (one JSON object per line), allocating sequential IDs and syncing once. Run verify after.

Fields

§type_name: String

Document type to create (configured in opys.toml; default feature).

§file: String

Path to a .jsonl file. Each line is an object with title and tags (required), optional status/custom fields, and an optional body (markdown placed under the title heading).

§

Show

Print a document.

Fields

§refs: bool

After the document, list textual references to its id found in code (scans [file_refs].roots, matching the configured id formats).

§

List

Filtered listing.

Fields

§type_name: Option<String>

Restrict to one document type.

§tag: Option<String>

Filter by tag. Matches an exact tag, or any tag with this key (the head before : or =, e.g. --tag area matches area:parsing and area=high).

§status: Option<String>
§field: Vec<String>

Filter by custom field: key=value (repeatable). Matches when the field equals the value (or, for list fields, contains it).

§format: ListFormat
§

Tags

List the distinct tags in the inventory, sorted, one per line.

Fields

§keys: bool

List distinct tag keys (the head before : / =) instead of full tags — pairs with list --tag <key>.

§

SetStatus

Guarded status transition. The id may be a comma-separated list to move several documents at once (same status/reason applied to each).

Fields

§ids: String

One id, a comma-separated list (e.g. FEAT-1,FEAT-2), or - to read the list from stdin (comma/space/newline-separated).

§status: String
§reason: Option<String>

Required when moving to wontfix.

§

Tag

Add/remove tags on one or more documents.

Fields

§ids: String

One id, a comma-separated list (e.g. FEAT-1,FEAT-2), or - to read the list from stdin (comma/space/newline-separated).

§remove: Option<String>
§

Retire

Delete one or more documents; each ID is logged and never reused.

Fields

§ids: String

One id, a comma-separated list (e.g. FEAT-1,FEAT-2), or - to read the list from stdin (comma/space/newline-separated).

§reason: String
§

Block

Mark one or more documents as blocked by another, linking both directions. Each blocked document is auto-set to blocked if its type has that status.

Fields

§ids: String

The blocked document’s id, a comma-separated list, or - for stdin.

§by: String

The blocking document’s ID.

§

Unblock

Remove a blocker link added by block from one or more documents.

Fields

§ids: String

One id, a comma-separated list (e.g. FEAT-1,FEAT-2), or - to read the list from stdin (comma/space/newline-separated).

§

Verify

Integrity check (CI gate).

§

Sync

Reconcile references, linkify prose, and relocate docs to their layout path (after hand edits).

§

Stats

Render the configured [[stats]] sections. Styled for a terminal; plain markdown when piped (or with --plain / NO_COLOR).

Fields

§plain: bool

Emit raw markdown instead of styled terminal output.

§

Query

Run a SQL query over the inventory and print the result table. Read-only (SELECT) by default; --write allows INSERT/UPDATE/DELETE. Styled for a terminal; plain markdown when piped (or with --plain / NO_COLOR).

Tables: docs(id, num, type, status, title, created, updated, body, path), tags(doc_id, seq, tag, key, value), relations(doc_id, field, seq, ref_id, ref_num, raw_value, title, struck), fields(doc_id, key, value), sections(doc_id, heading, kind, items, unchecked), blocks(doc_id, seq, heading, text), retired(id, num, title).

Fields

§sql: String

The SQL to run (- reads it from stdin). A SELECT by default; INSERT/UPDATE/DELETE require --write.

§plain: bool

Emit raw markdown instead of styled terminal output.

§stdin: bool

Bind a value read from stdin to $1 in the SQL — for large or multi-line values (e.g. a section body) without SQL-escaping; trailing whitespace is trimmed. Incompatible with sql = -.

§write: bool

Allow edit statements (INSERT/UPDATE/DELETE). Applied only if the edit introduces no new verify problem — otherwise nothing is written. Write the authoritative columns (docs.status/body/ created/updated, tags.tag, relations.raw_value, fm_fields.value_yaml); derived ones are recomputed. Setting blocks.text splices a ## section back into the body.

§

Close

Finish a document of a type with a terminal status: delete the file and strike its title in every referencing doc (the struck reference reserves the ID forever).

Fields

§ids: String

One id, a comma-separated list (e.g. FEAT-1,FEAT-2), or - to read the list from stdin (comma/space/newline-separated).

§force: bool

Close even if a required checklist section has unchecked items.

§

Renumber

Resolve ID conflicts between branches: keep IDs that existed at the git merge-base with main/master and renumber the ones added on this branch.

Fields

§base: Option<String>

The git ref to treat as the base (defaults to merge-base with main/master).

§

Cleanup

Strip struck-through (closed) references from every document.

§

Config(ConfigCommand)

Project configuration (generate/inspect the universal opys.toml).

§

AgentRules

Generate the always-on agent rule file for a rules-based editor (Cursor/Windsurf/Cline/Copilot/Kiro) from the canonical rule.

Fields

§stdout: bool

Print to stdout instead of writing the file(s).

Trait Implementations§

Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V