def create(uid, name, ttl):
    """
    Create a new api key for a user.
    :return:
    """
    click.echo("[+] Creating a new api key.")
    key = api_key_service.create(
        user_id=uid,
        name=name,
        ttl=ttl,
        issued_at=int(datetime.utcnow().timestamp()),
        revoked=False,
    )
    click.echo("[+] Successfully created a new api key. Generating a JWT...")
    jwt = create_token(uid, key.id, key.ttl)
    click.echo(f"[+] Your JWT is: {jwt}")

    Create a new api key for a user.
    :return:
    
lemur/api_keys/cli.py