@@ -97,6 +97,7 @@ func TestAPIKeysCreateBuildsParamsAndPrintsPlaintextKey(t *testing.T) {
9797 require .NoError (t , err )
9898
9999 out := buf .String ()
100+ assert .Contains (t , out , "Created API key: key_123" )
100101 assert .Contains (t , out , "key_123" )
101102 assert .Contains (t , out , "sk_live_123" )
102103 assert .Contains (t , out , "Prod" )
@@ -201,6 +202,26 @@ func TestAPIKeysUpdateRequiresName(t *testing.T) {
201202 assert .Contains (t , err .Error (), "--name is required" )
202203}
203204
205+ func TestAPIKeysUpdatePrintsTerseSuccess (t * testing.T ) {
206+ buf := capturePtermOutput (t )
207+ fake := & FakeAPIKeysService {
208+ UpdateFunc : func (ctx context.Context , id string , body kernel.APIKeyUpdateParams , opts ... option.RequestOption ) (* kernel.APIKey , error ) {
209+ assert .Equal (t , "key_123" , id )
210+ assert .Equal (t , "renamed" , body .Name )
211+ return apiKeyFromJSON (`{"id":"key_123","name":"renamed","masked_key":"sk_...123","created_at":"2026-05-27T12:00:00Z","created_by":{"id":"user_123","email":"dev@example.com","name":"Dev"},"expires_at":null,"project_id":null,"project_name":null}` ), nil
212+ },
213+ }
214+ c := APIKeysCmd {apiKeys : fake }
215+
216+ err := c .Update (context .Background (), APIKeysUpdateInput {ID : "key_123" , Name : "renamed" })
217+ require .NoError (t , err )
218+
219+ out := buf .String ()
220+ assert .Contains (t , out , "Updated API key: key_123" )
221+ assert .NotContains (t , out , "Masked Key" )
222+ assert .NotContains (t , out , "sk_...123" )
223+ }
224+
204225func TestAPIKeysDeleteSkipsConfirmation (t * testing.T ) {
205226 buf := capturePtermOutput (t )
206227 deleted := false
0 commit comments