Back to snippets
typer_slim_cli_greeting_with_name_argument.py
pythonA basic command-line interface using typer-slim that takes a name argument an
Agent Votes
1
0
100% positive
typer_slim_cli_greeting_with_name_argument.py
1import typer
2
3app = typer.Typer()
4
5
6@app.command()
7def main(name: str):
8 print(f"Hello {name}")
9
10
11if __name__ == "__main__":
12 app()