Scout

Code analysis toolkit for iOS/macOS repositories. Analyze any commit in your git history to track metrics over time — from the first commit to the latest. Build dashboards showing how your codebase evolves: type counts, file distributions, lines of code, and more.
Table of Contents
Installation
Using mise (recommended)
Install mise if you haven't already, then:
mise use github:dodobrands/scout
Building from source
swift build
Usage
Scout provides a single CLI with subcommands:
scout <subcommand> [options]
Tools
types
Count Swift types by inheritance. Tracks UIView, UIViewController, SwiftUI View, XCTestCase and other types.
Platforms: macOS, Linux — resolving base classes outside the source uses the Xcode SDK and is macOS only; on Linux the analysis is source-only.
Command:
scout types UIView UIViewController View --output results.json
Output:
[
{
"commit": "abc1234def5678",
"date": "2025-01-15T07:30:00Z",
"results": [
{
"typeName": "UIView",
"types": [
{ "name": "CustomButton", "fullName": "CustomButton", "path": "Sources/UI/CustomButton.swift" },
{ "name": "HeaderView", "fullName": "Components.HeaderView", "path": "Sources/Components/HeaderView.swift" }
]
},
{
"typeName": "UIViewController",
"types": [
{ "name": "HomeViewController", "fullName": "HomeViewController", "path": "Sources/Screens/HomeVC.swift" }
]
}
]
}
]
📖 Full documentation
files
Count files by extension. Useful for tracking storyboard, xib, swift files count.
Platforms: macOS, Linux
Command:
scout files swift storyboard xib --output results.json
Output:
[
{
"commit": "abc1234def5678",
"date": "2025-01-15T07:30:00Z",
"results": [
{
"filetype": "swift",
"files": ["Sources/App.swift", "Sources/Model.swift"]
},
{
"filetype": "storyboard",
"files": ["Main.storyboard"]
}
]
}
]
📖 Full documentation
pattern
Search for string patterns in source files. Useful for tracking import statements, API usage, etc.
Platforms: macOS, Linux
Command:
scout pattern "import UIKit" "import SwiftUI" --output results.json
Output:
[
{
"commit": "abc1234def5678",
"date": "2025-01-15T07:30:00Z",
"results": [
{
"pattern": "import UIKit",
"matches": [
{ "file": "Sources/App.swift", "line": 1 }
]
},
{
"pattern": "import SwiftUI",
"matches": [
{ "file": "Sources/ContentView.swift", "line": 1 }
]
}
]
}
]
📖 Full documentation
loc
Count lines of code using cloc. Supports filtering by languages, include/exclude paths.
Platforms: macOS, Linux — requires cloc on PATH
Command:
scout loc --config loc.json --output results.json
Output:
[
{
"commit": "abc1234def5678",
"date": "2025-01-15T07:30:00Z",
"results": [
{
"metric": "Swift | Sources",
"linesOfCode": 48500
}
]
}
]
📖 Full documentation
build-settings
Extract build settings from Xcode projects. Supports Tuist-generated projects with custom setup commands.
Platforms: macOS only — shells out to xcodebuild
Command:
scout build-settings --config build.json --output results.json