Saedra Docs
CLI

Context & Analysis

Print and share architecture context for AI prompts and onboarding

saedra context

Print a compressed architecture context designed to be injected into AI prompts. Fetches the architecture state, active decisions, the 5 most recent change events, and all violation rules in parallel, then formats them as a single block.

$ saedra context
Using project: my-infra (from .saedra)

  [ARCHITECTURE CONTEXT — my-infra]

  Summary:
    Monorepo (Turborepo + pnpm) with auth, project management, and AI via AWS Bedrock.

  Core Principles:
    - TypeScript strict across all packages
    - Supabase as single source of truth
    - CLI stateless except ~/.saedra/config.json

  Critical Paths:
    - apps/api project-service db-queries db-connector Supabase

  Constraints:
    - Node.js >= 18
    - No direct DB access from CLI

  Active Decisions (2):
    - DEC-2026-03-04-use-document-type-fie
    - DEC-2026-03-09-use-supabase-as-primary-databa

  Recent Changes (3):
    - CHG-2026-03-06-add-git-hook-support Add git hook support
    - CHG-2026-03-05-add-memory-change-comm Add memory change commands to CLI
    - CHG-2026-03-04-add-type-column Add type column to documents table

  Violation Rules (1):
    - RULE-2026-03-23-controllers-cannot-impor [HIGH] — Controllers cannot import db-connector directly

saedra context --json

Output the full context as JSON. Useful for piping into other tools or feeding into AI APIs programmatically.

$ saedra context --json
{
  "project": "my-infra",
  "state": { "summary": "...", "core_principles": [...], ... },
  "decisions": [...],
  "changes": [...],
  "rules": [...]
}

saedra context --copy

Copy the context output directly to the clipboard instead of printing it. Useful for pasting into AI chat interfaces without piping or selecting text.

$ saedra context --copy
Using project: my-infra (from .saedra)

  Context copied to clipboard. (my-infra)

On Linux requires xclip, xsel, or wl-clipboard to be installed.

saedra context --offline

Use the local .saedra-context.json snapshot instead of fetching from the server. Same fallback behavior as saedra review --offline.

$ saedra context --offline

saedra explain

Print a human-readable architecture overview. Same data as saedra context but formatted for onboarding new developers or quickly understanding an unfamiliar repository.

$ saedra explain
Using project: my-infra (from .saedra)

  my-infra Architecture Overview

  What is this project?
    Monorepo (Turborepo + pnpm) with auth, project management, and AI via AWS Bedrock.

  Communication Patterns:
    - apps/api project-service db-queries db-connector Supabase

  Core Principles:
    - TypeScript strict across all packages
    - Supabase as single source of truth

  Constraints:
    - Node.js >= 18
    - No direct DB access from CLI

  Key Decisions:
    - Use document type field for memory (DEC-2026-03-04-use-document-type-fie)
    - Use Supabase as primary database (DEC-2026-03-09-use-supabase-as-primary-databa)

  Recent Changes:
    - [2026-03-06] Add git hook support
    - [2026-03-05] Add memory change commands to CLI
    - [2026-03-04] Add type column to documents table

saedra timeline

Show a chronological timeline of all architectural decisions and change events, grouped by month.

$ saedra timeline
Using project: my-infra (from .saedra)

  Architecture Timeline my-infra

  2026-03
    [DEC] Use document type field for memory
    [CHG] Add type column to documents table
    [CHG] Add memory change commands to CLI
    [DEC] Use Supabase as primary database
    [CHG] Add git hook support

Entries are sorted chronologically within each month. [DEC] entries come from saedra memory decision add and [CHG] entries from saedra memory change log.