Skip to content

gradient: add doctl commands for Anthropic API Keys#1876

Open
DO-rrao wants to merge 1 commit into
mainfrom
apicli-2960-anthropic-api-keys
Open

gradient: add doctl commands for Anthropic API Keys#1876
DO-rrao wants to merge 1 commit into
mainfrom
apicli-2960-anthropic-api-keys

Conversation

@DO-rrao

@DO-rrao DO-rrao commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the Anthropic API Keys operations in doctl under doctl gradient anthropic-key, closing APICLI-2960. The implementation mirrors the existing OpenAI keys commands and uses the Anthropic API key methods already available in godo.

New subcommands:

  • list — list all Anthropic API keys
  • create — create a key (--name, --api-key)
  • get — get a key by UUID
  • update — update a key by UUID
  • delete — delete a key by UUID (-f)
  • get-agents — list agents using a given Anthropic key

Changes:

  • do/gradientai.go: add AnthropicApiKey/AnthropicApiKeys types and the six service-layer methods wrapping godo.
  • do/mocks/GradientAIService.go: regenerated mock.
  • commands/gradientai_anthropic_key.go: new command group + run handlers.
  • commands/displayers/gradientai.go: AnthropicApiKey displayer.
  • commands/gradientai.go: register AnthropicKeyCmd().
  • args.go: add ArgAnthropicKeyName / ArgAnthropicKeyAPIKey.

Test plan

  • go build ./...
  • Unit tests: go test ./commands/ -run AnthropicKey (all pass)
  • Integration tests: gradient/anthropic-key/{list,create,get,get-agents,update,delete} (14 cases pass)
  • Manual verification against prod: doctl gradient anthropic-key list|create|get|update|delete|get-agents

Notes

  • The pre-existing --Anthropic-key-id flag on agent create/update has an inconsistent capital A (ArgAnthropicKeyId = "Anthropic-key-id"). Left untouched here as out of scope; happy to fix in a follow-up.

Made with Cursor

Implements the Anthropic API Keys operations under `doctl gradient
anthropic-key`, mirroring the existing OpenAI keys commands:

- list, create, get, update, delete
- get-agents (list agents using an Anthropic key)

Adds the service-layer methods, displayer, generated mock, and unit +
integration tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant