orstrum scan

Walk the repository AST and write the dependency graph to .orstrum/graph.db.

$ orstrum scan [--config <path>] [--force]

What it does

scan parses every file in the configured repos from a real AST — ts-morph for TypeScript/JavaScript and a tree-sitter WASM grammar for Python — not regex or line parsing. For TS/JS it resolves path aliases from tsconfig.json (when present) and follows barrel re-exports. The result (nodes, exports, and edges) is written to a local SQLite database at .orstrum/graph.db.

For Python it resolves dotted module paths against each of the repo's sourceRoots (then the repo root), handling __init__.py packages, relative from ..pkg import x imports, and PEP 420 namespace packages. Imports are collected at module top level plus one hop into if / try bodies, so TYPE_CHECKING guards and try/except ImportError fallbacks are covered while function-local imports are not. See Language support for the full rules and limitations.

No network access is required. The scanner runs entirely locally.

Incremental scanning

Each file's source bytes are hashed with SHA-256. On subsequent scans, only files whose hash has changed are re-parsed. Large repos typically re-scan in under a second after the initial build.

Options

--config <path>
string
Path to orstrum.config.ts. Defaults to auto-discovery from the current directory upward.
--force
flag
Re-parse all files regardless of hash. Use after upgrading Orstrum to ensure the graph format is current.

Output

$ orstrum scan

Scan complete
  scanned   : 847
  upserted  : 835
  unchanged : 12
  skipped   : 4 ignored, 2 non-source, 0 parse-error
  graph     : .orstrum/graph.db