Skip to main content

Turn an AI-generated code property graph into a beautiful, interactive dependency & data-flow map you can actually see. (Installs the `repoflow` command.)

Project description

repoflow

See what your AI is building.

When you generate software with an AI assistant, the changes pile up faster than anyone can read them. repoflow is a visual aid for humans: it turns your codebase into an interactive code-property + data-flow graph — functions, classes, files, external dependencies and data stores, with arrows showing how data actually moves between them.

Demo

See it instantly, no setup:

pip install repoflow-graph
repoflow present --demo      # opens an interactive graph in your browser

That renders a bundled example. Here's the idea in miniature — a tiny request → service → database flow:

{
  "nodes": [
    { "id": "api:create_task", "label": "create_task", "kind": "entrypoint" },
    { "id": "svc:add",         "label": "add",         "kind": "method",
      "docstring": "Persist a new task." },
    { "id": "db:tasks",        "label": "tasks",       "kind": "datastore" }
  ],
  "edges": [
    { "source": "api:create_task", "target": "svc:add",  "kind": "call",
      "data_type": "title: str" },
    { "source": "svc:add",         "target": "db:tasks", "kind": "dataflow",
      "data_type": "INSERT INTO tasks" }
  ]
}

…which becomes an interactive graph. Hover a node for its docstring, hover an edge for the data flowing across it:

  ⬡ create_task ──call (title: str)──▶  ◯ add ──dataflow (INSERT INTO tasks)──▶  ⛁ tasks
   entrypoint                            method                                   datastore

It works in two stages.

1. repoflow compute

Prints a carefully-built prompt (and copies it to your clipboard). Paste it into your AI coding assistant. The assistant does deep static analysis and writes a graph to repoflow.json.

repoflow compute            # analyze the current directory
repoflow compute ./src -o graph.json

The prompt grants the assistant read-only permissions plus permission to write exactly one file — the JSON graph. It asks for nodes (functions, methods, classes, modules, entry points, external deps, data stores), edges (calls, imports, inheritance, instantiation, and typed data flows), docstrings, and signatures.

2. repoflow present

Reads that JSON and renders a self-contained, beautiful HTML page that opens in your browser.

repoflow present            # reads repoflow.json, opens the graph
repoflow present graph.json -o report.html
repoflow present --demo     # see it instantly with a bundled example

In the graph:

  • Different shapes for different things — see the legend (functions are ellipses, classes are rounded boxes, data stores are barrels, entry points are stars, external deps are diamonds).
  • Spatial grouping — methods nest inside their class, classes inside their file. Code lives next to the code it belongs to.
  • Hover a node to read its docstring and signature.
  • Hover an edge to see the type of data flowing across it.
  • Click a node to spotlight its neighborhood; search to find anything.

Install

pip install repoflow-graph     # the command is still `repoflow`

From source:

pip install -e .

Generated files stay out of git and Docker images

The JSON graph and the HTML render are build artifacts, not source. Whenever repoflow writes (or is about to write) them, it adds them to the right ignore files automatically, in any project you run it in:

  • inside a git repo → its .gitignore
  • inside a Docker build context (a dir with a Dockerfile / compose file / existing .dockerignore) → that context's .dockerignore

So the artifacts are never committed or baked into an image by accident. Pass --no-gitignore to opt out.

Design

  • Zero runtime dependencies. Pure Python standard library.
  • Rendering uses Cytoscape.js (loaded from a CDN in the generated HTML) with the fcose layout for compound-node grouping.
  • The node/edge "visual language" lives in one place (repoflow/schema.py) and drives the prompt, the legend, and the graph styling — so they can never drift.

The graph format

A single JSON document with repo, nodes, and edges. The full contract, including every field and kind, is documented in repoflow/schema.py.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repoflow_graph-0.1.1.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repoflow_graph-0.1.1-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file repoflow_graph-0.1.1.tar.gz.

File metadata

  • Download URL: repoflow_graph-0.1.1.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for repoflow_graph-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dcf0fdd517d33c95b00fe2bc5c53264b6e69aa1bc533d95d76e4430937f1cbd6
MD5 58960f98a7c66260cc84e83c6e204fa1
BLAKE2b-256 0fde0b72fef2c9d319e47e1a365f979fe5f4f32f91aa770a6a95f2961a22cc62

See more details on using hashes here.

File details

Details for the file repoflow_graph-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: repoflow_graph-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for repoflow_graph-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ebcffe3f435b08a9d820cb9f6659c6bb805b02238c49f1e9a99fb5b1837044bd
MD5 469f81bef3fcbadcc5840562fe86e0a0
BLAKE2b-256 98a728e97e1c21a23dd30e2bf9e01bc6f6b1b36c31322e11048e8a600a1c2353

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page