Skip to content

CLI Command Reference

This file is auto-generated from CLI command definitions. Do not edit manually. Run nx generate-docs riviere-cli to regenerate.

Complete documentation for all Riviere CLI commands.

Installation

bash
npm install @living-architecture/riviere-cli

Usage

bash
riviere builder <command> [options]  # Graph building commands
riviere query <command> [options]    # Graph query commands

Exit Codes

  • 0: Success (including warnings)
  • 1: Error or failed validation/consistency

Builder Commands

Commands for constructing architecture graphs.

add-component

Add a component to the graph

bash
riviere builder add-component [options]

Required:

FlagDescription
--type <type>Component type (UI, API, UseCase, DomainOp, Event, EventHandler, Custom)
--name <name>Component name
--domain <domain>Domain name
--module <module>Module name
--repository <url>Source repository URL
--file-path <path>Source file path
--route <route>UI route path
--api-type <type>API type (REST, GraphQL, other)
--http-method <method>HTTP method
--http-path <path>HTTP endpoint path
--operation-name <name>Operation name (DomainOp)
--entity <entity>Entity name (DomainOp)
--event-name <name>Event name
--subscribed-events <events>Comma-separated subscribed event names
--custom-type <name>Custom type name
--description <desc>Component description
--line-number <n>Source line number
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
# Add an API endpoint
riviere builder add-component --type API --name "place-order" \
  --domain orders --module api --repository ecommerce \
  --file-path src/api/orders.ts --api-type REST \
  --http-method POST --http-path /orders
# Add a UseCase
riviere builder add-component --type UseCase --name "place-order" \
  --domain orders --module checkout --repository ecommerce \
  --file-path src/usecases/PlaceOrder.ts
# Add a DomainOp
riviere builder add-component --type DomainOp --name "order-begin" \
  --domain orders --module domain --repository ecommerce \
  --file-path src/domain/Order.ts --entity Order --operation-name begin
# Add an Event
riviere builder add-component --type Event --name "order-placed" \
  --domain orders --module events --repository ecommerce \
  --file-path src/events/OrderPlaced.ts --event-name "order-placed"

add-domain

Add a domain to the graph

bash
riviere builder add-domain [options]

Required:

FlagDescription
--name <name>Domain name
--description <description>Domain description
--system-type <type>System type (domain, bff, ui, other)
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder add-domain --name orders --system-type domain \
  --description "Order management"
riviere builder add-domain --name checkout-bff --system-type bff \
  --description "Checkout backend-for-frontend"

add-source

Add a source repository to the graph

bash
riviere builder add-source [options]

Required:

FlagDescription
--repository <url>Source repository URL
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder add-source --repository https://github.com/org/orders-service
riviere builder add-source --repository https://github.com/org/payments-api --json

init

Initialize a new graph

bash
riviere builder init [options]

Required:

FlagDescription
--name <name>System name
--graph <path>Custom graph file path (default: .riviere/graph.json)
--source <url>Source repository URL (repeatable)
--domain <json>Domain as JSON (repeatable)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder init --source https://github.com/org/repo \
  --domain '{"name":"orders","description":"Order management","systemType":"domain"}'
riviere builder init --name "ecommerce" \
  --source https://github.com/org/orders \
  --source https://github.com/org/payments \
  --domain '{"name":"orders","description":"Order management","systemType":"domain"}' \
  --domain '{"name":"payments","description":"Payment processing","systemType":"domain"}'

Link two components

bash
riviere builder link [options]

Required:

FlagDescription
--from <component-id>Source component ID
--to-domain <domain>Target domain
--to-module <module>Target module
--to-type <type>Target component type (UI, API, UseCase, DomainOp, Event, EventHandler, Custom)
--to-name <name>Target component name
--link-type <type>Link type (sync, async)
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder link \
  --from "orders:api:api:postorders" \
  --to-domain orders --to-module checkout --to-type UseCase --to-name "place-order" \
  --link-type sync
riviere builder link \
  --from "orders:checkout:domainop:orderbegin" \
  --to-domain orders --to-module events --to-type Event --to-name "order-placed" \
  --link-type async

Link a component to an external system

bash
riviere builder link-external [options]

Required:

FlagDescription
--from <component-id>Source component ID
--target-name <name>External target name
--target-domain <domain>External target domain
--target-url <url>External target URL
--link-type <type>Link type (sync, async)
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder link-external \
  --from "payments:gateway:usecase:processpayment" \
  --target-name "Stripe" \
  --target-url "https://api.stripe.com" \
  --link-type sync
riviere builder link-external \
  --from "shipping:tracking:usecase:updatetracking" \
  --target-name "FedEx API" \
  --target-domain "shipping" \
  --link-type async

Find an API by HTTP path and link to a target component

bash
riviere builder link-http [options]

Required:

FlagDescription
--path <http-path>HTTP path to match
--to-domain <domain>Target domain
--to-module <module>Target module
--to-type <type>Target component type
--to-name <name>Target component name
--method <method>Filter by HTTP method (GET, POST, PUT, PATCH, DELETE)
--link-type <type>Link type (sync, async)
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder link-http \
  --path "/orders" --method POST \
  --to-domain orders --to-module checkout --to-type UseCase --to-name "place-order"
riviere builder link-http \
  --path "/users/{id}" --method GET \
  --to-domain users --to-module queries --to-type UseCase --to-name "get-user" \
  --link-type sync

validate

Validate the graph for errors and warnings

bash
riviere builder validate [options]

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder validate
riviere builder validate --json
riviere builder validate --graph .riviere/my-graph.json

finalize

Validate and export the final graph

bash
riviere builder finalize [options]

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)
--output <path>Output path for finalized graph (defaults to input path)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder finalize
riviere builder finalize --output ./dist/architecture.json
riviere builder finalize --json

enrich

Enrich a DomainOp component with entity, state changes, and business rules

bash
riviere builder enrich [options]

Required:

FlagDescription
--id <component-id>Component ID to enrich
--entity <name>Entity name
--state-change <from:to>State transition (repeatable)
--business-rule <rule>Business rule (repeatable)
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder enrich \
  --id "orders:checkout:domainop:orderbegin" \
  --entity Order \
  --state-change "Draft:Placed" \
  --business-rule "Order must have at least one item"
riviere builder enrich \
  --id "payments:gateway:domainop:paymentprocess" \
  --state-change "Pending:Processing" \
  --state-change "Processing:Completed" \
  --business-rule "Amount must be positive" \
  --business-rule "Currency must be valid"

component-summary

Show component counts by type and domain

bash
riviere builder component-summary [options]

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder component-summary
riviere builder component-summary --json

component-checklist

List components as a checklist for linking/enrichment

bash
riviere builder component-checklist [options]

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)
--type <type>Filter by component type

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder component-checklist
riviere builder component-checklist --type DomainOp
riviere builder component-checklist --type API --json

check-consistency

Check for structural issues in the graph

bash
riviere builder check-consistency [options]

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere builder check-consistency
riviere builder check-consistency --json

Query Commands

Commands for analyzing and querying graphs.

entry-points

List entry points (APIs, UIs, EventHandlers with no incoming links)

bash
riviere query entry-points [options]

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere query entry-points
riviere query entry-points --json

domains

List domains with component counts

bash
riviere query domains [options]

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere query domains
riviere query domains --json

trace

Trace flow from a component (bidirectional)

bash
riviere query trace <componentId> [options]

Arguments:

ArgumentDescription
<componentId>Component ID to trace from

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere query trace "orders:api:api:postorders"
riviere query trace "orders:checkout:usecase:placeorder" --json

orphans

Find orphan components with no links

bash
riviere query orphans [options]

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere query orphans
riviere query orphans --json

components

List components with optional filtering

bash
riviere query components [options]

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)
--domain <name>Filter by domain name
--type <type>Filter by component type

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere query components
riviere query components --domain orders
riviere query components --type API --json
riviere query components --domain orders --type UseCase

Search components by name

bash
riviere query search <term> [options]

Arguments:

ArgumentDescription
<term>Search term

Required:

FlagDescription
--graph <path>Custom graph file path (default: .riviere/graph.json)

Optional:

FlagDescription
--jsonOutput result as JSON

Examples:

bash
riviere query search order
riviere query search "place-order" --json

See Also