ranjanakarsh/Swift-API-Extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Extracts a structured summary (including doc comments) of all classes, structs, protocols, enums, typealiases, variables, and functions from all .swift files in a directory (recursively). Optimized for LLM ingestion and codebase documentation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published