gradient: add doctl commands for Anthropic API Keys#1876
Open
DO-rrao wants to merge 1 commit into
Open
Conversation
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>
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
Implements the Anthropic API Keys operations in
doctlunderdoctl gradient anthropic-key, closing APICLI-2960. The implementation mirrors the existing OpenAI keys commands and uses the Anthropic API key methods already available ingodo.New subcommands:
list— list all Anthropic API keyscreate— create a key (--name,--api-key)get— get a key by UUIDupdate— update a key by UUIDdelete— delete a key by UUID (-f)get-agents— list agents using a given Anthropic keyChanges:
do/gradientai.go: addAnthropicApiKey/AnthropicApiKeystypes 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:AnthropicApiKeydisplayer.commands/gradientai.go: registerAnthropicKeyCmd().args.go: addArgAnthropicKeyName/ArgAnthropicKeyAPIKey.Test plan
go build ./...go test ./commands/ -run AnthropicKey(all pass)gradient/anthropic-key/{list,create,get,get-agents,update,delete}(14 cases pass)doctl gradient anthropic-key list|create|get|update|delete|get-agentsNotes
--Anthropic-key-idflag onagent create/updatehas an inconsistent capitalA(ArgAnthropicKeyId = "Anthropic-key-id"). Left untouched here as out of scope; happy to fix in a follow-up.Made with Cursor