feat: add CLI commands to manage AI Gateway keys (#25689)

Adds `coder ai-gateway keys` commands:
* `create <name>` creates key with given name
* `list` lists existing keys (alias `ls`)
* `delete <name | id>` removes key matching by name or key id, name has
priority (alias `rm`)
This commit is contained in:
Paweł Banaszewski
2026-06-18 09:08:17 +00:00
committed by GitHub
parent 803daaa8b7
commit 0dbe0442f0
16 changed files with 591 additions and 5 deletions
+5 -5
View File
@@ -14,11 +14,11 @@ import (
// AIGatewayKey is a shared secret used by a standalone AI Gateway
// to authenticate into coderd.
type AIGatewayKey struct {
ID uuid.UUID `json:"id" format:"uuid"`
Name string `json:"name"`
KeyPrefix string `json:"key_prefix"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
LastUsedAt *time.Time `json:"last_used_at,omitempty" format:"date-time"`
ID uuid.UUID `json:"id" table:"id" format:"uuid"`
Name string `json:"name" table:"name,default_sort"`
KeyPrefix string `json:"key_prefix" table:"key prefix"`
CreatedAt time.Time `json:"created_at" table:"created at" format:"date-time"`
LastUsedAt *time.Time `json:"last_used_at,omitempty" table:"last used at" format:"date-time"`
}
// CreateAIGatewayKeyRequest requests a new AI Gateway key.