Smdu
C+ 73 completed
Other
cli / typescript · small
122
Files
17,591
LOC
2
Frameworks
7
Languages
Pipeline State
completedRun ID
#388184Phase
doneProgress
1%Started
Finished
2026-04-13 01:31:02LLM tokens
0Pipeline Metadata
Stage
CatalogedDecision
proceedNovelty
75.40Framework unique
—Isolation
—Last stage change
2026-05-10 03:35:24Deduplication group #52630
Member of a group with 2 similar repo(s) — canonical #67794 view group →
Top concepts (10)
Architecture DescriptionProject DescriptionWeb FrontendpresentationinfrastructuretestingConfigurationTestingSearchFile Management
Repobility — the code-quality scanner for AI-generated software · https://repobility.com
🧪 Code Distillation
Browse all specs →Sample distilled functions (click for full spec)
scanDirectoryRecursively traverses a specified directory path to build a representation of its file structure. It accepts the directory path as a required string input, along with optional callbacks and signals for progress tracking and partial results. The function returns a Promise that resolves to a FileNode
deriveReviewEntriesGenerates an array of review entries by traversing a file node structure. It accepts the root file node and an optional configuration object specifying a reference time, source root path, and whether to include the root itself. The function recursively processes the file system hierarchy, building e
createReviewEntryConstructs a comprehensive review entry object detailing a specific file node's metadata. It accepts the target file node, the root node, a source root string, and optional configuration parameters like a reference time or depth. The function returns a ReviewEntry object containing derived propertie
AI Prompt
Build me a modern, terminal-based disk usage analyzer inspired by `ncdu`, similar to what SMDU does. I need it built using TypeScript and Ink for the interactive UI. The tool should feature fast scanning, visual feedback with size bars, and support multiple themes like Default, Classic, and Dracula. Key features to include are an adaptive layout, a status panel showing file details, and the ability to switch between Flat, Tree, and Review view modes. Also, please implement a focus timer accessible via the 'T' key.
typescript cli terminal disk-usage ink tui system-tool command-line
Generated by gemma4:latest
Catalog Information
SMDU is a modern, terminal-based disk usage analyser inspired by ncdu, built with TypeScript and Ink.
Description
SMDU is a modern, terminal-based disk usage analyser inspired by ncdu, built with TypeScript and Ink.
Novelty
3/10Tags
typescript cli terminal disk-usage ink tui system-tool command-line
Technologies
react
Claude Models
claude-opus-4-6
Quality Score
C+
72.6/100
Structure
84
Code Quality
68
Documentation
54
Testing
85
Practices
67
Security
76
Dependencies
80
Strengths
- CI/CD pipeline configured (github_actions)
- Good test coverage (74% test-to-source ratio)
- Code linting configured (eslint)
- Properly licensed project
Weaknesses
- 3 files with critical complexity need refactoring
- 472 duplicate lines detected \u2014 consider DRY refactoring
- 2 'god files' with >500 LOC need decomposition
Security & Health
11.3h
Tech Debt (B)
High
DORA Rating
A
OWASP (100%)
Citation: Repobility (2026). State of AI-Generated Code. https://repobility.com/research/
PASS
Quality Gate
A
Risk (2)
MIT
License
7.0%
Duplication
Languages
Frameworks
React Jest
Symbols
variable542
function123
interface39
constant34
type_alias19
enum1
class1
method1
API Endpoints (5)
| Method | Path | Handler | Framework | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| About: code-quality intelligence by Repobility · https://repobility.com | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET | fileTypeColoursEnabled | config.get | Express | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET | heatmapEnabled | config.get | Express | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET | showHiddenFiles | config.get | Express | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET | theme | config.get | Express | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GET | units | config.get | Express | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Concepts (10)
| Category | Name | Description | Confidence | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Want fix-PRs on findings? Install Repobility's GitHub App · github.com/apps/repobility-bot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ai_architecture | Architecture Description | # System Architecture Documentation – SMDU CLI / UI Tool --- ## 1. Executive Summary SMDU is a **TypeScript‑based command‑line utility** that scans a directory tree, extracts file metadata, and presents a **React‑powered terminal UI** for reviewing the results. It is intended for developers and sysadmins who need quick, interactive file audits. The architecture follows a **layered, modular style** (presentation → application → domain → infrastructure) and is in an **early‑stage production‑ready** phase, with a solid test suite but still evolving. **Key strength:** strong component isolation and unit‑test coverage (≈ 70 % overall). **Key risk:** tight coupling between the CLI entry point (`src/cli.tsx`) and the UI layer, which may hinder future scalability and maintainability. --- ## 2. System Architecture Diagram ```mermaid graph TD subgraph CLI CLI[CLI Entry (src/cli.tsx)] end subgraph UI UI[React UI (src/App.tsx)] UI -->|renders| Modal[Modal Components (src/components/*)] UI -->|uses| State[State Layer (src/state.ts)] end subgraph Application App[Application Logic (src/review/*, src/hooks/*)] App -->|manages| State App -->|triggers| Scanner[Scanner (src/scanner.ts)] end subgraph Domain Domain[Domain Models (src/review/types.ts)] Domain -->|provides| App end subgraph Infrastructure Infra[Infrastructure (src/config.ts, src/themes.ts, src/fileTypeColours.ts, src/utils/sanitize.ts)] Infra -->|configures| App Infra -->|provides| Scanner end CLI -->|invokes| App App -->|calls| Scanner Scanner -->|reads| FS[File System] FS -->|writes| State State -->|exposes| UI ``` --- ## 3. Architectural Layers | Layer | Responsibility | Key files/directories | Boundary enforcement | Dependencies | |-------|----------------|-----------------------|----------------------|--------------| | **Presentation** | Renders UI, handles user interaction, displays state | `src/App.tsx` (lines 1‑200), `src/components/*` (each component ~ 100 lines) | Strict – only imports from `src/application` and `src/domain` | React, ReactDOM, `src/state.ts` | | **Application / Service** | Orchestrates domain logic, manages state, coordinates scanning | `src/state.ts` (lines 1‑200), `src/hooks/useScrollableList.ts` (lines 1‑80) | Moderate – some UI components import state directly | React Context, `src/review/*` | | **Domain** | Business rules for reviews (derive, filter, group, sort) | `src/review/*` (e.g., `types.ts` lines 1‑80, `derive.ts` lines 1‑120) | Strict – domain files expose only types and pure functions | None (pure functions) | | **Infrastructure** | Configuration, theming, file‑type mapping, utilities, scanner | `src/config.ts` (lines 1‑100), `src/themes.ts` (lines 1‑120), `src/fileTypeColours.ts` (lines 1‑120), `src/utils/sanitize.ts` (lines 1‑50), `src/scanner.ts` (lines 1‑200) | Loose – infrastructure utilities are imported by many layers | Node fs, external libs (none) | --- ## 4. Component Catalog | Component | Location | Responsibility | Public Interface | Dependencies | Dependents | |-----------|----------|----------------|------------------|--------------|------------| | **CLI Entry** | `src/cli.tsx` (lines 1‑120) | Parses CLI args, launches UI or headless mode | `main()` | `src/App.tsx`, `src/config.ts` | GitHub Actions, end‑users | | **App** | `src/App.tsx` (lines 1‑200) | Root React component, renders layout | `export default App` | `src/components/*`, `src/state.ts` | `src/cli.tsx` | | **Modal – ConfirmDelete** | `src/components/ConfirmDelete.tsx` (lines 1‑120) | Confirmation dialog for deletions | `export const ConfirmDelete: React.FC<Props>` | `src/utils/sanitize.ts` | `src/App.tsx` | | **Modal – DeleteAll** | `src/components/DeleteAll.tsx` (lines 1‑120) | Bulk delete confirmation | `export const DeleteAll: React.FC<Props>` | `src/utils/sanitize.ts` | `src/App.tsx` | | **State Context** | `src/state.ts` (lines 1‑200) | Holds global UI state, exposes actions | `export const StateProvider`, `useStateContext` | `react`, `src/review/*` | All components | | **Review Domain** | `src/review/*` (e.g., `types.ts` lines 1‑80, `derive.ts` lines 1‑120) | Pure functions for deriving, filtering, grouping reviews | `export function deriveReviews(...)`, `export function filterReviews(...)` | None | `src/state.ts`, `src/App.tsx` | | **Scanner** | `src/scanner.ts` (lines 1‑200) | Walks file tree, extracts metadata | `export async function scanDirectory(path: string): Promise<ScanResult>` | `fs`, `path`, `src/utils/sanitize.ts` | `src/state.ts`, `src/App.tsx` | | **Utilities – Sanitize** | `src/utils/sanitize.ts` (lines 1‑50) | Escapes user‑supplied strings | `export function sanitize(input: string): string` | None | All components | | **Custom Hook – useScrollableList** | `src/hooks/useScrollableList.ts` (lines 1‑80) | Provides scrollable list logic | `export function useScrollableList(items: Item[]): {visibleItems, scrollTo}` | `react` | `src/components/*` | | **Key Bindings** | `src/keys.ts` (lines 1‑80) | Defines key constants for UI navigation | `export const KEY_ENTER = 'Enter'` | None | All components | --- ## 5. Component Interactions The UI and CLI layers communicate via **function calls** and **React context**. The core data flow for a scan operation is: 1. **CLI** (`src/cli.tsx`) calls `App` to render the UI. 2. User triggers a scan (e.g., pressing “s”) → `App` dispatches `scanDirectory` via `src/scanner.ts`. 3. `scanner.ts` reads the file system, sanitizes paths, and returns a `ScanResult`. 4. `state.ts` updates the global state, which propagates to UI components. ### Sequence Diagram (Mermaid) ```mermaid sequenceDiagram participant CLI as CLI Entry (src/cli.tsx) participant UI as React UI (src/App.tsx) participant Scan as Scanner (src/scanner.ts) participant State as State Context (src/state.ts) CLI->>UI: render() UI->>State: useStateContext() State->>UI: provide state & actions UI->>Scan: scanDirectory(path) Scan->>State: updateScanResult(result) State->>UI: notify components ``` --- ## 6. Data Flow | Step | Source | Transformation | Storage | Destination | |------|--------|----------------|---------|-------------| | **1** | User input (CLI args or UI key press) | Parsed by `src/cli.tsx` (lines 1‑120) | None | `src/state.ts` | | **2** | `src/state.ts` (lines 1‑200) | Maintains `scanPath`, `scanResults` | In‑memory (React context) | UI components | | **3** | `src/scanner.ts` (lines 1‑200) | Reads `fs.readdir`, sanitizes paths via `sanitize` (lines 1‑50) | None | `src/state.ts` | | **4** | `src/review/derive.ts` (lines 1‑120) | Derives review objects from raw metadata | In‑memory | UI | | **5** | UI (`src/App.tsx` lines 1‑200) | Renders tables, modals | None | Terminal screen | --- ## 7. External Dependencies & Build Tools | Tool | Purpose | Configuration | |------|---------|---------------| | **Node.js** | Runtime for CLI & file‑system access | `package.json` scripts: `"cli": "ts-node src/cli.tsx"` | | **React / ReactDOM** | Terminal UI rendering | Imported in `src/App.tsx` (lines 1‑200) | | **Jest** | Unit testing | `jest.config.js` (testMatch: `"<rootDir>/tests/**/*.test.tsx"`) | | **tsc** | TypeScript compilation | `tsconfig.json` (strict mode) | | **GitHub Actions** | CI/CD, automated tests | `.github/workflows/ci.yml` | `npm test` | --- ## 7. Build & Deployment ```bash # Compile TypeScript npm run build # tsc → dist/ # Run tests npm test # Jest → tests/**/*.test.tsx # Launch CLI npm run cli -- <path> ``` The compiled JavaScript is bundled into `dist/cli.js` and can be distributed as a single executable. The UI can also be launched headless (no terminal UI) by passing `--headless` to the CLI. --- ## 8. Future Work & Recommendations 1. **Decouple CLI and UI** – expose a pure `scanDirectory` API that can be used by both layers without importing React. 2. **Persist scan results** – consider a lightweight JSON cache or SQLite DB for large audits. 3. **Add a REST API** – expose SMDU as a microservice for remote audits. 4. **Improve boundary enforcement** – wrap infrastructure utilities in a dedicated `infra` namespace to avoid accidental imports. --- | 85% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| auto_description | Project Description | SMDU is a modern, terminal-based disk usage analyser inspired by ncdu, built with TypeScript and Ink. | 80% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| auto_category | Web Frontend | web-frontend | 70% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arch_layer | presentation | Detected presentation layer | 70% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arch_layer | infrastructure | Detected infrastructure layer | 70% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arch_layer | testing | Detected testing layer | 70% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| business_logic | Configuration | Detected from 7 related files | 50% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| business_logic | Testing | Detected from 32 related files | 50% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| business_logic | Search | Detected from 4 related files | 50% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| business_logic | File Management | Detected from 5 related files | 50% | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Repobility · code-quality intelligence platform · https://repobility.com
Embed Badge
Add to your README:
