Show HN: Onboard-CLI,一款基于 AST 和大模型(LLM)的代码库可视化工具
Show HN: Onboard-CLI, a LLM powered and AST-based tool to visualize codebase

原始链接: https://github.com/animesh-94/Onboard-CLI

Onboard-CLI 是一个功能强大的开发者平台,旨在映射、可视化并维护复杂的代码库。它由高性能的 Go CLI 和基于 React 的可视化工具构建,利用 Tree-sitter AST 解析技术将代码转换为交互式的拓扑图。 **核心功能:** * **交互式可视化:** 使用 `map` 命令启动 React Flow 画布(http://localhost:3000/app),以探索依赖关系和代码路径。 * **架构护栏:** `drift` 引擎通过 `architecture.yml` 强制执行架构规则,自动检测未经授权的导入和边界违规行为,非常适合集成到 CI/CD 流程中。 * **高级分析:** 提取后端路由、执行影响分析、跟踪代码所有权,并通过自动化的“脉冲”(pulse)摘要监控项目健康状况。 * **多语言支持:** 支持 Go、JS、TS、Python 和 Java 的强大解析能力。 **入门指南:** 开发者可以使用预构建模板(例如整洁架构 Clean Architecture)初始化项目,并执行带有可配置半径设置的深度映射。Onboard-CLI 简化了代码库导航并强化了架构完整性,是扩展团队不可或缺的工具。 安装过程通过 shell 脚本即可轻松完成: `curl -fsSL https://raw.githubusercontent.com/onboard-cli/install.sh | bash` 请访问其代码仓库了解更多信息,并为代码库智能化的未来贡献力量。

Hacker News | 最新 | 往期 | 评论 | 提问 | 展示 | 招聘 | 提交 | 登录 Show HN: Onboard-CLI,一款基于 AST 和大语言模型(LLM)的代码库可视化工具 (github.com/animesh-94) 5 分,由 yr_animesh 发布于 55 分钟前 | 隐藏 | 往期 | 收藏 | 讨论 | 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 加入 YC | 联系 搜索:
相关文章

原文
Untitled.design.1.1.mp4

Developer platform for code parsing, systems profiling, and canvas-based node visualization.

Go Version React Version License: MIT

Onboard-CLI is an advanced command-line interface tool and web-based visualizer designed to help developers quickly understand and map out large, complex codebases. By leveraging AST (Abstract Syntax Tree) parsing via Tree-sitter, Onboard-CLI generates structural topology graphs and enforces architectural boundaries, presenting them through an intuitive React Flow canvas.

  • AST Slicing Engine: Deep code parsing using tree-sitter for accurate structural node generation across multiple languages (Go, JS, TS, Python, Java).
  • Interactive Visualizer (map): Automatically spins up a local React Flow canvas (http://localhost:3000/app) to visually explore code paths, dependencies, and topological maps within a specified radius.
  • Architecture Drift Detection (drift): Analyzes codebase against architecture.yml rules to detect unauthorized cross-file imports and boundary violations, ensuring long-term code health.
  • Comprehensive Ecosystem: Built-in commands for config management, impact analysis, code exporting, owner tracking, and project pulse.
  • Modern Tech Stack: Blazing fast CLI written in Go, paired with a rich frontend utilizing Vite, React 19, @xyflow/react (React Flow), Framer Motion, and Tailwind CSS.

📊 Statistics & Capabilities

  • Language Support: 5+ Built-in parsers (Go, TypeScript, JavaScript, Python, Java).
  • Visualization Radius: Configurable deep-mapping (default radius: 1, scales to complex dependency trees).
  • Rule Enforcement: Sub-second boundary regex evaluation for architectural drift across thousands of files.
  • Frontend Performance: Optimized canvas rendering for large node sets, powered by Vite & SWC/Oxc linting.

You can install Onboard-CLI using the provided installation scripts:

curl -fsSL https://raw.githubusercontent.com/onboard-cli/install.sh | bash

(Or run ./install.sh directly from the repository).

Invoke-WebRequest -Uri https://raw.githubusercontent.com/onboard-cli/install.ps1 -OutFile install.ps1; .\install.ps1

Generate the necessary .onboard.

For CI/CD fokes use below command to generate the necessary configurations and architecture.yaml file

onboard init --template clean-architecture

(Available templates: generic, clean-architecture, modular-monolith, mvc, serverless)

2. Map the Codebase (Visualizer)

Trigger the context engine to map a symbol or file path, and boot up the visualizer server.

onboard map --target "internal/parser" --radius 2

👉 Click the provided link (http://localhost:3000/app) to view the interactive canvas. Press Ctrl+P in the UI to use the Fuzzy Finder! Toggle Dark Mode and Compact Mode from the top right.

3. Extract Backend Routes

Automatically map backend API routes to their exact file and line handler locations across various frameworks (Express, Gin, FastAPI, Spring).

onboard routes --protocol rest --framework express

4. Detect Architectural Drift

Check for violations against your defined architecture rules.

onboard drift --rules architecture.yml

Integrate onboard drift into your GitHub Actions workflow to enforce architectural boundaries on every Pull Request. Check out the template at docs/onboard-action.yml.

  • onboard impact: Analyze the impact of a proposed code change.
  • onboard owners: Track code ownership and maintainers.
  • onboard export: Export graphical/AST data.
  • onboard pulse: Get a quick summary of codebase health and recent activity.

(Note: You can pass the --no-update-check global flag to any command to disable the automatic async version checker).

  • CLI Engine: Go, Cobra, Go-Tree-Sitter, YAML.
  • Web UI: React 19, TypeScript, Vite, @xyflow/react (React Flow), Tailwind CSS, Framer Motion, Lucide React.
  • Code Highlighting & Markdown: Shiki, MDX, Rehype.

We welcome contributions! Please check out the cmd and internal directories for CLI logic, and the ui directory for the React frontend.

Please read our Contributing Guidelines and AI Usage Policy before submitting a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Distributed under the MIT License. See LICENSE for more information.

联系我们 contact @ memedata.com