mirror of
https://github.com/koloideal/Argenta.git
synced 2026-08-08 17:01:13 +03:00
docs: add CLI documentation section with translations and code snippets; refactor mock/ to examples/, improve CLI module (bug fixes, DX, error handling)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# main.py
|
||||
from argenta import App, Orchestrator
|
||||
from argenta.app import DynamicDividingLine
|
||||
|
||||
from .routers import router
|
||||
|
||||
app: App = App(prompt='>>> ', dividing_line=None)
|
||||
orchestrator: Orchestrator = Orchestrator()
|
||||
|
||||
def main() -> None:
|
||||
app.include_router(router)
|
||||
orchestrator.run_repl(app)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# routers.py
|
||||
from argenta import Command, Response, Router
|
||||
|
||||
router = Router(title="Quickstart Example")
|
||||
|
||||
@router.command(Command("hello", description="Say hello"))
|
||||
def handler(response: Response):
|
||||
print("Hello, world!")
|
||||
|
||||
Reference in New Issue
Block a user