Authority: E-ADR-004 (RSS CLI Implementation for Developer-Invoked Graph Traversal)
Audience: Human developers
Version: 1.0.0
This document covers the CLI interface for human developers.
If you are an AI coding assistant (Cursor, Copilot, etc.), use the programmatic TypeScript API instead of the CLI. The programmatic API provides:
- Structured data (typed objects, not parsed terminal output)
- Faster execution (no process spawning)
- Better integration with tooling
See RSS-PROGRAMMATIC-API.md for the machine interface.
RSS (Runtime State Slicing) provides semantic graph traversal over AI-DOC state generated by RECON. RSS is a graph traversal protocol for deterministic context assembly that starts at entry points and traverses explicit references with depth bounds. Instead of grep-searching raw source code, RSS lets you query a pre-indexed semantic graph of:
- Modules - Source files with exports, imports, and relationships
- Functions - Callable units with signatures and dependencies
- Classes - Type definitions with methods and properties
- API Endpoints - REST/GraphQL endpoints with handlers
- Data Entities - Database tables, schemas, models
- Infrastructure - CloudFormation resources, parameters, outputs
- Frontend Components - Angular/React components, services, routes
- Design Tokens - CSS variables, breakpoints, animations
Key Insight: RSS trades grep's O(n) full-codebase search for O(1) semantic lookups with relationship traversal.
-
Run RECON first to generate semantic state:
cd ste-runtime npm run recon:full -
Verify state exists:
node dist/cli/rss-cli.js stats
# From ste-runtime directory:
node dist/cli/rss-cli.js <command> [args] [options]
# Or with npm script:
npm run rss -- <command> [args]Purpose: Get an overview of what's in the semantic graph before querying.
node dist/cli/rss-cli.js statsOutput:
Graph Statistics
================
Total nodes: 850
graph/module: 120
graph/function: 380
graph/class: 45
api/endpoint: 32
data/entity: 15
infrastructure/resource: 180
infrastructure/template: 8
frontend/component: 40
frontend/service: 18
...
Total edges: 920
Tags: 1,150
When to use: Start here to understand the codebase structure and what domains are populated.
Purpose: Find relevant nodes using natural language. This is your starting point for exploration.
node dist/cli/rss-cli.js search "user authentication"
node dist/cli/rss-cli.js search "order processing"
node dist/cli/rss-cli.js search "DynamoDB table"Options:
--max=N- Limit results (default: 50)
Output: Ranked list of nodes matching the query, with relevance scores.
When to use: When you don't know the exact component name but know the concept.
Purpose: Get full details of a specific node by key or domain/id.
# By full key
node dist/cli/rss-cli.js lookup graph/function/src-services-auth.ts-validateToken
# By domain and ID
node dist/cli/rss-cli.js lookup graph/function validateTokenOutput: Complete node data including:
- Semantic metadata (domain, type, tags)
- Source attribution (file, lines, checksum)
- Relationships (imports, dependencies)
- Full extracted content
When to use: When you know the exact component and need its details.
Purpose: What does this component depend on? (Outgoing edges)
node dist/cli/rss-cli.js dependencies graph/module/src-services-user-service.ts
node dist/cli/rss-cli.js dependencies graph/function/createOrder --depth=3Options:
--depth=N- How many hops to traverse (default: 2)
Output: Tree of dependencies showing what the target imports/calls/uses.
When to use: Understanding what a component needs to function.
Purpose: What depends on this component? (Incoming edges)
node dist/cli/rss-cli.js dependents data/entity/UsersTable
node dist/cli/rss-cli.js dependents graph/function/validateToken --depth=2Options:
--depth=N- How many hops to traverse (default: 2)
Output: Tree of dependents showing what uses/imports/calls the target.
When to use: Understanding impact - "if I change this, what else is affected?"
Purpose: Full impact surface - both what this depends on AND what depends on it.
node dist/cli/rss-cli.js blast-radius data/entity/OrdersTable
node dist/cli/rss-cli.js blast-radius graph/module/src-api-users.py --depth=3Options:
--depth=N- How many hops in each direction (default: 2)
Output: Combined tree showing complete impact surface.
When to use: Planning changes - understand the full ripple effect before modifying.
Purpose: Find all nodes with a specific tag, regardless of domain.
node dist/cli/rss-cli.js by-tag "backend:api"
node dist/cli/rss-cli.js by-tag "dynamodb"
node dist/cli/rss-cli.js by-tag "frontend:component"
node dist/cli/rss-cli.js by-tag "angular"Common tags:
backend:api,backend:lambda,backend:handlerfrontend:component,frontend:service,frontend:guardinfrastructure:dynamodb,infrastructure:lambda,infrastructure:apigatewaypython,typescript,cloudformation,angular
When to use: Discovering all components of a certain type across the codebase.
Purpose: Natural language query that assembles a complete context bundle for a task.
node dist/cli/rss-cli.js context "implement user authentication"
node dist/cli/rss-cli.js context "add order status tracking"
node dist/cli/rss-cli.js context "create new API endpoint for notifications"Output: Assembled bundle containing:
- Relevant modules and functions
- Data entities involved
- API endpoints related
- Infrastructure resources
- Suggested entry points for implementation
When to use: Starting a new feature - get everything you need in one query.
Human-readable tabular output with colors:
node dist/cli/rss-cli.js search "users" --format=tableMachine-readable JSON for scripting or AI consumption:
node dist/cli/rss-cli.js search "users" --jsonAbbreviated output for quick scanning:
node dist/cli/rss-cli.js search "users" --compact# 1. Understand the shape of the codebase
node dist/cli/rss-cli.js stats
# 2. Find the main domains
node dist/cli/rss-cli.js by-tag "backend:api"
node dist/cli/rss-cli.js by-tag "frontend:component"
# 3. Search for key concepts
node dist/cli/rss-cli.js search "authentication"
node dist/cli/rss-cli.js search "dashboard"
# 4. Drill into specific components
node dist/cli/rss-cli.js lookup graph/module/src-services-auth-service.ts# 1. Get context for the feature
node dist/cli/rss-cli.js context "add email notifications for orders"
# 2. Find existing related components
node dist/cli/rss-cli.js search "notification"
node dist/cli/rss-cli.js search "email"
# 3. Understand the data model
node dist/cli/rss-cli.js by-tag "data:entity"
node dist/cli/rss-cli.js lookup data/entity/OrdersTable
# 4. Find API endpoints to extend
node dist/cli/rss-cli.js by-tag "api:endpoint"
# 5. Check blast radius of changes
node dist/cli/rss-cli.js blast-radius data/entity/OrdersTable# 1. Find the component to refactor
node dist/cli/rss-cli.js search "processOrder"
# 2. Get its full details
node dist/cli/rss-cli.js lookup graph/function/processOrder
# 3. See what depends on it
node dist/cli/rss-cli.js dependents graph/function/processOrder --depth=3
# 4. See what it depends on
node dist/cli/rss-cli.js dependencies graph/function/processOrder --depth=2
# 5. Full blast radius
node dist/cli/rss-cli.js blast-radius graph/function/processOrder --depth=3# All API endpoints
node dist/cli/rss-cli.js by-tag "api:endpoint"
# All DynamoDB tables
node dist/cli/rss-cli.js by-tag "infrastructure:dynamodb"
# All Angular components
node dist/cli/rss-cli.js by-tag "frontend:component"
# All Angular services
node dist/cli/rss-cli.js by-tag "frontend:service"
# All Lambda handlers
node dist/cli/rss-cli.js by-tag "backend:handler"When exploring a codebase to complete a task:
- Start with
stats- Understand graph shape and available domains - Use
searchorcontext- Find entry points for the task - Use
by-tag- Find all components of a type - Use
lookup- Get details of specific components - Use
blast-radius- Understand impact before proposing changes - Use
dependencies/dependents- Trace relationships
| Grep | RSS |
|---|---|
| Searches raw text | Searches semantic meaning |
| Returns line matches | Returns structured entities |
| No relationship awareness | Full dependency graph |
| O(n) scan of all files | O(1) indexed lookup |
| Results need interpretation | Results are pre-parsed |
With RSS:
# Find existing endpoints as examples
node dist/cli/rss-cli.js by-tag "api:endpoint" --max=5
# See how an endpoint connects to handlers
node dist/cli/rss-cli.js dependencies api/endpoint/GET-/users
# Find the infrastructure template
node dist/cli/rss-cli.js search "API Gateway"
# Get the data model
node dist/cli/rss-cli.js by-tag "data:entity"Without RSS (grep):
# Many grep calls needed
grep -r "def get_" backend/
grep -r "AWS::ApiGateway" infrastructure/
grep -r "Type.*Table" infrastructure/
# ...must read each file to understand relationshipsIf you need raw slice data, read from .ste/state/:
.ste/state/
├── graph/
│ ├── modules/ # Module-level slices
│ ├── functions/ # Function-level slices
│ └── classes/ # Class-level slices
├── api/
│ └── endpoints/ # API endpoint slices
├── data/
│ └── entities/ # Data model slices
├── infrastructure/
│ ├── resources/ # CloudFormation resources
│ ├── templates/ # Template metadata
│ ├── parameters/ # Stack parameters
│ └── outputs/ # Stack outputs
└── frontend/
├── component/ # Angular/React components
├── service/ # Services
└── styles/ # CSS/design tokens
Slice files are YAML with consistent structure:
_slice:
id: "function:path/to/file.py:function_name"
domain: "backend"
type: "function"
tags: ["backend:lambda", "python", "handler"]
_source:
files: ["path/to/file.py"]
line_start: 42
line_end: 95
checksum: "abc123..."
# ... semantic content ...Run RECON first:
cd ste-runtime
npm run recon:full- Check if RECON completed successfully
- Verify the state directory has content:
ls .ste/state/ - Try broader search terms
- Use
statsto see what's indexed
- Check
ste.config.jsonincludes all source directories - Verify languages are configured correctly
- Re-run RECON with
--mode=full
RSS operates on the semantic state generated by RECON:
Source Code → [RECON] → .ste/state/ → [RSS] → Query Results
Keep state fresh: Re-run RECON after significant code changes:
npm run recon- RECON-README.md - How to generate semantic state
- recon-incremental.md - Incremental mode internals