feat: request time-boxed operation access from the CLI - #540
Open
ab-alien-dev wants to merge 3 commits into
Open
feat: request time-boxed operation access from the CLI#540ab-alien-dev wants to merge 3 commits into
ab-alien-dev wants to merge 3 commits into
Conversation
Greptile SummaryThe PR adds CLI support for creating, inspecting, and waiting on time-boxed operation-access requests, including automatic access requests during operation invocation.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/alien-cli/src/commands/access_requests.rs | Adds access-request creation, retrieval, approval-coordinate polling, and approval waiting with human and JSON output modes. |
| crates/alien-cli/src/commands/operations.rs | Adds access-request-assisted invocation and post-operation verification while resolving the previously reported JSON-output, error-propagation, and polling-deadline issues. |
| crates/alien-cli/src/lib.rs | Registers and dispatches the new platform-only access-requests command. |
| client-sdks/platform/openapi.json | Updates the Platform API contract consumed by generated clients for access requests and operation invocation. |
Sequence Diagram
sequenceDiagram
participant Caller
participant CLI
participant Platform
participant Operator
participant Customer
participant Deployment
Caller->>CLI: operations invoke --request-access
CLI->>Platform: Invoke operation
Platform-->>CLI: Pending approval
CLI->>Platform: Create access request
Operator->>Platform: Report grant coordinates
CLI->>Platform: Poll request and coordinates
CLI-->>Caller: Request ID and kubectl command on stderr
Customer->>Operator: Approve grant in cluster
CLI->>Platform: Poll until approved
CLI->>Platform: Re-invoke with access request ID
Platform->>Deployment: Dispatch operation
Deployment-->>CLI: Operation result
CLI->>Platform: Check verification
CLI-->>Caller: One final JSON result on stdout
Reviews (3): Last reviewed commit: "fix: address second round of greptile fi..." | Re-trigger Greptile
Access requests previously only worked through Slack. Add a full alien access-requests create/get/wait path so a customer running their own AI agent (or a human) can request access, review the kubectl approve command, and wait for in-cluster approval without Slack. Approval always happens on the customer's side — there is deliberately no CLI approve action. - access-requests create: exact (<plugin>/<operation>) or wildcard (<plugin>/*, capped by --max-risk) requests, auto-detected from the --operation value. - access-requests get/wait: print the actual kubectl patch command once the operator materializes the grant CR, polling briefly so it's usually available immediately rather than requiring a second call. - operations invoke --request-access: create an access request, wait for approval, then re-invoke the same operation.
- operations invoke --request-access --json now emits the request ID and the kubectl approve command as JSON as soon as each is available, instead of suppressing all output until the up-to-1-hour approval wait resolves. - invoke no longer fails the whole command when the write already succeeded but the verification check call itself errors (network blip, API error) — degrades to Unverified instead of discarding the real result and reporting an already-applied write as failed. - Verification polling now caps its sleep to the remaining declared timeout instead of always sleeping a full interval, which could overrun the timeout by up to interval + request latency.
- --request-access --json no longer prints progress (request ID, approve command) as separate JSON documents on stdout, which made the stream unparseable as a single value. Progress now goes to stderr in all modes; stdout stays reserved for the one final JSON result, same convention as tools like docker pull. - verify_operation's retry loop now also bounds the verify-check HTTP request itself by the remaining declared timeout (previously only the sleep between attempts was capped), so a slow or stalled response can no longer keep the CLI running past the configured duration. A bounded-out request degrades to "not yet verified" rather than erroring, consistent with verification being alert-only.
ab-alien-dev
force-pushed
the
alan/alien-618-improve-operations-access-requests-through-cli
branch
from
August 30, 2026 20:56
a9b7533 to
dc5c81b
Compare
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.
Summary
alien access-requests create/get/waitso CLI/API callers (customers running their own AI agent, or a human) can request time-boxed operation access without Slack.createsupports both exact (--operation <plugin>/<operation>) and wildcard (--operation <plugin>/*+--max-risk) requests through a single--operationflag.get/waitfetch and print the customer's actualkubectl patch ...approve command once the operator materializes the grant CR, polling briefly so it's available right after creation rather than requiring a follow-up call.operations invoke --request-accesscreates an access request, waits for approval, then re-invokes the operation.Test plan
cargo check -p alien-cliandcargo test -p alien-cli --lib access_requestspasskubectl patchapprove →wait/invokedispatches → verified pod restart viakubectl get pods--operation 'kubernetes/*' --max-risk mutating)🤖 Generated with Claude Code