Web Sharing
Create shareable links to interactive 3D code visualizations. Anyone with the link can view the visualization in their browser — no account needed.
Shares are zero-knowledge: the server stores only an encrypted blob. The encryption key lives in the URL fragment (#k=...), which browsers never send to the server.
How It Works
When you run codelayers share, the CLI:
- Parses your codebase with tree-sitter (11 languages supported)
- Builds a dependency graph (files, functions, classes, imports, calls, references)
- Computes metrics (LOC, cyclomatic complexity, PageRank, topological depth)
- If
--base/--headspecified: computes a PR diff with per-file line stats and blast radius - Fetches your saved overlays (named file groups with colors)
- Generates a random 256-bit AES key
- Serializes everything to JSON, gzip compresses, encrypts with AES-256-GCM
- Uploads the encrypted blob to the backend and receives a share URL
- Appends
#k={base64url_key}to the URL — the key never touches the server
The result is a URL like:
https://app.codelayers.ai/s/{share-id}#k={base64url-encoded-key}
Creating a Share
# Share current directory (uncommitted changes as blast radius)
codelayers share
# Share a specific repo
codelayers share /path/to/repo
# PR mode: compare base to head
codelayers share . --base origin/main --head HEAD
# Customize expiry
codelayers share --expires 30
# Machine-readable output (for CI/CD)
codelayers share --format json
See the CLI Reference for the full list of flags.
Share Limits
Creating shares requires a Pro subscription. Anyone with the link can view a share for free — no account needed.
| Limit | Value |
|---|---|
| Max expiry | 90 days |
| Max views | Unlimited |
| Max payload size | 50 MB |
Managing Shares
# List all shares
codelayers shares list
# List shares for a specific repo
codelayers shares list /path/to/repo
# Copy share URL to clipboard (macOS)
codelayers shares copy <share-id>
# Show share details
codelayers shares info <share-id>
# Delete a share
codelayers shares remove <share-id>
# Remove all expired shares from local history
codelayers shares cleanup
See the CLI Reference for full details.
The Web Viewer
Anyone with the share link can open it in a browser to see an interactive 3D visualization. No account or download required.
View Modes
The viewer has three color modes:
| Mode | Description |
|---|---|
| Depth | Color by topological depth in the dependency graph. Cyan at the foundations cycling through to green at the entry points. |
| Git | Color by git change status. Green = added, Red = removed, Orange = modified, Gray = unchanged. |
| Impact | Color by blast radius distance from changed files. Red = changed, Orange = 1 hop, Yellow = 2 hops, Green = 3 hops, Teal = 4+ hops, Gray = unaffected. |
Impact mode is the default when the share includes changed files (e.g., PR shares). Otherwise, Depth mode is the default.
Interactive Features
- Click a node to select it — shows file name, path, LOC, and metrics
- Selected node highlights: imports shown in green, dependents shown in orange
- Overlays: colored rings around nodes for named file groups (e.g., "Auth Layer")
- PR link: if the share is linked to a PR, shows the PR title with a clickable link to GitHub
What's in the Payload
Each share includes the full dependency graph with per-file metadata:
| Metric | Description |
|---|---|
| loc | Lines of code |
| cyclomatic_complexity | Code complexity metric |
| cognitive_complexity | Cognitive complexity metric |
| nesting_depth | Maximum nesting depth |
| last_modified | Last git modification date |
| change_frequency | Commits per month (last year) |
For PR shares, each node also includes lines added, lines deleted, and whether the file was modified, added, or deleted.
Security
The server never sees your code. All it stores is an encrypted blob, an IV, and metadata like expiry and view count.
The encryption key is in the URL fragment (#k=...). Browsers never send fragments to the server, so the key stays between you and whoever you share the link with.
Share keys are random — not derived from your mnemonic. Revoking a share deletes the encrypted blob from the server. Anyone with the link after that gets a 404.
For a deeper look at the security model, see Privacy.