Extract a structured summary (including doc comments) of all classes, structs, protocols, enums, typealiases, variables, and functions from every .swift
file in a directory.
Optimized for LLM (Large Language Model) understanding and codebase documentation.
- Lists all types, protocols, enums, functions, and variables (with signatures)
- Includes documentation comments, inheritance, protocol conformances, and enum cases
- Outputs a readable summary for LLMs, onboarding, or documentation
- macOS (or Linux with Swift toolchain)
- SourceKitten:
Install via Homebrew:brew install sourcekitten
- Python 3.7+
python swift_api_extractor.py -d /path/to/your/swift/project -o summary.txt
# File: ./Features/Auth/AuthRepository.swift
protocol AuthRepository
Doc: Provides a layer between AuthService and the rest of the app, mapping errors and handling business logic...
func signIn(email:password:)() -> Result<User, AuthError>
Doc: Signs in a user with the given email and password.
...
MIT