Repository navigation
gdx/godaddy CLI support - #4
Merged
Merged
Conversation
jpage-godaddy
commented
May 26, 2026
Collaborator
- Add support for streaming JSON
- Add next actions support
- Add guide command
- Add PKCE OAuth provider
- Allow auditor/authz/activity providers to be injected through builder
- Add support for binary HTTP responses
- Add support for streaming JSON - Add next actions support - Add guide command - Add PKCE OAuth provider - Allow auditor/authz/activity providers to be injected through builder - Add support for binary HTTP responses
There was a problem hiding this comment.
Pull request overview
This PR extends cli-engine to better support agent-first CLIs by adding NDJSON streaming command execution, “next action” suggestions in envelopes, a built-in guide command, a feature-gated PKCE OAuth provider, injectable middleware providers (authz/audit/activity), and binary HTTP response handling.
Changes:
- Add streaming command support (
RuntimeCommandSpec::new_streaming) with NDJSON event writing to stdout. - Add
next_actionsto output envelopes + APIs to attach them from command results. - Add feature-gated
PkceAuthProvider(OAuth2 Authorization Code + PKCE) with keychain storage and refresh.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/transport/client.rs | Adds get_bytes for downloading raw/binary HTTP responses. |
| src/output/mod.rs | Re-exports NextAction and NextActionParam for public consumption. |
| src/output/envelope.rs | Adds next_actions to envelopes and defines NextAction/NextActionParam. |
| src/middleware.rs | Plumbs next_actions from CommandResultMetadata into the rendered envelope. |
| src/lib.rs | Exposes new streaming and next-actions types in the public API surface. |
| src/command.rs | Introduces streaming command handler types, StreamSender, and next-actions metadata on results. |
| src/cli.rs | Adds guide subcommand wiring, injectable middleware deps, root-name matching, and streaming execution path. |
| src/auth/pkce.rs | Adds a new PKCE auth provider implementation (feature-gated). |
| src/auth/mod.rs | Exposes auth::pkce behind the pkce-auth Cargo feature. |
| README.md | Documents the pkce-auth feature. |
| docs/design.md | Updates design docs for auth layout, streaming commands, and next_actions in envelopes. |
| docs/concepts.md | Documents streaming commands, PKCE provider, and next_actions. |
| docs/auth.md | Adds PKCE provider documentation and usage notes. |
| Cargo.toml | Adds optional deps + pkce-auth feature and enables Tokio io-std for stdout streaming. |
| Cargo.lock | Locks new transitive deps introduced by PKCE feature and stdout streaming support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1792
to
+1799
| let writer = tokio::spawn(async move { | ||
| let mut stdout = tokio::io::stdout(); | ||
| while let Some(event) = rx.recv().await { | ||
| let Ok(line) = serde_json::to_string(&event) else { | ||
| continue; | ||
| }; | ||
| if stdout.write_all(line.as_bytes()).await.is_err() | ||
| || stdout.write_all(b"\n").await.is_err() |
Comment on lines
+1829
to
+1835
| match output { | ||
| Ok(out) => Ok(out.into()), | ||
| Err(err) => Ok(CliRunOutput { | ||
| exit_code: exit_code_for_error(&err), | ||
| rendered: render_cli_error(middleware, &err, middleware.app_id.as_str()).rendered, | ||
| }), | ||
| } |
Comment on lines
+317
to
+318
| parse_token_response(response, "").await | ||
| } |
Comment on lines
+359
to
+362
| Command handlers can attach a list of follow-on command suggestions to any result using | ||
| `CommandResult::with_next_actions`. The framework includes these suggestions in every output | ||
| envelope under the `next_actions` key, regardless of output format: | ||
|
|
…, rand upgrade - Suppress trailing null-data envelope on successful streaming commands so NDJSON consumers see only event lines - Carry forward existing refresh token when OAuth server omits it from the refresh response, preventing unnecessary browser re-logins - Replace hand-rolled extract_query_param/url_decode with url::form_urlencoded::parse, fixing the ?-operator short-circuit on malformed query pairs and broken multi-byte UTF-8 decoding - Upgrade rand from 0.8 to 0.9, eliminating duplicate dependency tree - Add retry loop in wait_for_callback so stray connections don't consume the single OAuth callback accept - Add streaming success test and extract_query_param unit tests - Fix docs: scope next_actions to JSON/TOON, document streaming stdout bypass
- Read errors from stray connections now continue the accept loop instead of aborting the entire PKCE flow - Valid state with no authorization code (user denied access) returns an immediate error instead of looping until timeout
…rding - Add zeroize dependency behind pkce-auth feature - StoredToken derives ZeroizeOnDrop so access_token and refresh_token are cleared from memory when the struct drops - Manual Debug impl redacts token fields to prevent accidental logging - Fix design.md streaming docs to describe backpressure instead of claiming deadlock avoidance
jgowdy-godaddy
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.