-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
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:
- Setup
spf13/cobra - Add
generateandvalidatesubcommands - Add
server startcommand to run API - Add interactive shell with basic command auto-complete
- Add CLI flags for custom configuration
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers