{"id":21259956,"url":"https://github.com/uproid/capp","last_synced_at":"2026-03-01T15:33:48.624Z","repository":{"id":259859192,"uuid":"879679366","full_name":"uproid/capp","owner":"uproid","description":"This tool is ideal for creating console applications, with widgets for necessary Console elements, user input handling, Help generation, event handling for arguments, and option configuration.","archived":false,"fork":false,"pushed_at":"2025-09-01T21:24:25.000Z","size":34,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T23:27:21.065Z","etag":null,"topics":["console","dart","terminal"],"latest_commit_sha":null,"homepage":"https://webapp.uproid.com","language":"Dart","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/uproid.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}},"created_at":"2024-10-28T11:06:09.000Z","updated_at":"2025-09-01T21:24:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"67dedf97-8ba4-4f65-b826-c6b641b501bc","html_url":"https://github.com/uproid/capp","commit_stats":null,"previous_names":["uproid/capp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/uproid/capp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uproid%2Fcapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uproid%2Fcapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uproid%2Fcapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uproid%2Fcapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uproid","download_url":"https://codeload.github.com/uproid/capp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uproid%2Fcapp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29973320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T15:29:09.406Z","status":"ssl_error","status_checked_at":"2026-03-01T15:28:28.558Z","response_time":124,"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":["console","dart","terminal"],"created_at":"2024-11-21T04:16:04.151Z","updated_at":"2026-03-01T15:33:48.606Z","avatar_url":"https://github.com/uproid.png","language":"Dart","readme":"# Capp - Console Application Package\n[![pub package](https://img.shields.io/pub/v/capp.svg)](https://pub.dev/packages/capp)\n[![Dev](https://img.shields.io/pub/v/capp.svg?label=dev\u0026include_prereleases)](https://pub.dev/packages/capp)\n[![Donate](https://img.shields.io/badge/Support-Donate-pink.svg)](https://buymeacoffee.com/fardziao)\n\n`Capp` is a powerful Dart package designed to simplify the development of interactive console applications with features for handling user inputs, generating help information, managing arguments, and creating visually structured outputs like tables and progress indicators.\n\n## Elements\n- **Progress indicators**\n- **Yes/No input fields**  \n- **Text/Number input fields**  \n- **Multiple-choice input fields**  \n- **Multi-option selectors**  \n- **Table views**\n- **Json viewer**\n\n## Features\n\n- **Argument and Option Management**: Define and manage command-line arguments and options easily.\n- **User Input Handling**: Supports reading user inputs with prompts and selection options.\n- **Structured Output**: Display tables, messages in color, and various progress indicators in the console.\n- **Help Generation**: Automatically generate a help guide for your console commands and options.\n\n\n## Getting Started\n\n1. Add `capp` to your `pubspec.yaml`.\n2. Import `package:capp/capp.dart`.\n3. Create commands, options, and user inputs to build your interactive console application.\n\n## Example Usage\n\n```dart\nimport \"package:capp/capp.dart\";\n\nvoid main([\n  List\u003cString\u003e args = const [],\n]) {\n  var app = CappManager(\n    main: CappController(\n      '',\n      options: [\n        CappOption(\n          name: 'help',\n          shortName: 'h',\n          description: 'Show help',\n        ),\n      ],\n      run: (c) async {\n        if (c.existsOption('help')) {\n          return CappConsole(c.manager.getHelp());\n        } else {\n          return test(c);\n        }\n      },\n    ),\n    args: args,\n    controllers: [\n      CappController(\n        'test',\n        options: [],\n        run: test,\n      ),\n    ],\n  );\n\n  app.process();\n}\n\nFuture\u003cCappConsole\u003e test(c) async {\n  const options = [\n    'Progress circle',\n    'Progress bar',\n    'Progress spinner',\n    'Yes/No questions',\n    'Input text',\n    'Make a table',\n    'Clear screen',\n    'Help',\n    'Exit',\n  ];\n  var select = CappConsole.select(\n    'Select an option to test Widgets of console:',\n    options,\n  );\n  CappConsole.write('Your selection is: $select', CappColors.success);\n\n  // Progress circle\n  if (select == options[0]) {\n    await CappConsole.progress(\n      'I am waiting here for 5 secounds!',\n      () async =\u003e Future.delayed(Duration(seconds: 5)),\n      type: CappProgressType.circle,\n    );\n  }\n  // Progress bar\n  else if (select == options[1]) {\n    await CappConsole.progress(\n      'I am waiting here for 5 secounds!',\n      () async =\u003e Future.delayed(Duration(seconds: 5)),\n      type: CappProgressType.bar,\n    );\n  }\n  // Progress spinner\n  else if (select == options[2]) {\n    await CappConsole.progress(\n      'I am waiting here for 5 secounds!',\n      () async =\u003e Future.delayed(Duration(seconds: 5)),\n      type: CappProgressType.spinner,\n    );\n  }\n  // Yes/No Questions\n  else if (select == options[3]) {\n    final res = await CappConsole.yesNo('Do you agree? ');\n    CappConsole.write(\n      \"Your answer is ${res ? 'YES' : 'NO'}\",\n      CappColors.warnnig,\n    );\n  }\n  // Input text\n  else if (select == options[4]) {\n    var age = CappConsole.read(\n      'What is your age?',\n      isRequired: true,\n      isNumber: true,\n    );\n\n    CappConsole.write(\n      \"Your age is: $age\",\n      CappColors.success,\n    );\n  }\n  // Make a table\n  else if (select == options[5]) {\n    const table = [\n      ['#', 'Name', 'Age', 'City', 'Job'],\n      ['1', 'Farhad', '38', 'Amsterdam', 'Engineer'],\n      ['2', 'Adrian', '25', 'Berlin', 'Teacher'],\n      ['3', 'Arian', '33', 'Frankfort', 'Taxi driver']\n    ];\n\n    CappConsole.writeTable(table);\n\n    CappConsole.writeTable(\n      table,\n      color: CappColors.warnnig,\n      dubleBorder: true,\n    );\n  }\n  // Clear Screen\n  else if (select == options[6]) {\n    CappConsole.clear();\n  }\n  // Help\n  else if (select == options[7]) {\n    CappConsole.write(c.manager.getHelp());\n  } else if (select == options.last) {\n    return CappConsole('Exit!');\n  }\n\n  return test(c);\n}\n```\n\n## Example Output\n\n```shell\n$ dart ./example/example.dart\n\n\nSelect an option to test Widgets of console:\n\n  [1]. Progress circle\n  [2]. Progress bar\n  [3]. Progress spinner\n  [4]. Yes/No questions\n  [5]. Input text\n  [6]. Make a table\n  [7]. Clear screen\n  [8]. Help\n  [9]. Exit\n\n\nEnter the number of the option: 1\nYour selection is: Progress circle\nI am waiting here for 5 secounds!               ⢿                            \n\n\nSelect an option to test Widgets of console:\n\n  [1]. Progress circle\n  [2]. Progress bar\n  [3]. Progress spinner\n  [4]. Yes/No questions\n  [5]. Input text\n  [6]. Make a table\n  [7]. Clear screen\n  [8]. Help\n  [9]. Exit\n\n\nEnter the number of the option: 2\nYour selection is: Progress bar\nI am waiting here for 5 secounds! █████░████████                            \n\n\nSelect an option to test Widgets of console:\n\n  [1]. Progress circle\n  [2]. Progress bar\n  [3]. Progress spinner\n  [4]. Yes/No questions\n  [5]. Input text\n  [6]. Make a table\n  [7]. Clear screen\n  [8]. Help\n  [9]. Exit\n\n\nEnter the number of the option: 3\nYour selection is: Progress spinner\nI am waiting here for 5 secounds! |-----\u003e-------|                          \n\n\nSelect an option to test Widgets of console:\n\n  [1]. Progress circle\n  [2]. Progress bar\n  [3]. Progress spinner\n  [4]. Yes/No questions\n  [5]. Input text\n  [6]. Make a table\n  [7]. Clear screen\n  [8]. Help\n  [9]. Exit\n\n\nEnter the number of the option: 4\nYour selection is: Yes/No questions\n\n\nDo you agree?  (y/n): N\nYour answer is NO\n\n\nSelect an option to test Widgets of console:\n\n  [1]. Progress circle\n  [2]. Progress bar\n  [3]. Progress spinner\n  [4]. Yes/No questions\n  [5]. Input text\n  [6]. Make a table\n  [7]. Clear screen\n  [8]. Help\n  [9]. Exit\n\n\nEnter the number of the option: 5\nYour selection is: Input text\n\n\nWhat is your age? 33\nYour age is: 33\n\n\nSelect an option to test Widgets of console:\n\n  [1]. Progress circle\n  [2]. Progress bar\n  [3]. Progress spinner\n  [4]. Yes/No questions\n  [5]. Input text\n  [6]. Make a table\n  [7]. Clear screen\n  [8]. Help\n  [9]. Exit\n\n\nEnter the number of the option: 5\nYour selection is: Input text\n\n\nWhat is your age? 33\nYour age is: 33\n\n\nSelect an option to test Widgets of console:\n\n  [1]. Progress circle\n  [2]. Progress bar\n  [3]. Progress spinner\n  [4]. Yes/No questions\n  [5]. Input text\n  [6]. Make a table\n  [7]. Clear screen\n  [8]. Help\n  [9]. Exit\n\n\nEnter the number of the option: 6\nYour selection is: Make a table\n┌───┬────────┬─────┬────────────┬─────────────┐\n│ # │  Name  │ Age │    City    │     Job     │\n├───┼────────┼─────┼────────────┼─────────────┤\n│ 1 │ Farhad │ 38  │ Amsterdam  │ Engineer    │\n├───┼────────┼─────┼────────────┼─────────────┤\n│ 2 │ Adrian │ 25  │ Berlin     │ Teacher     │\n├───┼────────┼─────┼────────────┼─────────────┤\n│ 3 │ Arian  │ 33  │ Frankfort  │ Taxi driver │\n└───┴────────┴─────┴────────────┴─────────────┘\n\n╔═══╦════════╦═════╦════════════╦═════════════╗\n║ # ║  Name  ║ Age ║    City    ║     Job     ║\n╠═══╬════════╬═════╬════════════╬═════════════╣\n║ 1 ║ Farhad ║ 38  ║ Amsterdam  ║ Engineer    ║\n╠═══╬════════╬═════╬════════════╬═════════════╣\n║ 2 ║ Adrian ║ 25  ║ Berlin     ║ Teacher     ║\n╠═══╬════════╬═════╬════════════╬═════════════╣\n║ 3 ║ Arian  ║ 33  ║ Frankfort  ║ Taxi driver ║\n╚═══╩════════╩═════╩════════════╩═════════════╝\n\n\n\nSelect an option to test Widgets of console:\n\n  [1]. Progress circle\n  [2]. Progress bar\n  [3]. Progress spinner\n  [4]. Yes/No questions\n  [5]. Input text\n  [6]. Make a table\n  [7]. Clear screen\n  [8]. Help\n  [9]. Exit\n\n\nEnter the number of the option: 8\nYour selection is: Help\nAvailable commands:\n1) test:\n──────────────────────────────\n\n\n      --help    Show help\n      -h\n──────────────────────────────\n```","funding_links":["https://buymeacoffee.com/fardziao"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuproid%2Fcapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuproid%2Fcapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuproid%2Fcapp/lists"}