napi  by nanoapi-io

CLI tool for analyzing and visualizing software architecture

Created 4 years ago
320 stars

Top 84.8% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

napi is a command-line interface tool designed for analyzing, visualizing, and refactoring software architecture, specifically tailored for the AI era. It addresses the need for deep codebase understanding without compromising data privacy, making it ideal for developers, architects, and teams seeking to manage complexity and dependencies in their projects. The core benefit is providing comprehensive architectural insights and refactoring capabilities entirely offline.

How It Works

The tool operates by generating detailed dependency manifests from source code, mapping files, symbols, and their interdependencies. These manifests are stored locally, ensuring code never leaves the user's machine unless optional AI labeling features are utilized with user-provided API keys. An interactive graph visualizer, powered by Cytoscape.js and served directly from the CLI, allows users to explore these architectural maps. napi supports automatic detection and auditing of complexity, size, and coupling thresholds, with optional AI integration for auto-labeling dependencies.

Quick Start & Requirements

  • Installation: On Unix-like systems (macOS, Linux), use curl -fsSL https://raw.githubusercontent.com/nanoapi-io/napi/refs/heads/main/install_scripts/install.sh | bash. Native Windows support is in progress; WSL is recommended.
  • Supported Languages: Python, C#, C, Java (✅ Supported); C++, PHP, JavaScript/TypeScript (🚧 In Progress).
  • Quick Start:
    1. Initialize project: napi init (creates .napirc)
    2. Generate manifest: napi generate
    3. View visualization: napi view (opens http://localhost:3000)
  • Development: Requires Deno v2.4+.

Highlighted Details

  • Fully Offline Operation: Guarantees that code and architectural data remain local, enhancing privacy and security.
  • CI/CD Integration: Designed to seamlessly integrate into pipelines for continuous architectural analysis and tracking.
  • Interactive Visualization: Offers detailed file and symbol-level dependency graphs, audit alerts, and a navigable file explorer.
  • Symbol Extraction: Enables refactoring by extracting specific functions or classes into standalone files based on generated manifests.

Maintenance & Community

napi is developed by NanoAPI. The project follows a "fair-source" model, pooling donations to distribute among contributors, with surplus funds donated to charity. A contributing guide is available for community involvement.

Licensing & Compatibility

  • License: Sustainable Use License.
  • Compatibility: Users should review the Sustainable Use License for specific terms regarding commercial use or integration into closed-source projects.

Limitations & Caveats

Support for C++, PHP, and JavaScript/TypeScript is currently under development. Native Windows support is not yet available, requiring users to utilize WSL. AI labeling features are optional and necessitate the provision of user API keys for supported third-party models.

Health Check
Last Commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
26 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.