napi

作者 nanoapi-io已验证

Software architecture tooling for the AI age

322
Stars
11
Forks
TypeScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/nanoapi-io/napi

快速入门

使用 napi 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

NanoAPI Banner

napi - Better Software Architecture for the AI Age

napi is a fully offline CLI that analyzes your codebase's architecture -- dependencies, complexity, and structure -- then lets you visualize and refactor it, all without sending your code anywhere.

It generates dependency manifests from your source code, stores them locally, and serves an interactive graph visualizer directly from the CLI.

NanoAPI UI Overview

Features

  • 🔍 Dependency Analysis: Map every file, symbol, and dependency in your codebase automatically.
  • 🚨 Audit: Detect files and symbols that exceed complexity, size, or coupling thresholds.
  • 📊 Interactive Visualizer: Explore your architecture through Cytoscape.js graphs served locally in your browser.
  • 📝 Symbol Extraction: Extract specific functions, classes, or symbols into standalone files for refactoring.
  • 🏷️ AI Labeling (optional): Use OpenAI, Google, or Anthropic models to auto-label dependencies.
  • ⚙️ CI/CD Ready: Integrates into any pipeline -- generate manifests on every push and track architecture over time.
  • 🔒 Fully Offline: No accounts, no servers, no data leaves your machine.

Supported Languages

LanguageStatus
Python✅ Supported
C#✅ Supported
C✅ Supported
Java✅ Supported
C++🚧 In Progress
PHP🚧 In Progress
JS/TS🚧 In Progress

Installation

Unix (macOS, Linux)

curl -fsSL https://raw.githubusercontent.com/nanoapi-io/napi/refs/heads/main/install_scripts/install.sh | bash

Or download a binary directly from GitHub Releases.

Windows

Use WSL to run napi. Native Windows support is in progress.

Quick Start

# 1. Initialize your project (creates .napirc)
napi init

# 2. Generate a dependency manifest
napi generate

# 3. Open the visualizer in your browser
napi view

That's it. Your manifest is saved locally in .napi/manifests/ and the visualizer opens at http://localhost:3000.

CLI Commands

napi init

Interactive setup that creates a .napirc configuration file in your project root.

Prompts you for:

  • Language -- Python, C#, C, or Java
  • Include/exclude patterns -- which files to analyze
  • Output directory -- where extracted symbols are written
  • AI labeling (optional) -- provider and concurrency settings
napi init

napi generate

Analyzes your codebase and generates a dependency manifest. The manifest captures every file, symbol, dependency, and metric (lines, complexity, coupling).

Manifests are saved as JSON files in .napi/manifests/ with the naming pattern {timestamp}-{commitSha}.json.

# Interactive (prompts for branch/commit if not in git)
napi generate

# Non-interactive (for CI)
napi generate --branch main --commit-sha abc1234 --commit-sha-date 2026-01-01T00:00:00Z

Options:

  • --branch -- Git branch name (auto-detected if omitted)
  • --commit-sha -- Git commit hash (auto-detected if omitted)
  • --commit-sha-date -- Commit date in ISO 8601 format (auto-detected if omitted)
  • --labelingApiKey -- API key for AI labeling (overrides global config)

napi view

Starts a local web server and opens an interactive dependency visualizer in your browser.

napi view
napi view --port 8080

The viewer provides:

  • Manifest list -- browse all locally stored manifests by branch, commit, and date
  • Project graph -- file-level dependency map with Cytoscape.js
  • File graph -- symbol-level view within a file (functions, classes, variables)
  • Symbol graph -- transitive dependency chain for a specific symbol
  • File explorer sidebar -- navigate your codebase structure
  • Audit alerts -- visual indicators for files/symbols exceeding thresholds

napi extract

Extracts specific symbols from your codebase into separate files using a local manifest.

# Extract a function from a specific file
napi extract --symbol "src/auth/login.py|authenticate"

# Extract multiple symbols
napi extract --symbol "src/models.py|User" --symbol "src/models.py|Session"

# Use a specific manifest (defaults to latest)
napi extract --symbol "src/main.py|run" --manifestId 1712500000000-a1b2c3d

Output is written to {outDir}/extracted-{timestamp}/.

napi set apiKey

Configure API keys for AI-powered dependency labeling. Keys are stored in the global config (not in your project).

napi set apiKey

Prompts for:

  • Provider -- Google, OpenAI, or Anthropic
  • API key -- your provider API key

Local Manifest Storage

All manifests are stored in .napi/manifests/ relative to your project root. Each manifest is a self-contained JSON file:

{
  "id": "1712500000000-a1b2c3d",
  "branch": "main",
  "commitSha": "a1b2c3d4e5f6...",
  "commitShaDate": "2026-04-07T10:00:00Z",
  "createdAt": "2026-04-07T10:01:00Z",
  "manifest": {}
}

Add .napi/ to your .gitignore or commit it to track architecture history in version control -- your choice.

CI/CD Integration

Generate manifests automatically on every push:

# .github/workflows/napi.yml
name: Generate Manifest
on: [push]
jobs:
  manifest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install napi
        run: curl -fsSL https://raw.githubusercontent.com/nanoapi-io/napi/refs/heads/main/install_scripts/install.sh | bash

      - name: Generate manifest
        run: napi generate --branch ${{ github.ref_name }} --commit-sha ${{ github.sha }} --commit-sha-date "$(git log -1 --format=%cI)"

Configuration Reference

.napirc

Project-level configuration created by napi init:

{
  "language": "python",
  "python": { "version": "3.10" },
  "project": {
    "include": ["src/**/*.py"],
    "exclude": [".git/**", "**/__pycache__/**", "napi_out/**"]
  },
  "outDir": "napi_out",
  "labeling": {
    "modelProvider": "openai",
    "maxConcurrency": 5
  }
}

Global Config

Stored in your OS config directory (~/.config/napi/config.json on Linux, ~/Library/Application Support/napi/config.json on macOS). Managed via napi set apiKey.

{
  "labeling": {
    "apiKeys": {
      "openai": "sk-...",
      "google": "AIza...",
      "anthropic": "sk-ant-..."
    }
  }
}

Development

Requires Deno v2.4+.

# Install dependencies
deno install --allow-scripts

# Run CLI in dev mode
deno task dev

# Run viewer dev server (hot-reload)
deno task dev:viewer

# Build viewer for production
deno task build:viewer

# Compile binary (includes viewer)
deno task compile

# Run tests
deno task test

# Lint
deno lint

# Format
deno fmt

Contributing

We welcome contributions from the community. Please read our contributing guide for details on how to get involved.

License

napi is licensed under the Sustainable Use License.

Further Reading

Donations

NanoAPI is a fair-source project. Because of this, we feel it would be unethical to keep any donations to ourselves. Instead, here is how we will handle donations:

  • Donations go into a pool
  • Money from the pool will be distributed to contributors
  • At the end of the year, any remaining money will be donated to a charity of the community's choice

We will post regular updates on how much money is in the pool and how it is being distributed.

常见问题

What is napi?

napi is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by nanoapi-io. Software architecture tooling for the AI age. It has 322 GitHub stars.

Is napi safe to use?

Yes. napi passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install napi?

Clone the repository with "git clone https://github.com/nanoapi-io/napi" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is napi written in?

napi is primarily written in TypeScript. It is open-source under nanoapi-io on GitHub, so you can review or fork the full source.

Are there alternatives to napi?

Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh napi against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

Scrapling

by D4Vinci

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

75,9137,581Python
MCP 服务器
查看详情

TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

61,65224,883Python
MCP 服务器
查看详情

context7

by upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

61,0602,938TypeScript
MCP 服务器
查看详情

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

39,9393,219C
MCP 服务器
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情