diff --git a/rscli/main.py b/rscli/main.py index fadd148..50fe719 100755 --- a/rscli/main.py +++ b/rscli/main.py @@ -5,14 +5,15 @@ from .config import Config from getpass import getpass from prettytable import PrettyTable import requests +from typing import Annotated VERSION = "1.0" -API_URI = "http://localhost:8080" + app = typer.Typer() config = Config() config.load() - +API_URI = config.get("API_URI") @app.command() def version(): print(f"Version: {VERSION}") @@ -34,7 +35,9 @@ def login(): config.save() print(table) - +@app.command() +def api_uri(url: Annotated[str, typer.Argument(help="The API Url (without /api...)")]): + config.set("API_URI", url) if __name__ == "__main__":