cloc-studio
June 9, 2026 · View on GitHub
English | 中文
cloc-studio is a macOS desktop app for running and reviewing cloc code-count reports.
It provides a visual workflow for selecting source files or folders, applying common cloc filters, and copying the results in formats that are easy to paste into notes, documents, or reports. Standalone app builds bundle vendor/cloc, so the packaged .app can run without requiring users to install cloc separately.
Screenshots
Overview

Results

Features
- Select multiple files or folders with a picker or drag and drop.
- Run
cloc --jsonfrom a native SwiftUI macOS interface. - Filter by language, extension, directory, maximum file size, git scope, and uniqueness checks.
- Switch between language-level and file-level breakdowns.
- Optionally extract archives before counting, including nested archives such as a
.zipinside another.zip. - Review summary totals for files, code, comments, blanks, and elapsed time.
- Copy breakdowns as plain text, Markdown, TSV, or HTML table content suitable for Word.
- Build a standalone
.appwith the bundledvendor/clocexecutable.
Supported archive extraction formats include .zip, .tar, .tgz, .tar.gz, .tbz, .tbz2, .tar.bz2, .txz, and .tar.xz.
Requirements
- macOS 13 or later.
- Xcode command line tools or Xcode with Swift 6.1-compatible tooling.
Usage
- Open
cloc-studio. - Select or drop one or more files, folders, or supported archive files.
- Configure filters if needed.
- Enable Auto extract archives if selected archives should be expanded before counting.
- Click Run cloc.
- Copy the resulting table or summary in the format you need.
When archive extraction is enabled, archives are extracted into a temporary directory before cloc runs. Temporary extraction folders are removed after the run completes or fails.
Local Development
swift build
swift run cloc-studio
For development only, you can point the app at a local cloc executable:
CLOC_STUDIO_LOCAL_CLOC=/absolute/path/to/cloc swift run cloc-studio
Run tests with:
swift test
Package App
./scripts/package_app.sh
The packaging script:
- Builds the release binary.
- Generates the app icon assets.
- Verifies
vendor/clocagainstvendor/cloc.sha256. - Bundles
vendor/clocintoContents/Resources/cloc. - Signs the app with an ad-hoc identity by default.
- Creates
dist/cloc-studio.appanddist/cloc-studio.zip.
You can override the bundle version with:
VERSION=0.1.0 ./scripts/package_app.sh
If macOS Blocks Opening the App
If Gatekeeper blocks a downloaded build, remove quarantine attributes only after verifying that the app came from a trusted source:
xattr -d com.apple.quarantine /path/to/cloc-studio.app
If needed for nested files:
xattr -dr com.apple.quarantine /path/to/cloc-studio.app
Attribution
cloc-studio is a GUI wrapper around cloc by Al Danial and contributors. It does not replace cloc; it provides a macOS interface on top of the upstream counting engine and language logic.
- Upstream project: https://github.com/AlDanial/cloc
- Upstream tool name:
cloc(Count Lines of Code) - Bundled runtime in this repo:
vendor/cloc
Please keep this attribution when redistributing cloc-studio.
License and Compliance
cloc is distributed under GNU GPL (v2 or later, per upstream notices). Because this app bundles and redistributes cloc, releases of cloc-studio must preserve GPL obligations.
When sharing binaries (.app, .zip), make sure to:
- Include copyright and license notices for upstream
cloc. - Provide corresponding source code for the redistributed version, including any modifications.
- Keep recipients informed that
clocis GPL-licensed and where source can be obtained.
Before public release, review the upstream LICENSE and notices in the cloc script header.
This repository includes:
LICENSE(GPL text from upstream)NOTICE(upstream attribution and bundled-component notice)