Skip to content

Instantly share code, notes, and snippets.

@eblume
Last active November 17, 2023 23:43
Show Gist options
  • Save eblume/da653cd3028f57177404587bc1d76fe5 to your computer and use it in GitHub Desktop.
Save eblume/da653cd3028f57177404587bc1d76fe5 to your computer and use it in GitHub Desktop.
import getpass
import typer
from typerassistant import TyperAssistant
from openai import OpenAI
app = typer.Typer()
client = OpenAI() # Assuming OPENAI_API_KEY is set in the environment
@app.command()
def say_hello(name: str):
print(f"Hello, {name}!")
@app.command()
def get_current_user():
print(getpass.getuser())
TyperAssistant(app, client=client)
app()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment