https://github.com/jotrorox/locc
A fast, simple and beatiful line counter (like cloc but better)
https://github.com/jotrorox/locc
cli cloc cmd command command-line command-line-tool go golang lipgloss loc locc tui
Last synced: about 2 months ago
JSON representation
A fast, simple and beatiful line counter (like cloc but better)
- Host: GitHub
- URL: https://github.com/jotrorox/locc
- Owner: Jotrorox
- License: mit
- Created: 2025-06-02T19:56:15.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-06-22T22:08:59.000Z (4 months ago)
- Last Synced: 2025-06-22T23:17:51.591Z (4 months ago)
- Topics: cli, cloc, cmd, command, command-line, command-line-tool, go, golang, lipgloss, loc, locc, tui
- Language: Svelte
- Homepage: https://jotrorox.github.io/locc/
- Size: 141 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# LOCC - Lines of Code Counter
[](https://opensource.org/licenses/MIT)
[](https://ziglang.org)A fast and beautiful command-line tool for counting lines of code across multiple programming languages with colorful terminal output.
## Features
- :zap: **Fast**: Optimized for speed, written in Zig
- :art: **Beautiful Output**: Colorful and easy-to-read terminal output
- :file_folder: **Multi-language Support**: Counts lines for a wide range of programming languages
- :bar_chart: **File Mode**: Show file counts grouped by type
- :mag: **Pattern Filtering**: Filter files using wildcards (* and ?) for precise control
- :gear: **Configurable**: Easily ignore directories and files with a JSON configuration file## Installation
### Download Pre-built Binaries
todo with the next minor release
### From Source
```bash
git clone https://github.com/jotrorox/locc.git
cd locc
zig build --release=small
```## Usage
### Basic Usage
Count lines of code in a directory, grouped by file type:
```bash
# To run in the current folder
locc
# To run in a specific folder
locc /path/to/your/project
```### File Mode
Show the file count, grouped by file type:
```bash
locc --file-mode /path/to/your/project
# or
locc -f /path/to/your/project
```### Pattern Filtering
Filter files and directories using patterns with wildcards:
```bash
# Count only Zig files
locc -r "*.zig" /path/to/project# Count only markdown files in file mode
locc -f -r "*.md" /path/to/project# Count files with specific naming patterns
locc -r "test*.py" ./python-project
locc -r "*component*" ./react-app# Use single character wildcard
locc -r "build.zi?" ./zig-project
```### Pattern Syntax
The `-r`/`--regex` option supports simple wildcard patterns:
- `*` matches any sequence of characters (including none)
- `?` matches any single character
- Literal characters match exactlyExamples:
- `*.js` - matches all JavaScript files (main.js, app.js, etc.)
- `test*.py` - matches Python files starting with "test" (test_main.py, test_utils.py)
- `*component*.vue` - matches Vue files with "component" in the name
- `build.zi?` - matches files like build.zig, build.zip, etc.
- `*.{js,ts}` - Note: this requires shell expansion, use separate commands for multiple extensions## Supported Languages
LOCC a heck ton of programming languages including but not limited to:
- **Systems**: C, C++, Rust, Go
- **Web**: JavaScript, TypeScript, HTML, CSS, SCSS
- **Backend**: Python, Java, C#, PHP, Ruby
- **Mobile**: Swift, Kotlin, Dart, Objective-C
- **Scripting**: Shell, Bash, PowerShell, Lua, Perl
- **Data**: JSON, YAML, TOML, SQL, XML
- **Functional**: Scala, R
- **Frameworks**: Vue, JSX, TSX## Performance
LOCC is optimized for speed:
- :zap: Written in Zig for high performance
- :rocket: Fast parsing and counting algorithms
- :bar_chart: Efficient memory usage
- :tada: Handles large repositories with ease## Releases
Please check the [Releases](https://github.com/jotrorox/locc/releases) page for the latest version and changelog. Those releases are built using the `zig build --release=small` command, which optimizes for size and performance.
If your architecture is not supported, you can build from source using the instructions above or tell me about it in the [issues](https://github.com/jotrorox/locc/issues) section.
## Contributing
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project.
## Code of Conduct
This project adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Author
**Johannes (Jotrorox) Müller**
- GitHub: [@jotrorox](https://github.com/jotrorox)
- Email: [mail@jotrorox.com](mailto:mail@jotrorox.com)