23 lines
500 B
Python
23 lines
500 B
Python
import typer
|
|
from typing import Optional
|
|
|
|
from rich.console import Console
|
|
from rich.table import Table
|
|
from rich.prompt import Prompt
|
|
|
|
import os
|
|
import json
|
|
|
|
import secnex.utils as u
|
|
|
|
console = Console()
|
|
|
|
utils_app = typer.Typer()
|
|
|
|
@utils_app.command(name="secret", help="Generate a new secret")
|
|
def generate_secret() -> str:
|
|
"""Generate a new secret"""
|
|
secret = u.generate_secret()
|
|
console.print(f"Secret: {secret}")
|
|
console.print(f"Hash: {u.hash_secret(secret)}")
|
|
return secret |