Client-side code analysis tool for API connections
Project description
Rohkun CLI v2
Client-side code analysis tool that finds API connections in your codebase.
Features
- 🚀 Fast - All analysis happens locally on your machine
- 🔒 Private - Your code never leaves your computer
- 🎯 Accurate - Finds endpoints and API calls across multiple languages
- 📊 Detailed Reports - Saved locally in
.rohkun/reports/ - 💥 Blast Radius - See impact of code changes
- 📈 Confidence Scoring - Know how reliable each connection is
- 🔄 Diff Over Time - Compare reports to track changes
- ⚡ High Impact Detection - Find critical nodes in your codebase
Installation
pip install rohkun
Quick Start
-
Get your API key from rohkun.com/dashboard
-
Configure the CLI:
rohkun config --api-key YOUR_API_KEY
- Run analysis on your project:
rohkun run
Or run on a specific directory:
rohkun run /path/to/project
Note:
rohkun scanis still available as an alias for backward compatibility.
How It Works
- Authorization Check - CLI checks with server if you have credits
- Local Analysis - All code analysis happens on your machine
- Snapshot Creation - Each scan automatically creates a snapshot (like Git commits)
- Automatic Comparison - Starting from your second scan, automatically compares with previous snapshot
- Report Generation - Results saved to
.rohkun/reports/ - Usage Tracking - CLI reports completion to server for billing
Your code is never uploaded to our servers.
Snapshot Workflow
Think of it like Git commits for your architecture:
- First scan: Creates Snapshot #1 (baseline)
- Second scan: Creates Snapshot #2, automatically compares with #1
- Third scan: Creates Snapshot #3, automatically compares with #2
- And so on...
Each scan shows you exactly what changed—new endpoints, removed API calls, broken connections, and more.
Commands Reference
Quick Reference Table
| Command | Description |
|---|---|
rohkun run [path] |
Scan codebase and generate report |
rohkun run [path] --visualize |
Scan + open 3D visualization |
rohkun config --api-key KEY |
Set API key |
rohkun mcp-setup |
Configure MCP for AI assistants |
rohkun --version |
Show version |
rohkun --help |
Show all commands |
rohkun run - Analyze Codebase
rohkun run [path] [options]
Scans your codebase for API endpoints, connections, and dependencies.
Arguments:
path- Directory to scan (default: current directory)
Options:
--visualize- Generate and open interactive 3D knowledge graph-v, --verbose- Show detailed output (blast radius, confidence scores)
Examples:
# Scan current directory
rohkun run
# Scan specific folder
rohkun run ./my-project
# Scan with visualization
rohkun run ./my-project --visualize
# Verbose output
rohkun run -v
Note:
rohkun scanis an alias for backward compatibility.
rohkun config - Configure CLI
rohkun config --api-key YOUR_KEY
Saves API key to .rohkun/config.json in your project.
Environment Variables (alternative):
export ROHKUN_API_KEY=your_key_here
export ROHKUN_API_URL=https://custom-api.com # For self-hosted
rohkun mcp-setup - Setup AI Integration
rohkun mcp-setup [options]
One command to configure MCP (Model Context Protocol) for AI assistants.
What it does:
- ✅ Checks Rohkun installation
- ✅ Uses existing API key (or prompts for one)
- ✅ Auto-detects IDE (Cursor/Claude Desktop)
- ✅ Creates/updates MCP config file
- ✅ Works alongside other MCP servers
Options:
--ide cursor|claude- Force specific IDE--api-key KEY- Provide API key directly
After setup: Restart your IDE, then ask your AI:
- "What endpoints does this project have?"
- "Analyze the codebase structure"
- "Show me what changed since last scan"
rohkun --version
rohkun --version
Shows current CLI version (e.g., Rohkun CLI v2.2.2).
MCP Server (For AI Integration)
The MCP server (rohkun-mcp) is separate from the main CLI. It's designed to be called by AI assistants, not run manually.
How MCP Works
- Setup: Run
rohkun mcp-setuponce - Restart: Restart your IDE (Cursor/Claude Desktop)
- Use: Ask your AI about code structure - it automatically calls Rohkun
MCP Tools Available
| Tool | Description |
|---|---|
analyze_codebase |
Full codebase analysis |
check_impact |
Check impact of changes to a file/endpoint |
show_changes |
Compare current state to previous snapshot |
visualize_architecture |
Generate knowledge graph |
list_snapshots |
List available snapshots |
MCP Troubleshooting
"Parse error: Expecting value" - The MCP server is trying to read JSON from stdin. This happens if:
- You accidentally ran
rohkun-mcpdirectly (don't do this) - A terminal has a stuck MCP process
Fix: Close terminal, open fresh one, use rohkun run not rohkun-mcp.
# Check for stuck processes
tasklist | findstr python
# Kill if needed
taskkill /F /IM python.exe
rohkun --help
rohkun --help
Shows all available commands and options.
Supported Languages
- Python (Flask, FastAPI, Django)
- JavaScript/TypeScript (Express, Next.js, React)
- Go (net/http, Gin, Echo)
- Java (Spring Boot)
- And more...
Report Format
Reports are saved as JSON in .rohkun/reports/:
{
"version": "2.0.0",
"generated_at": "2024-01-15T10:30:00Z",
"summary": {
"total_endpoints": 25,
"total_api_calls": 18,
"total_connections": 15,
"high_confidence_connections": 12,
"medium_confidence_connections": 2,
"low_confidence_connections": 1,
"estimated_accuracy": "High (80%+)",
"high_impact_nodes": 3
},
"endpoints": [...],
"api_calls": [...],
"connections": [
{
"endpoint": {...},
"api_call": {...},
"confidence": "high",
"confidence_score": 85,
"confidence_reasons": ["HTTP method matches", "Path matches exactly"]
}
],
"blast_radius": [
{
"target": "GET:/api/users",
"severity": "high",
"total_dependents": 15,
"affected_files": [...],
"impact_description": "..."
}
],
"high_impact_nodes": [...],
"accuracy": {...}
}
Configuration
API Key
Set via command:
rohkun config --api-key YOUR_KEY
Or environment variable:
export ROHKUN_API_KEY=your_key_here
Custom API URL
For self-hosted instances:
export ROHKUN_API_URL=https://your-api.com
Troubleshooting
"No API key found"
rohkun config --api-key YOUR_KEY
"Invalid or expired API key"
Get a new key at rohkun.com/dashboard
"Insufficient credits"
Upgrade your plan at rohkun.com/pricing
Privacy
- Your code is analyzed locally on your machine
- Only authorization requests are sent to our servers
- No code content is ever uploaded
- Reports are saved locally in your project
Support
- Website: rohkun.com
- Dashboard: rohkun.com/dashboard
- Email: support@rohkun.com
License
Proprietary - Copyright (c) 2025 Rohkun Labs. All rights reserved.
This is proprietary software. See LICENSE file for full terms and conditions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rohkun-2.2.2.2.tar.gz.
File metadata
- Download URL: rohkun-2.2.2.2.tar.gz
- Upload date:
- Size: 82.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a8f489ccbf02f30a91188375dde4fe61a8993147f42bca6a9afe5ad7a3dbd87
|
|
| MD5 |
c809f60029d92f371e29499d87238b2a
|
|
| BLAKE2b-256 |
9d72d3059892cdc0bc4caa0719c73f5136fd6d243d7fc21cf3b519579b424890
|
File details
Details for the file rohkun-2.2.2.2-py3-none-any.whl.
File metadata
- Download URL: rohkun-2.2.2.2-py3-none-any.whl
- Upload date:
- Size: 95.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03d28d91ff0b55782a208edbdc4e0b06687edad92c3ae896b69faeeae13c8813
|
|
| MD5 |
3873a1de9fae3affad3cfccfe3cfd910
|
|
| BLAKE2b-256 |
3db7c1668f0c8b50f1b3171006ada01a07485b48b45a1954218e649f1dc68d0a
|