Create a key for each application and pipeline, and replace or revoke it from your terminal without
opening the platform. graphops api-keys lists, creates, changes, renames, rotates and revokes your
organization's API keys.
graphops service-accounts creates service accounts,
changes their permissions, deletes them, and creates their keys. Run a command with --help to see
its options.
To keep one key on your own machine for development, store it instead: see Developer workflow.
Prerequisites
- The owner or developer role.
- A sign-in from the last 12 hours to create or change credentials. If the CLI asks you to sign in
again, run
graphops auth login.
Create a key
A new key's secret is shown once. Pass --reveal to print it, alone on its line, so you can pipe it
straight into your CI system's secret store. Or pass --secret-file <file> to write it to a new
file that only you can read. The command requires one of the two, or --store, which keeps the key
in your credential store for graphops exec instead.
graphops api-keys create without --product grants every data service your organization can use;
at a terminal, it asks which. Pass --product rpc (repeat for several) to grant only some.
Find and change a key
- Name a key by its name or ID.
show,update,rename,rotateandrevoketake either, asgraphops api-keys listshows them. When several keys share a name, the command lists their IDs for you to choose from.graphops api-keys showprints each product with its limits, such as networks, Endpoint Aliases, origins and Managed Subgraphs. - Replacing access names what changes.
graphops api-keys update <key> --product <product>replaces every product. The command prints what it added and removed and which limits changed. When the change removes a product or changes a limit, which can break an application or widen what the key reaches, repeat the key's name or ID with--confirm.
Replace or revoke a key
- Replace a key without downtime.
graphops api-keys rotatestops the old key at once. To avoid an outage, rungraphops api-keys create --like <key> --secret-file <file>, which creates a key with the same products and limits, deploy the new secret to your application, and then revoke the old key withgraphops api-keys revoke <key> --confirm <key>. - Rotating your stored key can store its replacement.
graphops api-keys rotate <key> --confirm <key> --storestores the new key forgraphops execand prints only its ID. If you rotate or revoke the stored key another way, the CLI warns that it no longer works; store another withgraphops api-keys storeorgraphops api-keys create --store --replace. - Rotating and revoking ask you to confirm. Repeat the key's name or ID with
--confirm. Revoking cannot be undone.
Manage service accounts
A service account is your organization's identity for automation, such as a release pipeline. Run the CLI in CI shows how a job signs in with one of its keys.
- Changing a service account's permissions keeps the others.
graphops service-accounts update <account> --add-grant <permission>adds a permission and--remove-grantremoves one. The command prints what changed and every permission the account then holds, with its limits. Adding a permission the account already holds keeps that permission's limits. - Replacing every permission names what changes. Pass
--grants <file>with the full list. In a--grantsfile, for service accounts or query keys, limit a permission to Managed Subgraphs by name or ID. When the change removes a permission or changes a limit, repeat the account's name or ID with--confirm. - Deleting asks you to confirm. Repeat the service account's name or ID with
--confirm.
--confirm guards against acting on the wrong resource through a typo. It is not your approval: a
coding agent must have your agreement before it runs one of these commands.
Next steps
Last updated
Sign in to the CLI
Sign the GraphOps CLI in to your account from a browser, check what you approve, and end a CLI session.
Manage Subgraphs and Endpoint Aliases
List, rename, retarget and delete Managed Subgraphs and Endpoint Aliases from the GraphOps CLI, and explore published Subgraphs before you query them.