contextia show
Questi contenuti non sono ancora disponibili nella tua lingua.
contextia show displays a single Contextia artifact by its ID. It supports progressive disclosure through depth levels and can optionally show code locations that reference the artifact via annotations.
Synopsis
Section titled “Synopsis”contextia show <id> [OPTIONS]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
id | Artifact ID: SPEC-*, NORM-*, DEC-*, or TASK-* |
Options
Section titled “Options”| Option | Short | Description |
|---|---|---|
--depth <level> | -d | Detail level: meta, summary, full (default: full) |
--implementations | -i | Show @spec and @decision references found in code |
--format <fmt> | -f | Output format: human, json, context |
--json | -j | Shorthand for --format json |
--help | -h | Show help and exit |
Depth levels
Section titled “Depth levels”The --depth option controls how much of the artifact is displayed, supporting progressive disclosure:
meta — Frontmatter fields only. Useful for quick lookups and index-building.
$ contextia show SPEC-AUTH-001 --depth metaSPEC-AUTH-001: Authentication Flow status: approved paths: src/auth/**, src/middleware/auth.py links: DEC-002, NORM-SEC-001 created: 2025-11-15summary — Frontmatter plus the first section of the document body.
$ contextia show SPEC-AUTH-001 --depth summarySPEC-AUTH-001: Authentication Flow status: approved paths: src/auth/**, src/middleware/auth.py links: DEC-002, NORM-SEC-001
## OverviewUsers authenticate via OAuth 2.0 with PKCE. The auth module handlestoken issuance, refresh, and revocation. All protected endpointsrequire a valid access token in the Authorization header.full (default) — The entire document including all sections.
Implementations flag
Section titled “Implementations flag”The --implementations flag triggers a scan of the codebase for annotation references to the given artifact:
$ contextia show SPEC-AUTH-001 --implementationsSPEC-AUTH-001: Authentication Flow status: approved
## Implementations src/auth/oauth.py:12 # @spec SPEC-AUTH-001 – OAuth client setup src/auth/tokens.py:45 # @spec SPEC-AUTH-001 – Token validation src/middleware/auth.py:8 # @spec SPEC-AUTH-001 – Auth middleware tests/test_auth.py:3 # @test SPEC-AUTH-001 – Auth test suiteThis reads the annotations.prefix and comment_syntax settings from config.yaml to locate annotations across all configured languages.
Examples
Section titled “Examples”Show a decision record:
$ contextia show DEC-002DEC-002: OAuth 2.0 with PKCE over API keys status: accepted specs: SPEC-AUTH-001 created: 2025-10-20
## ContextWe need an authentication mechanism for the public API...
## DecisionUse OAuth 2.0 with PKCE for all client authentication...
## Consequences- Token refresh adds complexity to client implementations- PKCE eliminates the need for client secrets in SPAsShow a norm in JSON format:
$ contextia show NORM-SEC-001 --json{ "id": "NORM-SEC-001", "title": "No secrets in source code", "scope": "**/*", "enforcement": "error", "body": "All secrets must be loaded from environment variables..."}Show a task at meta depth:
$ contextia show TASK-007 --depth metaTASK-007: Implement OAuth login kind: feature status: active specs: SPEC-AUTH-001 created: 2026-02-28Context format for LLM consumption:
$ contextia show SPEC-AUTH-001 --format context[SPEC-AUTH-001] Authentication Flow (approved)paths: src/auth/**, src/middleware/auth.pylinks: DEC-002, NORM-SEC-001---Users authenticate via OAuth 2.0 with PKCE. The auth module handlestoken issuance, refresh, and revocation.Behavior
Section titled “Behavior”- If the ID does not match any artifact, the command exits with code 1 and prints an error to stderr.
- The
--implementationsflag requires a code scan and may be slower on large codebases. Results are cached in.contextia/.cache/after the first run. - The
--depthflag has no effect when--jsonis used; JSON output always includes all fields.