diff --git a/cli/README.md b/cli/README.md index e69de29b..34292bb5 100644 --- a/cli/README.md +++ b/cli/README.md @@ -0,0 +1,3 @@ +## CLI + +This CLI solution is based on [tpyer](https://typer.tiangolo.com/) \ No newline at end of file diff --git a/cli/install.sh b/cli/install.sh new file mode 100644 index 00000000..2e929673 --- /dev/null +++ b/cli/install.sh @@ -0,0 +1,10 @@ +pip3 install typer + +# install Github CLI and upgrade it +sudo apt install dirmngr +curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null +sudo apt update +sudo apt install gh +sudo apt update +sudo apt install gh \ No newline at end of file diff --git a/cli/requirements.txt b/cli/requirements.txt new file mode 100644 index 00000000..7379290e --- /dev/null +++ b/cli/requirements.txt @@ -0,0 +1 @@ +typer \ No newline at end of file diff --git a/cli/stackhub.py b/cli/stackhub.py new file mode 100644 index 00000000..870c63a4 --- /dev/null +++ b/cli/stackhub.py @@ -0,0 +1,24 @@ +#!/usr/bin/python3 +import os, io, sys, platform, shutil, urllib3, json, time, subprocess + + +import typer + +app = typer.Typer() + + +@app.command() +def module(name: str): + typer.echo(f"Hello {name}") + + +@app.command() +def application(name: str, formal: bool = False): + if formal: + typer.echo(f"Goodbye Ms. {name}. Have a good day.") + else: + typer.echo(f"Bye {name}!") + + +if __name__ == "__main__": + app()