CLI Package
The lampe.cli package provides command-line interface functionality for the SDK.
Commands
lampe.cli.commands
check_reviewed
check_reviewed(repo: Path = typer.Option(..., exists=True, file_okay=False, dir_okay=True, readable=True), repo_full_name: str | None = typer.Option(None, help='Repository full name (e.g. owner/repo)'), output: str = typer.Option('auto', help='Output provider (auto|console|github|gitlab|bitbucket)'), pr_number: int | None = typer.Option(None, '--pr', help='Pull request number (required for non-console providers)'))
Check if the token user has already reviewed this PR.
Returns exit code 0 if reviewed, 1 if not reviewed.
Source code in packages/lampe-cli/src/lampe/cli/commands/check_reviewed.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
describe
describe(repo: Path = typer.Option(..., exists=True, file_okay=False, dir_okay=True, readable=True), repo_full_name: str | None = typer.Option(None, help='Repository full name (e.g. owner/repo)'), base: str = typer.Option(..., help='Base commit SHA'), head: str = typer.Option(..., help='Head commit SHA'), title: str = typer.Option('Pull Request', help='PR title (local runs)'), output: str = typer.Option('auto', help='Output provider (auto|console|github|gitlab|bitbucket)'), variant: str = typer.Option('default', help='default|agentic'), files_exclude: list[str] | None = typer.Option(None, '--exclude'), files_reinclude: list[str] | None = typer.Option(None, '--reinclude'), truncation_tokens: int = typer.Option(DEFAULT_MAX_TOKENS, '--max-tokens'), timeout: int | None = typer.Option(None, '--timeout-seconds'), verbose: bool = typer.Option(False, '--verbose/--no-verbose'))
Generate a PR description and deliver it to the specified output provider.
Source code in packages/lampe-cli/src/lampe/cli/commands/describe.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
healthcheck
healthcheck() -> None
Check if the CLI is healthy and can connect to the configured provider.
Source code in packages/lampe-cli/src/lampe/cli/commands/healthcheck.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
review
review(repo: Path = typer.Option(..., exists=True, file_okay=False, dir_okay=True, readable=True), repo_full_name: str | None = typer.Option(None, help='Repository full name (e.g. owner/repo)'), base: str = typer.Option(..., help='Base commit SHA'), head: str = typer.Option(..., help='Head commit SHA'), title: str = typer.Option('Pull Request', help='PR title (local runs)'), output: str = typer.Option('auto', help='Output provider (auto|console|github|gitlab|bitbucket)'), review_depth: ReviewDepth = typer.Option(ReviewDepth.STANDARD, help='Review depth (basic|standard|comprehensive)'), variant: str = typer.Option('multi-agent', help='Review variant (multi-agent|diff-by-diff)'), guidelines: list[str] | None = typer.Option(None, '--guideline', help='Custom review guidelines (can be repeated)'), files_exclude: list[str] | None = typer.Option(None, '--exclude'), timeout: int | None = typer.Option(None, '--timeout-seconds'), verbose: bool = typer.Option(False, '--verbose/--no-verbose'))
Generate a PR code review and deliver it to the specified output provider.
Model selection is automatic based on review_depth: - basic: gpt-5-nano - standard: gpt-5 - comprehensive: gpt-5.1
Source code in packages/lampe-cli/src/lampe/cli/commands/review.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
Orchestrators
lampe.cli.orchestrators
Providers
lampe.cli.providers
base
Provider(repository: Repository, pull_request: PullRequest)
Bases: ABC
Abstract provider for delivering workflow outputs.
Source code in packages/lampe-cli/src/lampe/cli/providers/base.py
78 79 80 | |
create_provider(provider_name: ProviderType | str, repository: Repository, pull_request: PullRequest) -> 'Provider'
staticmethod
Create a provider instance based on the specified type.
Source code in packages/lampe-cli/src/lampe/cli/providers/base.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
deliver_pr_description(payload: PRDescriptionPayload) -> None
abstractmethod
Deliver a PR description to the configured destination.
Source code in packages/lampe-cli/src/lampe/cli/providers/base.py
82 83 84 85 | |
deliver_pr_review(payload: PRReviewPayload) -> None
abstractmethod
Deliver a PR review to the configured destination.
Source code in packages/lampe-cli/src/lampe/cli/providers/base.py
87 88 89 90 | |
detect_provider_type() -> ProviderType
staticmethod
Detect the appropriate provider type based on available environment variables.
Source code in packages/lampe-cli/src/lampe/cli/providers/base.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
has_reviewed() -> bool
abstractmethod
Check if the token user has already reviewed this PR.
Source code in packages/lampe-cli/src/lampe/cli/providers/base.py
97 98 99 100 | |
healthcheck() -> None
abstractmethod
Check if the provider is healthy and can connect to the service.
Source code in packages/lampe-cli/src/lampe/cli/providers/base.py
92 93 94 95 | |
ProviderType
Bases: StrEnum
Available provider types.
update_or_add_text_between_tags(text: str, new_text: str, feature: str) -> str
Update the text between the tags and with new_text. If the tags don't exist, add them at the bottom of the text. The tags and new_text are preserved in the output.
Source code in packages/lampe-cli/src/lampe/cli/providers/base.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
bitbucket
BitbucketProvider(repository: Repository, pull_request: PullRequest)
Bases: Provider
Bitbucket provider for delivering PR descriptions to Bitbucket Cloud API.
Source code in packages/lampe-cli/src/lampe/cli/providers/bitbucket.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
deliver_pr_description(payload: PRDescriptionPayload) -> None
Update the PR description on Bitbucket.
Source code in packages/lampe-cli/src/lampe/cli/providers/bitbucket.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
deliver_pr_review(payload: PRReviewPayload) -> None
Post PR review comments on Bitbucket.
Source code in packages/lampe-cli/src/lampe/cli/providers/bitbucket.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | |
has_reviewed() -> bool
Check if the token user has already reviewed this PR.
Source code in packages/lampe-cli/src/lampe/cli/providers/bitbucket.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |
healthcheck() -> None
Check if the Bitbucket provider is healthy and can connect to Bitbucket.
Source code in packages/lampe-cli/src/lampe/cli/providers/bitbucket.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
console
ConsoleProvider(repository: Repository, pull_request: PullRequest)
Bases: Provider
Console provider for delivering PR descriptions to stdout.
Source code in packages/lampe-cli/src/lampe/cli/providers/console.py
16 17 | |
deliver_pr_description(payload: PRDescriptionPayload) -> None
Print the PR description to console.
Source code in packages/lampe-cli/src/lampe/cli/providers/console.py
19 20 21 | |
deliver_pr_review(payload: PRReviewPayload) -> None
Print the PR review to console.
Source code in packages/lampe-cli/src/lampe/cli/providers/console.py
23 24 25 | |
has_reviewed() -> bool
Check if the token user has already reviewed this PR.
Source code in packages/lampe-cli/src/lampe/cli/providers/console.py
31 32 33 34 | |
healthcheck() -> None
Check if the console provider is healthy and can connect to the service.
Source code in packages/lampe-cli/src/lampe/cli/providers/console.py
27 28 29 | |
github
GitHubProvider(repository: Repository, pull_request: PullRequest)
Bases: Provider
GitHub provider for delivering PR descriptions to GitHub API.
Source code in packages/lampe-cli/src/lampe/cli/providers/github.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
deliver_pr_description(payload: PRDescriptionPayload) -> None
Update the PR description on GitHub.
Source code in packages/lampe-cli/src/lampe/cli/providers/github.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
deliver_pr_review(payload: PRReviewPayload) -> None
Post PR review comments on GitHub.
Source code in packages/lampe-cli/src/lampe/cli/providers/github.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
has_reviewed() -> bool
Check if the token user has already reviewed this PR.
Source code in packages/lampe-cli/src/lampe/cli/providers/github.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | |
healthcheck() -> None
Check if the GitHub provider is healthy and can connect to GitHub.
Source code in packages/lampe-cli/src/lampe/cli/providers/github.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |