auth.ts — orstrum
EXPLORER
▾ src
▾ api
auth.ts
login.ts
▾ utils
jwt.ts
types.ts
▾ middleware
guard.ts
cors.ts
▾ hooks
useAuth.ts
useSession.ts
auth.ts
userService.ts
guard.ts
1import { createClient } from '@supabase/supabase-js'
2import { AuthUser, Session } from './types'
3
4export async function signIn(
5 email: string,
6 password: string
7): Promise<Session> {
8 const { data, error } = await
9 supabase.auth.signInWithPassword({
10 email, password
11 })
12 if (error) throw error
13 return data.session
14}
TERMINAL OUTPUT
$ orstrum scan
↳ resolved 3 path aliases
↳ parsed 847 files
4,203 import edges
graph.db written 2.1 MB
MCP get_importers
"src/api/auth.ts"
3 callers
api/login.ts
middleware/guard.ts
hooks/useAuth.ts
src/api/auth.ts
14 imports · 3 callers

Scan once.
Query forever.

Orstrum walks your TypeScript repository and builds a structured impact graph — every file, every export, every import edge. Serve it through MCP. Your agent gets a database query instead of a file-system expedition.

$ npm install -g orstrum

Three commands. Complete codebase intelligence.

$ orstrum scan
↳ resolved 3 path aliases
↳ parsed 847 files
4,203 edges
graph.db 2.1 MB
01 orstrum scan

Build the graph

Walks your repository with a full AST parser and tsconfig awareness. Resolves path aliases and barrel re-exports — building the complete dependency graph in a local SQLite database. No network required.

$ orstrum push
local
source.ts
utils.ts
api.ts
cloud
graph.db
847 nodes synced in 1.2s
02 orstrum push

Sync to the cloud

Uploads the graph to your cloud workspace. Only structure leaves your machine: file paths, export signatures, import edges, and optional purpose summaries. Raw source is never transferred.

$ orstrum serve
MCP server ready on :3000
orstrum_get_callers
"src/api/auth.ts"
["login.ts",
"guard.ts",
"useAuth.ts"]
03 orstrum serve

Query on demand

Starts the MCP server against your local graph or cloud workspace. Any MCP-compatible agent — Claude Code or your own — queries eight tools. "Who imports this file?" is one call, not fifty sequential greps.

Structure and meaning,
not source.

Orstrum extracts four entity types: repositories, files (nodes), exports, and import edges. Each edge captures the resolved dependency — not a text approximation. Barrel re-exports and TypeScript path aliases are traced through the AST, not grepped.

Each file can carry a purpose summary: an LLM-generated description of what the file does and why it exists. Summaries are computed once and stored, not regenerated on every query. A compromised cloud instance exposes an architectural map, not your codebase.

Read the schema
auth.ts — orstrum
SOURCE ✕ not stored
1import { createClient } from '@supabase/supabase-js'
2import { AuthUser } from './types'
3
4export async function signIn(
5 email: string,
6 password: string
7): Promise<Session> {
8 // ···
9}
10
11export async function signOut() {
12 // ···
13}
extract
GRAPH ✓ stored
src/api/auth.ts
exports
fnsignIn
fnsignOut
imports
pkg@supabase/supabase-js
rel./types
callers 3
api/login.ts
middleware/guard.ts
hooks/useAuth.ts
PURPOSE
Handles auth flows: sign-in, sign-out, and session access via Supabase Auth.
847 nodes · 4,203 edges
Cursor — Chat
You
which files depend on auth.ts?
AI

I'll check the dependency graph.

orstrum · get_importers
path = "src/api/auth.ts"

Found 3 files that import auth.ts:

api/login.ts
middleware/guard.ts
hooks/useAuth.ts
Ask anything about your codebase…
Claude Code
> which files import auth.ts?
MCP tool call
orstrum:get_importers
path: "src/api/auth.ts"
3 results
api/login.ts
middleware/guard.ts
hooks/useAuth.ts
>
orstrum:get_importers same call · same result

Eight tools. One interface,
local or cloud.

The MCP server exposes eight tools for structured graph retrieval and blast-radius analysis. All tools accept source paths — absolute, repo-relative, or shorthand — so an agent never has to manage internal IDs.

  • orstrum_get_summary LLM purpose + top callers and imports for a file
  • orstrum_get_exports Exported symbols with kind and signature, from the AST
  • orstrum_get_imports Outbound imports with resolved cross-file edges
  • orstrum_get_callers Every indexed file that imports a given file
  • orstrum_search Keyword search across stored purpose summaries
  • orstrum_list_files All indexed files, optionally filtered to one repo
  • orstrum_analyze_impact Blast-radius analysis: walks the caller graph and reasons over affected files
  • orstrum_get_guidance Routing guidance for agents — when to use Orstrum vs. grep
View MCP docs

Capabilities runtime agents cannot replicate.

Structural accuracy

A full AST parser with tsconfig resolution. Barrel files and path aliases are resolved to real edges — not text approximations from grep.

S1 S2 S3

Persistent graph

The graph survives across sessions. A file's importer count last sprint versus this sprint is data that does not exist on disk. Only a persistent observer has it.

›_ ›_ ›_

Team-shared index

Push once; the whole team queries the same graph. One agent's structural discovery does not expire when its conversation ends.

Zero raw source

Only structure leaves your machine: paths, export signatures, import edges, and purpose summaries. The cloud graph is an architectural map, not a codebase copy.

A B

Cross-repo edges

edges.package_name is already stored. When two repositories share a package, that dependency crosses repo boundaries. Cross-repo traversal is on the roadmap.

FREE

Free local CLI

The CLI scanner and local MCP server are free to use. Your code never leaves your machine — only the graph syncs to the cloud, never raw source. Cloud sync is the paid layer.

The local graph is always free.

Free
$0 / forever
  • Local graph (SQLite)
  • Unlimited repositories
  • All eight MCP tools via orstrum serve
  • Community support
Get started
Pro
$25 / seat / mo
$20 / seat / mo

billed $240 / seat / year

  • Cloud sync via orstrum push
  • Hosted MCP endpoint
  • Team graph sharing
  • Purpose summaries in cloud
  • Priority support
Get started →

The best time to understand
a codebase is before you need to.

Orstrum makes that understanding permanent.

Get started
$ npm install -g orstrum