We should introduce a Cobra-powered CLI for the otp-api application to allow users to interact with the OTP library and server via command-line and an optional interactive shell (REPL-like mode).
This will make the tool more flexible, allowing users to:
- 🛠️ Generate or validate TOTP/HOTP/OCRA directly from terminal
- ⚙️ Configure parameters (algorithm, digits, period, etc.)
- 🚀 Start or stop the HTTP API server
- 🧪 Run quick test commands interactively (REPL)
📌 Proposed CLI Structure:
otp-cli generate totp # Generate TOTP
otp-cli generate hotp # Generate HOTP
otp-cli generate ocra # Generate OCRA
otp-cli validate totp # Validate TOTP
otp-cli validate hotp # Validate HOTP
otp-cli validate ocra # Validate OCRA
otp-cli server start # Start the HTTP API server
otp-cli shell # Start interactive shell (REPL)
✅ Why?
- Improve developer ergonomics
- Useful for quick debugging, testing, and scripting
- CLI is a great companion to the API server
- Interactive mode can serve as a teaching tool or live demo utility
🧩 Tasks:
We should introduce a Cobra-powered CLI for the
otp-apiapplication to allow users to interact with the OTP library and server via command-line and an optional interactive shell (REPL-like mode).This will make the tool more flexible, allowing users to:
📌 Proposed CLI Structure:
✅ Why?
🧩 Tasks:
spf13/cobragenerateandvalidatesubcommandsserver startcommand to run API