{"id":17016850,"url":"https://github.com/nnbnh/hr","last_synced_at":"2026-03-15T03:37:14.653Z","repository":{"id":114416215,"uuid":"342849537","full_name":"NNBnh/hr","owner":"NNBnh","description":"📏 Portable horizontal ruler for terminal","archived":false,"fork":false,"pushed_at":"2022-07-02T04:17:48.000Z","size":65,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T04:34:22.097Z","etag":null,"topics":["basher","bpkg","cli","hr","posix","terminal"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NNBnh.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,"zenodo":null},"funding":{"custom":["https://www.buymeacoffee.com/nnbnh","https://nhantien.momo.vn/nnb"]}},"created_at":"2021-02-27T12:17:14.000Z","updated_at":"2022-10-04T03:06:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d94f4f9-2a77-4af6-bd69-91626ea2abba","html_url":"https://github.com/NNBnh/hr","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/NNBnh%2Fhr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NNBnh%2Fhr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NNBnh%2Fhr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NNBnh%2Fhr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NNBnh","download_url":"https://codeload.github.com/NNBnh/hr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248546927,"owners_count":21122408,"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":["basher","bpkg","cli","hr","posix","terminal"],"created_at":"2024-10-14T06:34:49.119Z","updated_at":"2026-03-15T03:37:14.612Z","avatar_url":"https://github.com/NNBnh.png","language":"Shell","funding_links":["https://www.buymeacoffee.com/nnbnh","https://nhantien.momo.vn/nnb"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/43980777/109386965-eefed000-7930-11eb-8b83-ef85d70196fa.png\"\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003ePortable horizontal ruler for terminal\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/NNBnh/hr/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/NNBnh/hr?labelColor=A05B53\u0026color=BF7958\u0026style=for-the-badge\" alt=\"License: GPL-3.0\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://gist.github.com/NNBnh/9ef453aba3efce26046e0d3119dab5a7#development-completed\"\u003e\u003cimg src=\"https://img.shields.io/badge/development-completed-%23BF7958.svg?labelColor=A05B53\u0026style=for-the-badge\u0026logoColor=FFFFFF\" alt=\"Development completed\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## 💡 About\n\n![`hr`](https://user-images.githubusercontent.com/43980777/109386947-cd054d80-7930-11eb-90b3-49836d184f25.png) (SuperB HR) is a CLI tool written in [`portable sh`](https://github.com/dylanaraps/pure-sh-bible) to render horizontal ruler/line in the terminal.\n\n### 📔 Story\n\nRecently, i'm obsessed with [`hr`](https://github.com/LuRsT/hr) and i want a portable shell `hr`, the best i found is *\"`POSIX`-ish Way\"* from the blog [Alternatives to the `hr` library](https://grayson.sh/blogs/some-alternatives-to-hr):\n\n```sh\nprintf '%*s' \"$(tput cols)\" | tr ' ' \"${*:-#}\"\n```\n\nbut it lacks [Gil Gonçalves's `hr`](https://github.com/LuRsT/hr) key features like output multiple line, custom text or even treats multi-byte symbols properly. So i decided to create ![`hr`](https://user-images.githubusercontent.com/43980777/109386947-cd054d80-7930-11eb-90b3-49836d184f25.png) based on the blog's method with only **6 lines** of [`portable sh`](https://github.com/dylanaraps/pure-sh-bible):\n\n```sh\n#!/bin/sh\nCOLUMNS=\"${COLUMNS:-$(tput cols)}\"\nfor text in \"${@:-${HR_DEFAULT_TEXT:-─}}\"; do\n\tprintf '\\033[?7l%*s\\033[?7h' \"$COLUMNS\" | sed -e \"s/ /$text/g\"\ndone\nexit 0\n```\n\n### ✨ Features\n\n- Extremely **minimum** *\"only **6 lines** of [`portable sh`](https://github.com/dylanaraps/pure-sh-bible)\"*\n- Can output **multiple lines** at once\n- Can define **custom text**\n- Treats **multi-byte symbols** properly\n- ![`hr`](https://user-images.githubusercontent.com/43980777/109386947-cd054d80-7930-11eb-90b3-49836d184f25.png)'s default text can be change through [environment variable](#%EF%B8%8F-configuration)\n\n\u003e **Note** *![`hr`](https://user-images.githubusercontent.com/43980777/109386947-cd054d80-7930-11eb-90b3-49836d184f25.png) can not be `source` or invoke from [Bash](https://www.gnu.org/software/bash), for that use [Gil Gonçalves's `hr`](https://github.com/LuRsT/hr)*\n\n## 🚀 Setup\n\n### 🧾 Dependencies\n\n- [Unix commands](https://en.wikipedia.org/wiki/List_of_Unix_commands) to process\n\n### 📥 Installation\n\n#### 🔧 Manually\n\n- Option 1: using `curl`\n\n```sh\ncurl https://raw.githubusercontent.com/NNBnh/hr/main/bin/hr \u003e ~/.local/bin/hr\nchmod +x ~/.local/bin/hr\n```\n\n- Option 2: using `git`\n\n```sh\ngit clone https://github.com/NNBnh/hr.git ~/.local/share/hr\nln -s ~/.local/share/hr/bin/hr ~/.local/bin/hr\n```\n\n#### 📦 Package manager\n\nFor [Bpkg](https://github.com/bpkg/bpkg) user:\n\n```sh\nbpkg install NNBnh/hr\n```\n\nFor [Basher](https://github.com/basherpm/basher) user:\n\n```sh\nbasher install NNBnh/hr\n```\n\n\u003e **Note** *If you can and want to port SuperB HR to other package managers, feel free to do so.*\n\n## ⌨️ Usage\n\nRun ![`hr`](https://user-images.githubusercontent.com/43980777/109386947-cd054d80-7930-11eb-90b3-49836d184f25.png) in the terminal:\n\n```sh\nhr [TEXTS]\n```\n\nExamples:\n\n```sh\nhr\n```\n\nthis will output:\n\n```console\n────────────────────────────────────────\n```\n\nYou can make multiple ![`hr`](https://user-images.githubusercontent.com/43980777/109386947-cd054d80-7930-11eb-90b3-49836d184f25.png) at the same time and with any `TEXT`:\n\n```sh\nhr '#' 'hr' 'Hello world! '\n```\n\nthis will output:\n\n```console\n########################################\nhrhrhrhrhrhrhrhrhrhrhrhrhrhrhrhrhrhrhrhr\nHello world! Hello world! Hello world! H\n```\n\n## ⚙️ Configuration\n\n![`hr`](https://user-images.githubusercontent.com/43980777/109386947-cd054d80-7930-11eb-90b3-49836d184f25.png) is configured through environment variables:\n\n```sh\nexport HR_DEFAULT_TEXT=\"\u003ctext\u003e\"\n```\n\n## 💌 Credits\n\nSpecial thanks to:\n- [**hr**](https://github.com/LuRsT/hr) by [Gil Gonçalves](https://github.com/LuRsT)\n- [**Alternatives to the 'hr' library**](https://grayson.sh/blogs/some-alternatives-to-hr) by [Grayson Kent](https://grayson.sh)\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n---\n\n\u003e \u003ch1 align=\"center\"\u003eMade with ❤️ by \u003ca href=\"https://github.com/NNBnh\"\u003e\u003ci\u003eNNB\u003c/i\u003e\u003c/a\u003e\u003c/h1\u003e\n\u003e\n\u003e \u003cp align=\"center\"\u003e\u003ca href=\"https://www.buymeacoffee.com/nnbnh\"\u003e\u003cimg src=\"https://img.shields.io/badge/buy_me_a_coffee%20-%23F7CA88.svg?logo=buy-me-a-coffee\u0026logoColor=333333\u0026style=for-the-badge\" alt=\"Buy Me a Coffee\"\u003e\u003c/a\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnbnh%2Fhr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnnbnh%2Fhr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnbnh%2Fhr/lists"}