-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a CLI to interact with Gallagher Command Centre #13
Comments
There's a feature request to make the library See also: fastapi/typer#88 |
basic layout of the cli application using typer and subcommands REFS #13
subcommands have been setup in accordance to the documentation with typer routing the cardholder commands and then fetching the data via the client rich is rendering tables to the terminal REFS #13
See the rich pretty print protocol to provide the highlighting syntax from the |
import typer
from typing_extensions import Annotated
def main(name: Annotated[str, typer.Argument(envvar="AWESOME_NAME")] = "World"):
print(f"Hello Mr. {name}")
if __name__ == "__main__":
typer.run(main) does not highlight how to use this feature when designing commands and sub commands. We ought to research this via discussions before we head into implementing it. Our basic requirement is to have the |
moves assigning the environment variable to the top of the package this should still check if the environment variable is available before cli endpoints are executed REFS #13
a proposed detail feature of the cli, this establishes a pattern that we can use to build out the other parts of the cli REFS #13 suggest that we merge this back into the dto-implementation branch post this commit to continue development as a whole
We use poetry run python -m rich.spinner
poetry run python -m rich.live
poetry run python -m rich.progress
poetry run python -m rich.status
|
wires up the cardholder search to the cli, demonstrating use of the enums proper annotations for typer to spell out the options on the interface this should serve as the template to wire up almost all searches refs #13
While building the API, I found myself constantly making http requests to test payloads. I have also been moving a lot of my workloads to the command line for services like
stripe
orgithub
via their CLI.I also have a set of
httpie
based payloads that I use to support some of our clients e.g:The proposal is to build upon the REST API client and provide a cli to interact with the command centre to perform various operations.
A sample of what the user would be able to do would look like:
or
The text was updated successfully, but these errors were encountered: