MCPcopy Create free account
hub / github.com/cactus-compute/cactus / cmd_auth

Function cmd_auth

python/src/cli.py:1328–1357  ·  view source on GitHub ↗

Manage Cactus Cloud API key.

(args)

Source from the content-addressed store, hash-verified

1326
1327
1328def cmd_auth(args):
1329 """Manage Cactus Cloud API key."""
1330 from .config_utils import CactusConfig
1331
1332 config = CactusConfig()
1333
1334 if args.clear:
1335 config.clear_api_key()
1336 print_color(GREEN, "API key cleared.")
1337 return 0
1338
1339 api_key = config.get_api_key()
1340
1341 if api_key:
1342 masked = api_key[:4] + "..." + api_key[-4:]
1343 print(f"Current API key: {masked}")
1344 else:
1345 print("No API key set.")
1346
1347 if args.status:
1348 return 0
1349
1350 print()
1351 print("Get your cloud key at \033[1;36mhttps://www.cactuscompute.com/dashboard/api-keys\033[0m")
1352 new_key = input("Enter new API key (press Enter to skip): ").strip()
1353 if new_key:
1354 config.set_api_key(new_key)
1355 masked = new_key[:4] + "..." + new_key[-4:]
1356 print_color(GREEN, f"API key saved: {masked}")
1357 return 0
1358
1359
1360def cmd_eval(args):

Callers 1

mainFunction · 0.85

Calls 5

clear_api_keyMethod · 0.95
get_api_keyMethod · 0.95
set_api_keyMethod · 0.95
CactusConfigClass · 0.85
print_colorFunction · 0.85

Tested by

no test coverage detected