Keys Rename
Easily rename an existing API key in Eyeroll with a simple command.
Rename an eyeroll API key.
Usage
/eyeroll:keys-rename [key-id] [new-name]
Steps
-
Check that
$EYEROLL_API_KEYis set. If not, tell the user to run/eyeroll:signupfirst. -
Set
EYEROLL_API_URLtohttps://api.eyeroll.devif not already set. -
If no key ID was provided, run
/eyeroll:keys-listto show available keys and ask the user which one to rename. -
If no new name was provided, ask the user for the new name.
-
Run:
curl -s -X PATCH "$EYEROLL_API_URL/api/keys/<KEY_ID>" \
-H "Authorization: Bearer $EYEROLL_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"name\": \"<NEW_NAME>\"}"
-
On success, display the updated key details (id, name, masked key value).
-
On 404, tell the user the key ID wasn't found and suggest running
/eyeroll:keys-listto see valid IDs.