████████╗███╗ ██╗ ██████╗ ██╗
██╔══╝████╗ ██║██╔════╝ ██║
██║ ██╔██╗██║██║ ███╗██║
██║ ██║╚████║██║ ██║██║
██║ ██║ ╚███║╚██████╔╝███████╗
╚═╝ ╚═╝ ╚══╝ ╚═════╝ ╚══════╝
relational graph for your repository
Some generative AI was used while building this project to test how fast and reliable it could be for a first pass at a useful software tool. If you think this makes the tool illegit you can [kiss my piss], this MIT licensed so do with it what you want.
tngl is a repo-native, human-authored graph for code relationships.
- Nodes are files/folders.
- Edges are tangles between nodes.
- The graph lives in
tangle/graph.tngland is designed to be edited by humans.
Install
From source:
Without global install:
Quick Start
Inside the repo you want to map:
init also creates a local ./tngl wrapper script in that repo, so collaborators can run ./tngl ....
Core Files
tangle/graph.tngl: graph source of truth (nodes + edges + tags)tangle/config.tngl: runtime/config behavior.tnglignore: extra scan ignores fortngl update
CLI Reference
|||||
What Each Command Does
init: bootstraptangle/, scan filesystem, write graph/config/ignore/wrapper.update: reconcile graph against filesystem (on_deletestrategy applies).status: read-only drift and quality report.inspect: targeted graph audits.mark-orphans: marks unattended isolated nodes as intentional in graph tags.list: print all tangles in graph order.edit: opentangle/graph.tnglin configured editor.view: interactive TUI (main editing UX).setup: opens settings panel directly.open: reserved for static HTML export, currently not implemented.
When To Run tngl update
You still use update when the repository structure changed outside TUI editing, for example:
- files/folders were added, moved, or deleted
- you merged/pulled a branch with path changes
- you want reconciliation/lint cleanup applied to
graph.tngl
If you only edited relationships in tngl view, those writes are already persisted directly to graph.tngl.
TUI Guide (Full)
Launch:
Demo mode (no repo required, in-memory edits only):
Settings only:
Layout
The UI has three major areas:
TREE(left): filesystem tree with connection markers and folder fold/bundle state.DETAILS(right): focused node info + connected tangles + action row.- Bottom status/description bar: selected node summary + context-sensitive key hints.
Mode badges appear in title/status when active:
CREATE(green)DELETE(red)MOVE(blue)
Visual Language
Connection markers:
▶out◀in◆undirected/reference
Folder markers in tree:
▾expanded▸collapsed▣bundled/locked
Node/path cues:
- Focused node path is highlighted.
- In detail mode, selected edge is highlighted in both tree route and details list.
Contexts and Flows
1) Tree Context (default)
Main navigation/edit context.
- Move focus:
j/kor↑/↓ - Open details for focused node:
Enter - Fold/unfold focused folder:
z - Bundle/unbundle focused folder:
b - Start create flow from focused node:
c - Start edge delete picker:
d - Cycle line overlay filter (
off/all/in/out/ref):f - Toggle orphan visibility:
o - Add node:
n - Edit node path:
e - Delete node (confirm):
D - Next node:
Tab - Zoom in/out:
+/- - Help:
? - Setup popup:
s - Quit:
q
2) Details Context
Entered with Enter from tree.
- Navigate tangle list:
↑/↓ Enter: no action in details mode- Delete tangle at cursor:
d - Start move flow:
m - Start create flow:
c - Edit selected edge label:
l - Toggle edge kind directed/undirected:
t - Reverse directed edge direction:
r - Delete focused node (confirm):
D - Toggle orphan visibility:
o - Cycle line overlay filter:
f - Back to tree:
EscorBackspace
3) CREATE Flow
Start from tree (c) or details (c).
- Pick target node:
↑/↓ - Change edge type (
in/out/ref):←/→ - Fold/unfold folders while selecting:
z - Confirm target/type and open comment popup:
Enter - Cancel CREATE:
EscorBackspace
Important CREATE guard:
- While creating from a folder/source path, you cannot collapse that source folder or its parents.
4) Comment Popup (during CREATE)
After choosing source/target/type:
- Type label/comment text directly
- Move caret:
←/→ - Delete character:
Backspace - Save edge:
Enter - Go back to CREATE selection:
Esc
5) DELETE Flow
From tree, press d.
- Cycle candidate tangles:
j/kor↑/↓ - Confirm deletion prompt:
Enter - Cancel delete mode:
EscorBackspace
6) MOVE Flow (Edge Reroute)
In details mode, hover an edge and press m.
- This grabs the opposite endpoint relative to the details anchor node.
- Move focus to the replacement node with
↑/↓. - Change tangle type with
←/→. - Apply move with
Enter. - Cancel with
EscorBackspace. - Moving onto the other endpoint is blocked (no self-loop moves).
7) Bundle Flow
From tree on a folder, press b.
- Bundling locks/collapses folder (
[bundle]behavior). - If child links exist, you get a warning/confirm prompt before pruning those links.
- Unbundle with
bagain.
8) Confirm Prompts
Used for destructive actions (delete edge/node, bundle-prune).
- Confirm:
yorEnter - Cancel:
n,Esc, orBackspace
TUI Behavior Worth Knowing
- Changes made in TUI are written back to
tangle/graph.tngl. - On exit, graph formatting/normalization is also applied.
- If
auto_reveal_linksis enabled, collapsed folders that hide currently relevant links can open transiently while focused, then close again when focus changes.
graph.tngl Format
Basic structure:
src/main.rs
-> src/tui/canvas.rs : starts app
-- README.md : documented in
Rules:
- Node line: non-indented path.
- Edge line: indented under source node.
- Edge operators:
->,<-,--. :is required after target (label can be empty).- Folder nodes end with
/. - Comments start with
#.
Tags supported in graph:
[orphan][bundle][orphan bundle]
Settings (tangle/config.tngl)
Supported keys:
on_delete: prompt|delete|preserveshow_orphans: true|falseauto_reveal_links: true|falsegit_hooks: true|falseeditor: <command>warn_uncommented_edges: true|false
setup popup currently exposes these toggles directly:
- reveal linked paths (
auto_reveal_links) - git hook updates (
git_hooks) - warn blank comments (
warn_uncommented_edges)
Typical Workflows
Map a repo from scratch
# add/edit tangles interactively
Audit graph quality
Keep things current after file churn
Current Limitations
tngl openis not implemented yet.- This is terminal-first; no web UI export path currently ships.