codeflow README

The project's README from github.com/braedonsaunders/codeflow. As one markdown file: README.md.

CodeFlow

Visualize Your Codebase Architecture in Seconds

Zero setup. No installation. Just paste a GitHub URL.

License: MIT PRs Welcome

Try it Now · Report Bug · Request Feature

CodeFlow Screenshot

Why CodeFlow?

Ever opened a new codebase and felt completely lost? CodeFlow turns any GitHub repository or local codebase into an interactive architecture map in seconds.

Paste URL / Select Files -> See Architecture -> Make Better Decisions

Features

Interactive Dependency Graph

See how your files connect at a glance. Click any node to highlight its dependencies. Drag, zoom, and explore. The Code view keeps that map and opens the selected file plus its connected files as full-file cards on the canvas, grouped by directory.

Blast Radius Analysis

"If I change this file, what breaks?" — CodeFlow answers this instantly. Select any file and see exactly how many files would be affected by changes.

Code Ownership

Know who owns what. See the top contributors for any file based on git history. Perfect for code reviews and knowing who to ask.

Security Scanner

Automatic detection of:

Test files, fixtures, docs/, and common tooling directories (.github/, .claude/, scripts/) are excluded from the XSS/shell-execution checks, since findings there don't reflect the shipped product's attack surface. The hardcoded-secret check exempts only tests, fixtures, and docs: CI workflows, hooks, and deploy scripts are executable code, so a real credential there is still a real leak.

Pattern Detection

Automatically identifies:

Health Score

Get an instant A-F grade for your codebase based on:

Activity Heatmap

Color files by commit frequency to see which parts of your codebase are most actively developed.

PR Impact Analysis

Paste a PR URL to see exactly which files it affects and calculate the blast radius of proposed changes.

CodeFlow Card (GitHub Action)

Health grade, scale, fragility, and hidden costs as a self-updating SVG on your README — recomputed every merge, with optional thermal-receipt PR comments. See card/.

Point CodeFlow at an Obsidian vault or any markdown directory to see notes as a connected graph. Both [[wiki-links]] and [text](./relative.md) links become edges; each note is a note-layer node (distinct color) with a dependencies[] array in the JSON export.

Local File Analysis

Analyze code directly from your computer without uploading to GitHub:


CodeFlow Card

A GitHub Action that drops an auto-updating SVG card on your README, recomputed on every merge by the same analyzer as the web app. Five styles, accent presets, opt-in PR receipts, and a privacy mode for public repos. The card adapts to the viewer's light/dark theme automatically.

CodeFlow card — compact style

See card/ for setup, or jump to the style gallery below.


Privacy First

Your code stays on your machine. CodeFlow:

Your GitHub token (if used) is only stored in your browser's memory and is cleared when you close the tab.


Quick Start

Just visit CodeFlow and paste any GitHub URL.

Option 2: Self-Host

# Clone the repo
git clone https://github.com/braedonsaunders/codeflow.git

# That's it! Just open index.html in your browser
open index.html

No build process. No npm install. Clone the whole repository: index.html loads pinned, checked-in browser dependencies from vendor/, so a fresh local launch works without a network connection.

Option 3: Local CLI

From this repo (or npx once published): npx codeflow . serves the same index.html UI, watches the folder, and opens it in your browser.

Option 4: Analyze Local Files

You can now analyze code directly from your local machine without uploading to GitHub:

  1. Open CodeFlow in your browser
  2. Click the "Open Folder" button
  3. Select the folder or files you want to analyze
  4. CodeFlow will process them entirely in your browser

Perfect for:


Usage

Public Repositories

Just paste: facebook/react
Or full URL: https://github.com/facebook/react

Private Repositories

  1. Create a GitHub Personal Access Token with repo scope
  2. Paste it in the Token field
  3. Analyze your private repos

Local Files

Click the "Open Folder" button to analyze code from your computer:

Generated dependencies, caches, build output, local worktrees, and test artifacts are pruned automatically (for example node_modules, .next, .turbo, .local, dist, and playwright-report). Individual files over 2 MB remain visible in results but their contents are not parsed.

All processing happens locally in your browser - nothing is uploaded.

After analysis, click the "Share" button to copy a shareable link. Anyone can re-run the same analysis.

Export Reports

Export your analysis in multiple formats for further processing:

Click the "Export" button in the top bar after analysis to access all export options.


Supported Languages

CodeFlow extracts functions and analyzes dependencies for:

Language Extensions
JavaScript .js, .jsx
TypeScript .ts, .tsx
HTML (inline scripts) .html, .htm, .xhtml
Python .py
Java .java
Go .go
Ruby .rb
PHP .php
Vue .vue
Svelte .svelte
Rust .rs
C .c, .h
C++ .cpp, .cc, .cxx, .hpp, .hh, .hxx
C# .cs
Swift .swift
Kotlin .kt, .kts
Scala .scala, .sc
Groovy .groovy, .gvy
Elixir .ex, .exs
Erlang .erl, .hrl
Haskell .hs, .lhs
Lua .lua
R .r, .R
Julia .jl
Dart .dart
Perl .pl, .pm
Shell .sh, .bash, .zsh, .fish
PowerShell .ps1, .psm1, .psd1
F# .fs, .fsi, .fsx
OCaml .ml, .mli
Clojure .clj, .cljs, .cljc
Elm .elm
VBA .vba, .bas, .cls, .xlsm, .xlsb, .xlam
Delphi / FreePascal / Object Pascal .pas, .pp, .dpr, .dpk, .lpr, .inc

Pascal support is heuristic. It recognizes routines and uses unit dependencies while filtering strings and Pascal comment forms; unsupported language features fall back gracefully.


Visualization Modes

Mode Description
Folder Color by directory structure
Layer Color by architectural layer (UI, Services, Utils, etc.)
Churn Color by commit frequency (hot spots)
Blast Color by impact when a file is selected
Code Same graph, with selected and connected files as full-file cards grouped by directory

Keyboard Shortcuts

Key Action
Enter Analyze repository
+ / - Zoom in/out
Escape Close modal

API Limits

GitHub API has rate limits:

Authentication Methods

Personal Access Token (PAT)

  1. Create a GitHub Personal Access Token with repo scope
  2. Paste it in the Token field
  3. Analyze your private repos

GitHub App Authentication

For teams and organizations, GitHub App provides better security and higher rate limits:

  1. Create a GitHub App with repository permissions
  2. Install the app on your organization or personal account
  3. Generate an installation access token
  4. Paste the token in the Token field

Benefits of GitHub App:

For larger repositories or team usage, we recommend using GitHub App authentication.


Architecture

┌─────────────────────────────────────────────────┐
│                   CodeFlow                      │
├─────────────────────────────────────────────────┤
│  ┌──────────┐  ┌──────────┐  ┌──────────┐       │
│  │  Parser  │  │  GitHub  │  │    D3    │       │
│  │  Module  │  │   API    │  │  Graph   │       │
│  └──────────┘  └──────────┘  └──────────┘       │
│        │              │              │          │
│        └──────────────┼──────────────┘          │
│                       │                         │
│              ┌────────▼────────┐                │
│              │   React App     │                │
│              │ (Static Assets) │                │
│              └─────────────────┘                │
└─────────────────────────────────────────────────┘

Zero build dependencies to install. Browser libraries and required Tree-sitter WASM files are pinned under vendor/, with source URLs, SHA-256 digests, and license notices. To refresh them:

node scripts/vendor-browser-deps.mjs

The vendored runtime includes:


Contributing

We love contributions! Here's how:

  1. Fork the repo
  2. Make your changes to index.html
  3. Test locally (just open in browser)
  4. Submit a PR

Node.js unit tests live under tests/ and run with no dependencies:

node --test tests/*.test.mjs tests/*.smoke.js

tests/verify-brain-vault.mjs is an optional end-to-end script that always verifies the bundled fixtures and will also scan a real local vault when you explicitly set BRAIN_VAULT=/path/to/vault.

Ideas for Contributions


FAQ

Q: How does it work without a backend?

CodeFlow runs entirely in your browser. It calls the GitHub API directly from your browser and processes everything client-side.

Q: Is my code safe?

Yes. Your code is fetched directly from GitHub to your browser. Nothing is sent to any server we control. The app and its pinned browser dependencies are checked into this repository for inspection.

Q: Can I use it offline?

Yes. Clone the complete repository, open index.html, then use the local file analysis feature. All required browser and parser assets are checked in, so even a cold first load works without internet. GitHub URL analysis still requires access to GitHub's API.

Q: Why is analysis slow?

We make individual API calls for each file to get content. With a token, you get higher rate limits and faster analysis.

Q: How accurate is the dependency analysis?

It's heuristic: unique functions are matched by name, while duplicate function names are scoped by file and explicit imports before edges are created. It may still miss dynamic imports or renamed runtime references, so it's designed for a quick overview, not 100% accuracy.


All examples below are real cards rendered by the CodeFlow Card Action against this very repo. Pick one and drop it on your README.

style: compact — default

compact

style: compact with show-grade: false, show-score: false

For public READMEs where you'd rather show data than a letter grade. The card stays informational — files, functions, LOC, languages, tests — without the judgmental bits.

compact private

accent — any preset or CSS color

The accent recolors the sparklines, links, and pin. Presets: purple (default), teal, cyan, green, pink, blue, amber, red. Or pass any CSS color (e.g. #ff6b6b).

compact teal compact pink

style: row — status-bar strip

row

style: minimal — single text line

minimal

style: hero — splashy gradient

hero

hero with show-grade: false:

hero private

style: detailed — information-rich

Everything: grade, scale, language breakdown, composition (connections, tests, folders, function stats, patterns), top folders, fragility, hidden costs.

detailed

detailed with show-grade: false:

detailed private

Star History

If you find CodeFlow useful, please star the repo.


License

MIT License — use it however you want.


Built by developers, for developers

Stop guessing. Start seeing.

codeflow (braedonsaunders/codeflow)

Searching Database…

这是什么?CodeFlow 可以把任意 GitHub 仓库(或本地文件夹)转换为可交互的架构图:一张展示文件之间如何关联的依赖关系图,外加安全、模式和代码健康度分析。
这是需要安装的应用,还是直接在浏览器里运行?这是一个单页网页应用,完全在客户端运行,没有后端,也没有构建步骤,在线使用时无需安装。
我到底该怎么使用?访问托管网站并粘贴 GitHub 网址;或克隆仓库后打开 index.html 进行自托管;或通过 `npx codeflow .` 在本地运行,它会启动界面并监视该文件夹。
分析仓库需要 GitHub 令牌吗?公开仓库不需要令牌,但没有令牌时每小时只能发送 60 次请求;使用个人访问令牌(Personal Access Token)或 GitHub App 令牌则为每小时 5,000 次,适用于私有仓库和更频繁的使用场景。
依赖关系图的准确度如何?它采用启发式方法:函数按名称匹配(若名称重复,则结合文件和导入语句来限定范围),因此可能漏掉动态导入或重命名的引用。它的设计目标是快速概览,而非绝对精确。
没有网络连接也能使用 CodeFlow 吗?本地文件可以:克隆仓库,打开 index.html(它会从 vendor/ 加载固定版本的内置依赖),然后使用本地文件分析功能;分析远程 GitHub 网址仍需要 API 访问。
我的代码会离开我的电脑吗?不会。所有解析和分析都在浏览器本地完成;分析 GitHub 仓库时,浏览器会直接调用 GitHub API,你输入的任何令牌仅保存在浏览器内存中,关闭标签页后即被清除。
什么是影响范围分析(Blast Radius Analysis)?你可以选择一个文件,立即查看如果修改它,会有多少其他文件受到影响,帮助你在动手修改前评估变更风险。
安全扫描器检查哪些内容?它会自动标记硬编码的密钥和 API 密钥、SQL 注入模式、危险的 eval() 用法以及遗留的调试语句;大多数检查会排除测试文件和文档。
CodeFlow 能解析哪些编程语言?它可以为 30 多种语言提取函数和依赖关系,包括 JavaScript、TypeScript、Python、Java、Go、Ruby、PHP、Rust、C/C++、Swift、Kotlin 等;此外还支持为 Obsidian 笔记库生成 Markdown 及维基链接关系图。
什么是 CodeFlow Card?这是一个 GitHub Action,可自动生成 SVG 徽章显示在你的 README 上,包括健康等级、规模和脆弱度,每次合并后重新计算,提供五种视觉样式以及可选的隐私模式。
Size
7.6 MB
Stars
5.4K
Updated
CommitSep 22
Age
10mo
Commits · 90 Days