square/kotlinpoet

A Kotlin API for generating .kt source files.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 4 minutes ago
Added to GitGenius on September 16th, 2026
Created on March 1st, 2017
Open Issues & Pull Requests: 68 (+0)
GitHub issues: Enabled
Number of forks: 317
Total Stargazers: 4,159 (+0)
Total Subscribers: 44 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 6.2 hours
Mean response time: 72.9 days
90th percentile: 200.8 days
Tracked items: 58

Most active contributors

Sign in to see contributor activity.

How this project is maintained

Work labelled "bug" is answered fastest, typically in about 4 hours, while "PR welcome" waits about 2 days. Three people close 86% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 13
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,552 days
Stale 30+ days: 10
Stale 90+ days: 10

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (29)
  • enhancement (24)
  • PR welcome (19)
  • interop-javapoet (2)
  • interop-ksp (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

KotlinPoet is a code generation library that programmatically generates Kotlin source files through a fluent API.

The tool solves the problem of writing Kotlin code dynamically at runtime or build time without manual string concatenation or template engines. It works by providing a type-safe, composable API where developers construct Kotlin constructs—functions, classes, properties, and control flow—as objects that the library then renders into properly formatted source code. This approach ensures generated code follows Kotlin conventions and syntax rules automatically.

KotlinPoet suits projects that need to generate Kotlin code as part of their build pipeline, such as annotation processors, code generators for serialization frameworks, or tools that produce boilerplate. It is particularly valuable when the volume or complexity of generated code makes manual templates impractical. The library is designed for developers comfortable with programmatic APIs rather than template languages, and it integrates well into build systems where code generation happens before compilation.

The project maintains a steady stream of commits addressing bug fixes and feature requests, with pull requests reviewed and merged regularly. Development activity shows consistent engagement with the issue tracker, where maintainers respond to bug reports and feature proposals. The codebase receives updates that expand API coverage for newer Kotlin language features, indicating the project tracks language evolution and adapts accordingly.