360 Secure SkillHub
360 安全技能中心

Codebase Inspection

遍历指定目录,统计语言分布、代码行、空行与注释行,支持HTML报告、CSV导出、JSON输出、快照趋势对比、SVG徽章和CI集成示例,纯本地运行无网络与遥测。

itspremkumar
itspremkumar
热度 13.95
最近更新 2026-07-13 17:57:59
分类:开发依赖:代码执行 / 读写文件应用场景:报告撰写 / 数据处理 / DevOps / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add codebase-inspection
Metadata
name
codebase-inspection
version
2.0.0
description
Advanced codebase analysis with HTML reports, git-aware diffs, trend tracking, SVG badges, CSV export, and CI/CD integration
tags
["codebase","analysis","metrics","devtools","python","cli","ci","reports","open-source","agent","automation","MIT"]

Codebase Inspector

Walk any directory and report language breakdowns, line counts, blank/comment lines, with HTML reports, git-aware diffs, trend tracking, SVG badges, CSV export, and CI integration.

Keywords: codebase, analysis, metrics, devtools, python, cli, ci, reports, open-source, agent, automation, MIT

Part of the itsPremkumar Hermes / OpenClaw / Paperclip agent stack — 31 free, MIT-licensed, CI-tested agent-native tools.

What it does

You can't manage codebase metrics you can't measure — and you can't see trends over time. Codebase Inspector solves this: Walk any directory and report language breakdowns, line counts, blank/comment lines, with HTML reports, git-aware diffs, trend tracking, SVG badges, CSV export, and CI integration.

Best for: Engineering leads, open-source maintainers, and CI pipelines.

Features

  • Print a per-language LOC report
  • Export CSV for dashboards
  • Generate an HTML report
  • Git-aware diff between snapshots
  • Track trends and emit an SVG badge

Install

# Requires Python 3.8+. No pip install needed.
curl -O https://raw.githubusercontent.com/itsPremkumar/codebase-inspection/main/codebase_inspector.py
# Or copy the file anywhere — it's self-contained.

Quick start

python codebase_inspector.py --help        # list options

Use cases

  1. Print a per-language LOC report
  2. Export CSV for dashboards
  3. Generate an HTML report
  4. Git-aware diff between snapshots
  5. Track trends and emit an SVG badge

Why choose this over alternatives

Alternative Why this skill is better
tokei/scc Adds git-aware diffs, trend tracking, HTML reports, and badges in one CLI.
Manual wc -l Per-language breakdown with comment/blank counts.
Spreadsheet metrics CSV + HTML + badge, CI-ready.

FAQ (SEO / AEO)

Q: How many languages?
A: 25+ extensions recognized out of the box.

Q: CI integration?
A: Yes — example GitHub Actions workflow asserts a language ratio.

Q: Badges?
A: --badge emits an SVG you can drop in a README.

Q: Offline?
A: Yes — no network, no telemetry.

Geo / local reach

Built and maintained by @itsPremkumar (Chennai, India · serving developers worldwide). Free for individuals and teams everywhere. Documentation in English; tool output is locale-neutral.

CI integration

# .github/workflows/verify.yml
name: Verify
on: [push]
jobs:
  verify:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Self-test codebase-inspection
        run: python codebase_inspector.py --help

Support

Free + MIT-0 (free, modifiable, no attribution required). Sponsor if useful:

⭐ Star on GitHub