feat: add org apps connect and authorize commands#88
Merged
Conversation
Connect apps at the organization level with direct credentials
(POST /v1/org/apps/{provider}/connect) and start org-scoped OAuth flows by
printing the captured authorize URL (GET /v1/org/apps/{provider}/authorize,
redirects never followed). Org connections are shared by every project;
auth is the organization API key as a plain bearer. Includes help catalog
entries, a README Organization section, and the corrected default API host.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
guyb1
force-pushed
the
feat/org-apps-connect
branch
from
July 4, 2026 22:10
f2fa848 to
a7283d7
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.
What
Two new commands in the
org appsgroup, wrapping the canonical org-level connect endpoints:onecli org apps connect --provider X --field k=v [--json …] [--label …] [--connection-id …] [--method …] [--dry-run]— connect an app at the organization level with direct credentials (API-key apps). The connection is shared by every project in the org. Dry-run masks all credential values.onecli org apps authorize --provider X [--connection-id …]— start the org-scoped OAuth flow and print{"authorizeUrl": …}captured from the redirectLocation(never follows it, never opens a browser — the hint tells the agent/user to open it).Client methods:
ConnectOrgApp(POST /v1/org/apps/{provider}/connect) andOrgAppAuthorizeURL(GET /v1/org/apps/{provider}/authorizewith a no-redirect client,resp.Location()resolution, and the legacy/apiprefix fallback preserved). Plus: hand-maintainedhelp.gocatalog entries, a compact READMEOrganizationsection (theorggroup was previously undocumented), and a fix for the stale default host in the README (app.onecli.sh→api.onecli.sh, matchinginternal/config).Auth is the organization API key (
oc_org_…) as a plain bearer — no extra headers; the org is derived from the key.Verification
go build,go test -race ./...,golangci-lint run(0 issues),gofmtclean.Locationcapture without following, legacy/apiprefix rewrite, emptyconnectionIdomitted from the query, error paths, andbuildConnectFields(json+flag merge, connect-scoped empty error).org connections list,org apps connect --dry-run,org apps authorizeall returned the expected JSON.Review
Reviewed via this repo's own skills, each SKILL.md read in full:
agent-first-cli(output/exit-code/dry-run/input-hardening contracts),golang-patterns,golang-pro(MUST-list walked). 5 findings fixed:resp.Location()instead of the raw header (+ dead clause),--connection-idvalidated at the command boundary, a connect-specific empty-fields error via a sharedmergeCredentialFieldscore,url.PathEscapeon the new client paths, and the test coverage above. Help catalog verified flag-for-flag against the Kong structs; README verified line-by-line against the real commands.Related PRs (merge order)
Server-side surface: https://github.com/onecli/onecli-cloud/pull/625 (must be deployed first — these commands 404 against older servers, surfacing as a normal not-found error with exit code 3). SDK sibling: onecli/node-sdk#45. Docs: https://github.com/onecli/onecli-docs/pull/6 (lands last).
🤖 Generated with Claude Code