Repository navigation
Epic: gh-style commands for Source Cooperative #21
Description
Tracks the CLI half of source-cooperative/source.coop#588.
Goal
source-coop becomes to Source Cooperative what gh is to GitHub: every task a person can do in the web UI can be done from a terminal or a script. The CLI already handles login (OIDC with PKCE) and STS credentials. This epic adds commands on top of the /api/v1 endpoints that the source.coop epic builds. Those endpoints enforce exactly the same validation as the web UI, so the CLI validates nothing itself: it sends the request and shows the API's field_errors.
Conveniences, modeled on gh
source-coop api <method> <path> [-f key=value] [--input file]: thegh apiequivalent. It works with any endpoint as soon as the endpoint ships, before a dedicated command exists. Build it first.--json <fields>and--jq <expr>on every read, and a table when output is a TTY.--webopens the matching source.coop page.account/productshorthand, e.g.source-coop product view radiant/landcover.- Interactive prompts for missing required arguments when a TTY is attached, and none otherwise.
- Authentication through the existing cached login, or a service account's API key (feat: exchange a service account's API key without a browser #20), sent as
Authorization: Bearer. --helpand any generated request types come from the published OpenAPI document atsource.coop/api/openapi.
Commands
Each command group depends on the source.coop sub-issue that ships its endpoints.
-
api: needs only the existing API -
auth status:GET /whoami(API: accounts, organizations and profiles source.coop#592) -
product list | view | create | edit | delete(API: product list, create, view, edit and delete source.coop#590) -
product mirror list | add | edit | remove(API: product mirrors source.coop#591) -
member list | add | edit | remove,invite list | accept | reject(API foundation: one operation behind each server action and route, with generated OpenAPI docs (memberships pilot) source.coop#589) -
org create,account view | edit | search(API: accounts, organizations and profiles source.coop#592) -
connection list | view | create | edit | delete(API: data connections, including account-owned ones source.coop#593) -
service-account list | create | disable | delete,service-account trust add | remove(SERVICE_source-cooperative/source.coop#592), andservice-account key create | revoke(feat(accounts): issue, revoke and expire opaque API keys for service accounts source.coop#570) -
ls | cp | rm | syncfor product files, run against the data proxy's S3 API with the CLI's own STS credentials. These need no source.coop endpoint.
repo info (#16) folds into product view --json once the product endpoints land.
Docs
docs.source.coop docs/using-source/ gains a CLI path wherever a flow gets one.
Activity
feat: product list, view, create, edit and delete
source-coop api: raw requests to /api/v1 #27auth status#29product list | view | create | edit | delete#30product mirror list | add | edit | remove#31memberandinvitecommands #32org createandaccount view | edit | search#33connection list | view | create | edit | delete#34service-accountcommands #35ls | cp | rm | syncfor product files #36feat: product list, view, create, edit and delete
tag list | suggest | approve | rejectand--tagon product create/edit #68