loclip
v1.0.0
Published
A fast and simple CLI tool to count lines of code in your projects
Maintainers
Readme
loclip
Fast CLI tool to count lines of code in your projects.
Table of Contents
Install
npm install -g loclipOr use with npx:
npx loclipDevelopment
To run the code locally in development mode:
# Clone the repository
git clone https://github.com/ZerubbabelT/loclip.git
cd loclip
# Install dependencies (npm, yarn, pnpm, or bun)
npm install
# yarn install
# pnpm install
# bun install
# Build the TypeScript code
npm run build
# Run the CLI locally
npm start
# Or run in watch mode (auto-rebuild on changes)
npm run dev
# Link globally for testing
npm link
# yarn link
# pnpm linkOptions
--exclude-dir <dir>- Exclude directory (can be used multiple times)--exclude-file <file>- Exclude file (can be used multiple times)--include <lang>- Only count specific languages (can be used multiple times)--top <N>- Show top N files by code lines--json- JSON output--include-autoexcluded- Include auto-excluded directories (node_modules, .git)--help,-h- Show help
Usage
loclip # Scan current directory (excludes node_modules, .git)
loclip ./src # Scan specific directory
loclip ./index.ts # Scan single file
loclip --exclude-dir dist # Exclude dist directory
loclip --include TypeScript # Only count TypeScript files
loclip --include JavaScript --include Python # Multiple languages
loclip --top 10 # Show top 10 largest files by code lines
loclip --json # Output JSON for CI/dashboard integration
loclip --exclude-dir node_modules --exclude-dir .git # Exclude multiple directories
loclip --exclude-file "*.min.js" # Exclude minified JS files
loclip --include-autoexcluded # Include node_modules, .git in scanFeatures
- Counts code, comments, and blank lines separately
- Supports 50+ languages
- Respects .gitignore automatically
