{"id":21387185,"url":"https://github.com/sshtools/sequins","last_synced_at":"2025-03-16T12:20:25.323Z","repository":{"id":84133122,"uuid":"587511898","full_name":"sshtools/sequins","owner":"sshtools","description":"A Java library for prettier console output","archived":false,"fork":false,"pushed_at":"2025-01-03T12:39:29.000Z","size":203,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-23T00:13:31.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/sshtools.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-01-10T23:20:08.000Z","updated_at":"2025-01-03T12:39:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0b4afdb-5895-49b9-a22d-8ee22d532b20","html_url":"https://github.com/sshtools/sequins","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fsequins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fsequins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fsequins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fsequins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sshtools","download_url":"https://codeload.github.com/sshtools/sequins/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243865440,"owners_count":20360445,"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-11-22T12:12:04.861Z","updated_at":"2025-03-16T12:20:25.301Z","avatar_url":"https://github.com/sshtools.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sequins\n\nSome extensions and helpers used to augment [JLine3](https://github.com/jline/jline3), as used in\nseveral [JADAPTIVE](https://jadaptive.com) command line applications such as [Push SFTP](https://github.com/sshtools/push-sftp).\n\n## Get Sequins\n\nIt is available in Maven Central. \n\n```xml\n\u003cdependency\u003e\n   \u003cgroupId\u003ecom.sshtools\u003c/groupId\u003e\n   \u003cartifactId\u003esequins\u003c/artifactId\u003e\n   \u003cversion\u003e0.0.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Features\n\n * Nested progress output with animated spinners\n * Simple prompting (passwords, yes/no, text)\n * Highlights `MessageFormat.format()` and `String.format()` arguments.\n * Draw tables with box drawing characters\n\n## Anti-features\n\n * Will not support full screen features\n\n## TODO\n\n * Tests\n * More Widgets\n\n## Examples\n\n### HelloWorld\n\n```java\n\tSequins.create().messageln(\"Hello World\");\n```\n\n### HelloWorld Formatting\n\nThe formatter arguments will be bolded.\n\n```java\n\nvar terminal = Sequins.create();\nvar rnd = new Random();\nterminal.messageln(\"Hello World, its {0} degrees outside today, with a {1}% chance of rain.\", rnd.nextInt(-10, 50), rnd.nextInt(0, 100));\n```\n\n### Errors\n\nWill output on `System.err` instead of `System.out`.\n\n```java\nvar terminal = Sequins.create();\ntry {\n\tthrow new Exception(\"Bang!\");\n}\ncatch(Exception e) {\n\tterminal.errorln(\"Something has gone terribly wrong\");\n\tterminal.error(e);\n}\n```\n\n### Prompting\n\nPrompt for text, passwords, confirmation.\n\n```java\nvar terminal = Sequins.create();\nvar name = terminal.prompt(\"what is your name?\");\nvar age = terminal.prompt(\"Hello {0}, what is you age?\", name);\nif(terminal.yesNo(\"Are you sure {0}, age {1}.\", name, age)) {\n\tvar pw = terminal.password(\"Ok then {0}, what is your password?\", name);\n\tterminal.messageln(\"Thanks, storing password {0} for later shenannigans\", new String(pw));\n}\n```\n\n### Sequences\n\nWith a sequence you can create a string of formatted and styled text, using background and foreground colours and text styles such as italic, bold, and underline.\n\n```java\nvar terminal = Sequins.create();\nvar seq = terminal.createSequence();\n\t\t\nvar encoded = seq.str(\"With a \").boldOn().str(\"sequence\").boldOff().\n\t\t\tstr(\" you can create a string of formatted and styled text, \").\n\t\t\tstr(\"using \").bg(Color.RED).str(\"background\").defaultBg().\n\t\t\tstr(\" and \").fg(Color.GREEN).str(\"foreground\").defaultFg().\n\t\t\tstr(\" colours and text styles such as \").\n\t\t\titalic(true).str(\"italic\").italic(false).ch(' ').\n\t\t\tboldOn().str(\"bold\").boldOff().str(\" and \").\n\t\t\tunderlineOn().str(\"underline\").underlineOff().ch('.').toString();\n\t\t\nvar wrt = terminal.getWriter();\nwrt.write(encoded);\nwrt.flush();\n```\n\n### Progress\n\nIntended for long running tasks, where output might be line by line, or animated progress. Progress can be nested too (with the output of each nested level being indented further).\n\n```java\nvar terminal = Sequins.create();\nbldr = terminal.progressBuilder();\nbldr.withIndeterminate();\nbldr.withHideCursor();\nbldr.withPercentageText();\ntry(var progress = bldr.build()) {\n\tprogress.message(Level.NORMAL, \"Line 1. {0}\", \"Arg1\");\n\tsleep(DELAY);\n\tprogress.message(Level.NORMAL, \"Line 2. {0}\", \"Arg2\");\n\tsleep(1000);\n\tfor(int i = 0 ; i \u003c= 10; i++) {\n\t\tprogress.progressMessage(\"Count {0}\", i);\n\t\tsleep(3000);\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshtools%2Fsequins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsshtools%2Fsequins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshtools%2Fsequins/lists"}