{"id":47400,"library":"dir-cli","title":"dir-cli","description":"dir-cli is a professional project migration assistant CLI tool (v2.0) that provides Git status checking, smart cleanup of dependencies and build artifacts, and migration preparation reports. It supports multiple project types including Node.js, Python, Java, Rust, and Go. Key features include dry-run mode, interactive cleanup, configurable white-listing, path validation, and multi-format output (HTML/Markdown/JSON/table). The tool is safety-oriented with dry-run previews, symlink protection, and failure isolation. It requires Node >=16 and works on macOS, Linux, or Windows (WSL).","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/your-username/dir-cli","tags":["javascript","migration","project","git","cleanup","dependencies","node_modules","cli","developer-tools","typescript"],"install":[{"cmd":"npm install dir-cli","lang":"bash","label":"npm"},{"cmd":"yarn add dir-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add dir-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"terminal string coloring for log and output formatting","package":"chalk","optional":false},{"reason":"command-line argument parsing and CLI framework","package":"commander","optional":false},{"reason":"file system scanning matching patterns","package":"fast-glob","optional":false},{"reason":"interactive prompts for cleanup selection","package":"inquirer","optional":false},{"reason":"terminal spinners for progress indication","package":"ora","optional":false}],"imports":[{"note":"dir-cli is a CLI tool intended for command-line usage; programmatic API is experimental. For ESM-only environments, use `import` with `createRequire` or dynamic import.","wrong":"const { exec } = require('dir-cli');","symbol":"exec","correct":"import { exec } from 'dir-cli'"},{"note":"Default export is the main class; named export is incorrect.","wrong":"import { DirCli } from 'dir-cli';","symbol":"DirCli","correct":"import DirCli from 'dir-cli'"},{"note":"Use `import type` for TypeScript types; runtime import is unnecessary.","wrong":"import { CheckOptions } from 'dir-cli';","symbol":"types","correct":"import type { CheckOptions, CleanOptions, ReportOptions } from 'dir-cli'"}],"quickstart":{"code":"// Ensure Node.js >= 16.0.0\n// Install globally\n// npm install -g dir-cli\n\n// Check project status and migration readiness (current directory)\nimport { execSync } from 'child_process';\nconsole.log(execSync('dir-cli check --format plain').toString());\n\n// Preview cleanup for all types (dry-run)\nconsole.log(execSync('dir-cli clean all --dry-run').toString());\n\n// Generate migration report in HTML\nconsole.log(execSync('dir-cli report migration --format html --output migration-report.html').toString());\n\n// Interactive cleanup for node projects\nconsole.log(execSync('dir-cli clean node --interactive').toString());\n\n// Set configuration\nconsole.log(execSync('dir-cli config set scan.maxDepth 5').toString());\n\n// List current configuration\nconsole.log(execSync('dir-cli config list').toString());\n\n// Change locale to English\nconsole.log(execSync('dir-cli locale en').toString());","lang":"typescript","description":"Demonstrates common CLI commands: check status, dry-run cleanup, generate HTML report, interactive cleanup, config management, and locale switching."},"warnings":[{"fix":"Update scripts to use new command names: `dir-cli check` and `dir-cli report migration`.","message":"v2.0 changed command structure: `dir-cli scan` is now `dir-cli check`, and `dir-cli prepare` is `dir-cli report migration`.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Upgrade Node.js to >=16.0.0 or stay on v1.x if locked to older Node.","message":"v2.0 requires Node.js >=16.0.0; older versions (v1.x) supported Node >=12.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Replace `--dry` with `--dry-run`.","message":"The `--dry` option for `clean` is deprecated in v2.0; use `--dry-run` instead.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"If you need to remove `vendor/`, use `--exclude vendor` after confirming your project does not require it.","message":"The `clean go` command does NOT clean `vendor/` directory by default; only `bin`, `dist`, `build`, and `coverage.out` are targeted.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure run directory is the project root. Use `--dry-run` to preview before actual cleanup.","message":"Path validation prevents deletions outside the project root; operations targeting paths like `../` will be blocked and logged but may cause confusion.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Check documentation for local config support; consider using environment variables or per-project `.dir-clirc` file.","message":"By default, the config command reads/writes global config; changes affect all projects. Use `--local` flag for per-project config (if supported) or manually specify config file.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'16':84 'artifact':27 'assist':12 'build':26 'check':20 'cleanup':22,52,97 'cli':3,6,13,101 'configur':53 'depend':24,98 'develop':103 'developer-tool':102 'dir':2,5 'dir-c':1,4 'dri':48,73 'dry-run':47,72 'failur':79 'featur':45 'format':62 'git':18,96 'go':43 'html/markdown/json/table':64 'includ':37,46 'interact':51 'isol':80 'java':40 'javascript':93 'key':44 'linux':89 'list':56 'maco':88 'migrat':11,29,94 'mode':50 'modul':100 'multi':61 'multi-format':60 'multipl':34 'node':83,99 'node.js':38 'orient':70 'output':63 'path':57 'prepar':30 'preview':75 'profession':9 'project':10,35,95 'protect':77 'provid':17 'python':39 'report':31 'requir':82 'run':49,74 'rust':41 'safeti':69 'safety-ori':68 'smart':21 'status':19 'support':33 'symlink':76 'tool':14,66,104 'type':36 'typescript':105 'v2.0':15 'valid':58 'white':55 'white-list':54 'window':91 'work':86 'wsl':92","created_at":"2026-06-07T16:51:19.939602+00:00","updated_at":"2026-06-07T16:51:19.939602+00:00","problems":[{"fix":"Run `npm install -g dir-cli` to install globally.","cause":"dir-cli was not installed globally or locally.","error":"Error: Cannot find module 'dir-cli'"},{"fix":"Replace `--dry` with `--dry-run`.","cause":"`--dry` option was removed in v2.0; use `--dry-run`.","error":"error: unknown option '--dry'"},{"fix":"Upgrade Node.js to version >=16.0.0, or use dir-cli v1.x (if compatible).","cause":"Node.js version is too old for dir-cli v2.0.","error":"Error: dir-cli requires Node.js >= 16.0.0 (current: v12.22.12)"},{"fix":"Navigate to a directory containing a supported project (e.g., has `package.json` or `go.mod`).","cause":"Running `dir-cli check` in a directory without supported project files.","error":"The `check` command requires a project root containing recognized files (package.json, go.mod, etc.)."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/your-username/dir-cli","github":"https://github.com/your-username/dir-cli","docs":null,"changelog":null,"pypi":null,"npm":"dir-cli","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","productivity"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}