{"id":32166304,"url":"https://github.com/threatfender/tux","last_synced_at":"2026-02-21T03:30:57.799Z","repository":{"id":243427588,"uuid":"811022856","full_name":"threatfender/tux","owner":"threatfender","description":"Write well-structured command line interfaces with ease.","archived":false,"fork":false,"pushed_at":"2025-11-11T23:18:00.000Z","size":164,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-12T01:12:25.398Z","etag":null,"topics":["cli","elixir","terminal"],"latest_commit_sha":null,"homepage":"https://tuxpkg.dev","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/threatfender.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-05T19:45:26.000Z","updated_at":"2025-11-11T23:18:03.000Z","dependencies_parsed_at":"2024-06-12T22:23:19.497Z","dependency_job_id":"ff6b1713-116f-4e81-a0fc-7abecb944bb1","html_url":"https://github.com/threatfender/tux","commit_stats":null,"previous_names":["threatfender/tux"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/threatfender/tux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threatfender%2Ftux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threatfender%2Ftux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threatfender%2Ftux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threatfender%2Ftux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threatfender","download_url":"https://codeload.github.com/threatfender/tux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threatfender%2Ftux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29672704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T03:11:15.450Z","status":"ssl_error","status_checked_at":"2026-02-21T03:10:34.920Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","elixir","terminal"],"created_at":"2025-10-21T15:05:14.920Z","updated_at":"2026-02-21T03:30:57.708Z","avatar_url":"https://github.com/threatfender.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tux\n\n[Official Site](https://tuxpkg.dev/)\n– [Docs](https://hexdocs.pm/tux)\n– [Examples](https://github.com/threatfender/tux/tree/master/examples)\n\n\u003cimg src=\"assets/logo.png\"/\u003e\n\n*Terminal User Experience*\n\nTux is a **modular**, **dependency-free** Elixir library\ndesigned for the speedy creation of elegant command line interfaces\nwhich subscribe to the philosophy *\"One module per command\"*.\n\nIts modular structure ensures its core functionalities can be overwritten\nand composed to fulfill custom needs, and having no dependencies means it can\nachieve a higher level of security by minimizing trusted parties.\n\n\n## Quickstart\n\nTo quickly bootstrap a new tux-based CLI project, use the [tux_new](https://hex.pm/packages/tux_new) generator available on [Hex](https://hex.pm/):\n\n```shell\n$ mix do archive.install hex tux_new + tux.new mycli\n```\n\n## Installation\n\nAdd `tux` to your list of dependencies in `mix.exs` and optionally update\nyour `.formatter.exs`:\n\n```\n# mix.exs\n{:tux, \"~\u003e 0.4.0\"}\n\n# .formatter.exs\nimport_deps: [:tux]\n```\n\n## Example\n\nHere's a very short example to illustrate the mechanics of the library,\nalthough keep in mind that tux has more features, among which: `command preloads`, `nested commands`, `command alerts`, `help messages`, `command testing` and more.\n\n1. A **command module** implements a command:\n\n```elixir\ndefmodule Demo.HelloCmd do\n  use Tux.Command\n\n  @impl true\n  def about(), do: \"Greet current user\"\n\n  @impl true\n  def main(env, args), do: {:ok, \"Hello #{env.pre.user}!\"}\nend\n```\n\n2. A **dispatcher module** groups commands together:\n\n```elixir\ndefmodule Demo do\n  use Tux.Dispatcher\n\n  # Command registration\n  cmd \"hello\", Demo.HelloCmd, preloads: [:user]\n  cmd \"adios\", Demo.AdiosCmd\n  cmd \"group\", Demo.AnotherDispatcher\n\n  # Preloads can be executed before each command that registers them\n  def user(_), do: System.fetch_env!(\"USER\")\nend\n```\n\n3. **Test** your escript with the supplied testing macros:\n\n```elixir\ndefmodule DemoTest do\n  use Tux.Case\n\n  scenario \"check greet command\",\n    using: Demo,\n    invoke: \"hello\",\n    expect: [approx: \"Hello\"]\n\n  test \"check another command\" do\n    bar = :erlang.monotonic_time() |\u003e abs() |\u003e to_string()\n\n    execute Demo,\n      invoke: \"foo #{bar}\",\n      expect: [approx: \"some response\"]\n  end\nend\n```\n\n4. **Build** your elixir app as an escript, just make sure to add the\n `escript: [main_module: Demo]` to the `:project` section of your `mix.exs`.\n See [mix escript.build](https://hexdocs.pm/mix/main/Mix.Tasks.Escript.Build.html) for more details.\n\n```sh\n$ mix escript.build\nGenerated escript demo\n\n$ ./demo hello\nHello tuxuser!\n```\n\n## Next Steps\n\n  * Visit the [official site](https://tuxpkg.dev)\n  * Read the [docs](https://hexdocs.pm/tux) on HexDocs\n  * Look into the [examples](https://github.com/threatfender/tux/tree/master/examples) folder for complete escripts\n\n## License\n\nTux is open source software licensed under the Apache 2.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreatfender%2Ftux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreatfender%2Ftux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreatfender%2Ftux/lists"}