{"id":19156444,"url":"https://github.com/ess/clipso","last_synced_at":"2026-03-03T04:12:04.451Z","repository":{"id":66321293,"uuid":"60886955","full_name":"ess/clipso","owner":"ess","description":null,"archived":false,"fork":false,"pushed_at":"2016-06-11T02:15:07.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-02-22T21:42:14.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/ess.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":"2016-06-11T02:14:49.000Z","updated_at":"2016-06-11T02:14:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"7557e89e-2e14-47f0-8214-a7c8cc928613","html_url":"https://github.com/ess/clipso","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ess/clipso","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ess%2Fclipso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ess%2Fclipso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ess%2Fclipso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ess%2Fclipso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ess","download_url":"https://codeload.github.com/ess/clipso/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ess%2Fclipso/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30031981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T03:27:35.548Z","status":"ssl_error","status_checked_at":"2026-03-03T03:27:09.213Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-11-09T08:34:30.408Z","updated_at":"2026-03-03T04:12:04.414Z","avatar_url":"https://github.com/ess.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLIpso\n\nThis is my rough attempt to port as much as I can of [Belafonte](https://github.com/ess/belafonte) to Crystal.\n\nIn short, this library is all about making CLI applications.\n\n## Installation\n\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  clipso:\n    github: ess/clipso\n```\n\n\n## Usage\n\nCLIpso can be used both to create traditional single-purpose applications (like `cat`, `ls`, `make`, etc), but it can also be used to create \"command suite\" applications (like `git`, `rails`, `heroku`, etc).\n\n### Traditional Applications ###\n\nAs mentioned above, \"traditional\" applications are single-purpose utilities. They tend to do one thing, with the goal of doing that one thing exceptionally well.\n\n```crystal\nrequire \"clipso\"\n\nclass MyApp \u003c CLIpso::App\n  # Every CLIpso application must have a title.\n  title \"myapp\"\n  summary \"A short description\"\n  description \"This is a much longer description of the app, command, or what have you.\"\n  \n  # Switches are boolean flags that can be passed on the command line.\n  # At least one of a short flag or a long flag must be given.\n\n  switch :switch_name,              # name the switch (required)\n    short: \"s\",                     # short flag for the switch\n    long: \"switch\",                 # long flag for the switch\n    description: \"This is a switch\" # describe the switch (default \"\")\n\n  # Options are flags that take an argument. The basic setup for this is the\n  # same as that for switches, but with the additional requirement of a\n  # display name for the option's argument.\n\n  option :option_name, # name the option (required)\n    short: \"o\",                       # short flag\n    long: \"option\",                   # long flag\n    description: \"This is an option\", # describe the option (default \"\")\n    argument: \"option name\"           # display name (required)\n\n  # Args are actual arguments to the command. These require a name, and by\n  # default are expected 1 time. You can specify any number of explicit\n  # occurrences that are greater-than 0, and you can also make them unlimited,\n  # but you're not allowed to add any further args after adding an unlimited\n  # arg.\n\n  arg :argument_name,\n    times: 1\n\n  arg :unlimited_argument,\n    times: unlimited\n\n  # The `handle` method that you define for your app is the hook that CLIpso\n  # uses to run your code. If you don't define this, your app won't actually\n  # do much of anything.\n\n  def handle\n    # Do something if the :switch_name switch is active\n\n    if switch_active?(:switch_name)\n      stdout.puts \"Switch is active!\"\n    else\n      stdout.puts \"Switch is not active :/\"\n    end\n\n    # Do something based on the options that came in\n    stdout.puts \"We got this option: #{option(:option)}\"\n\n    # Do something with the first argument we defined\n    stdout.puts arg(:argument_name).first\n\n    # Do something with the unlimited argument we defined\n    arg(:unlimited_argument).each do |unlimited|\n      stdout.puts \"unlimited == '#{unlimited}'\"\n    end\n  end\nend\n\n# Actually run the application. In addition to ARGV, the following .new args\n# are defaulted:\n#\n# * stdin (default: STDIN)\n# * stdout (default: STDOUT)\n# * stderr (default: STDERR)\n#\n# In a more perfect world, your executable file is basically just a require to\n# pull in your app, then this line.\n\nexit MyApp.new(ARGV).execute!\n```\n\n### Command Suite Applications ###\n\nCommand suite applications (CSAs) are, in the simplest scenario, a collection\nof Traditional Applications that are collected under a wrapper to provide a\nuniform user interface.\n\nCLIpso supports this sort of application through mounting, which is very\nsimilar in spirit to, say, mounting one Rack application under another. The API is the same as the Traditional App API with two exceptions:\n\n* Use `mount App` to mount an application as a subcommand\n* Apps that mount other apps cannot have \"unlimited\" args\n\nHere's an example:\n\n```crystal\nrequire \"clipso\"\n\nclass InnerApp \u003c CLIpso::App\n  title \"inner\"\n\n  def handle\n    stdout.puts \"This is the inner app\"\n  end\nend\n\nclass OuterApp \u003c CLIpso::App\n  title \"outer\"\n\n  mount InnerApp\n\n  def handle\n    stdout.puts \"This is the outer app\"\n  end\nend\n\nexit OuterApp.new(ARGV).execute!\n```\n\n## Development\n\nTODO: Write development instructions here\n\n## Contributing\n\n1. Fork it ( https://github.com/[your-github-name]/clipso/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [[your-github-name]](https://github.com/[your-github-name]) Dennis Walters - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fess%2Fclipso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fess%2Fclipso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fess%2Fclipso/lists"}