10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/vkit/cli/commands/agent_tokens_create_command.rb', line 10
def call(options)
with_auth do
user = credential_store.user
org = user["organization_slug"]
response =
authenticated_client.post(
"/api/v1/orgs/#{org}/agent_tokens",
body: build_body(options)
)
token = response.fetch("token")
secret = response.fetch("secret")
puts "🔐 AGENT TOKEN ISSUED (shown once)"
puts
puts "🧠 Name: #{token["name"]}"
puts "🎭 Role: #{token["role"]}"
puts "🆔 Token ID: #{token["id"]}"
puts "🏷 Prefix: #{token["prefix"]}"
puts "⏳ Expires At: #{token["expires_at"] || "never"}"
puts
puts "🔑 TOKEN"
puts "────────────────────────────────────────"
puts secret
puts "────────────────────────────────────────"
puts
puts "⚠️ Store this token securely. It cannot be retrieved again."
end
end
|