{"id":13478402,"url":"https://github.com/Textualize/trogon","last_synced_at":"2025-03-27T07:31:05.026Z","repository":{"id":167858959,"uuid":"629591033","full_name":"Textualize/trogon","owner":"Textualize","description":"Easily turn your Click CLI into a powerful terminal application","archived":false,"fork":false,"pushed_at":"2025-03-08T12:55:27.000Z","size":501,"stargazers_count":2594,"open_issues_count":47,"forks_count":64,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-03-25T22:03:33.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Textualize.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-18T16:06:50.000Z","updated_at":"2025-03-25T08:48:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0e21be6-70b9-4901-8e65-5aae87591a5d","html_url":"https://github.com/Textualize/trogon","commit_stats":null,"previous_names":["textualize/trogon"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Textualize%2Ftrogon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Textualize%2Ftrogon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Textualize%2Ftrogon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Textualize%2Ftrogon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Textualize","download_url":"https://codeload.github.com/Textualize/trogon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245802394,"owners_count":20674653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:01:56.472Z","updated_at":"2025-03-27T07:31:05.005Z","avatar_url":"https://github.com/Textualize.png","language":"Python","readme":"\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/Textualize/trogon/assets/554369/f4751783-c322-4143-a6c1-d8c564d4e38f\" alt=\"A picture of a trogon (bird) sitting on a laptop\" width=\"300\" align=\"center\"\u003e\n\u003c/p\u003e\n    \n[![Discord](https://img.shields.io/discord/1026214085173461072)](https://discord.gg/Enf6Z3qhVr)\n\n\n# Trogon\n\nAuto-generate friendly terminal user interfaces for command line apps.\n\n\n\u003cdetails\u003e  \n  \u003csummary\u003e 🎬 Video demonstration \u003c/summary\u003e\n\n\u0026nbsp;\n    \nA quick tour of a Trogon app applied to [sqlite-utils](https://github.com/simonw/sqlite-utils).\n\nhttps://github.com/Textualize/trogon/assets/554369/c9e5dabb-5624-45cb-8612-f6ecfde70362\n\n\u003c/details\u003e\n\n\nTrogon works with the popular [Click](https://click.palletsprojects.com/) library for Python, but will support other libraries and languages in the future.\n\n## How it works\n\nTrogon inspects your (command line) app and extracts a *schema* which describes the options / switches / help etc.\nIt then uses that information to build a [Textual](https://github.com/textualize/textual) UI you can use to edit and run the command. \n\nUltimately we would like to formalize this schema and a protocol to extract or expose it from apps.\nThis which would allow Trogon to build TUIs for any CLI app, regardless of how it was built.\nIf you are familiar with Swagger, think Swagger for CLIs.\n\n## Screenshots\n\n\u003ctable\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\n\u003cimg width=\"100%\" alt=\"Screenshot 2023-05-20 at 12 07 31\" src=\"https://github.com/Textualize/trogon/assets/554369/009cf3f2-f0c4-464b-bd74-60e303864443\"\u003e\n\u003c/td\u003e\n\n\u003ctd\u003e\n\u003cimg width=\"100%\" alt=\"Screenshot 2023-05-20 at 12 08 21\" src=\"https://github.com/Textualize/trogon/assets/554369/b1039ee6-4ba6-4123-b0dd-aa7b2341672f\"\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003ctd\u003e\n\u003cimg width=\"100%\" alt=\"Screenshot 2023-05-20 at 12 08 53\" src=\"https://github.com/Textualize/trogon/assets/554369/c0a42277-e946-4bef-b0d0-3fa87e4ab55b\"\u003e\n\u003c/td\u003e\n\n\u003ctd\u003e\n\u003cimg width=\"100%\" alt=\"Screenshot 2023-05-20 at 12 09 47\" src=\"https://github.com/Textualize/trogon/assets/554369/55477f6c-e6b8-49b6-85c1-b01bee006c8e\"\u003e\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n## Why?\n\nCommand line apps reward repeated use, but they lack in *discoverability*.\nIf you don't use a CLI app frequently, or there are too many options to commit to memory, a Trogon TUI interface can help you (re)discover options and switches.\n\n## What does the name mean?\n\nThis project started life as a [Textual](https://github.com/Textualize/textual) experiment, which we have been giving birds' names to.\nA [Trogon](https://www.willmcgugan.com/blog/photography/post/costa-rica-trip-report-2017/#bird) is a beautiful bird I was lucky enough to photograph in 2017.\n\nSee also [Frogmouth](https://github.com/Textualize/frogmouth), a Markdown browser for the terminal.\n\n## Roadmap\n\nTrogon is usable now. It is only 2 lines (!) of code to add to an existing project.\n\nIt is still in an early stage of development, and we have lots of improvements planned for it.\n\n## Installing\n\nTrogon may be installed with PyPI.\n\n```bash\npip install trogon\n```\n\n## Quickstart\n\n### Click\n1. Import `from trogon import tui`\n2. Add the `@tui` decorator above your click app, e.g.\n    ```python\n    from trogon import tui\n    \n    @tui()\n    @click.group(...)\n    def cli():\n        ...\n    ```\n3. Your click app will have a new `tui` command available.\n\n### Typer\n1. Import `from trogon.typer import init_tui`\n2. Pass your Typer CLI app into the `init_tui` function, e.g.\n    ```python\n    cli = typer.Typer(...)\n    init_tui(cli)\n    ```\n3. Your Typer app will have a new `tui` command available.\n\nSee also the `examples` folder for two example apps.\n\n## Custom command name and custom help\n\nBy default the command added will be called `tui` and the help text for it will be `Open Textual TUI.`\n\nYou can customize one or both of these using the `command=` and `help=` parameters:\n\n```python\n@tui(command=\"ui\", help=\"Open terminal UI\")\n@click.group(...)\ndef cli():\n    ...\n```\n\n## Follow this project\n\nIf this app interests you, you may want to join the Textual [Discord server](https://discord.gg/Enf6Z3qhVr) where you can talk to Textual developers / community.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTextualize%2Ftrogon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTextualize%2Ftrogon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTextualize%2Ftrogon/lists"}