{"id":15749306,"url":"https://github.com/yoannchaudet/hospitable","last_synced_at":"2025-03-13T13:32:29.090Z","repository":{"id":52895405,"uuid":"349907429","full_name":"yoannchaudet/hospitable","owner":"yoannchaudet","description":"Hospitable is a set of cmdlets (advanced functions) for \"pretty printing\" things in a terminal/console.","archived":false,"fork":false,"pushed_at":"2021-04-22T18:00:59.000Z","size":4059,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T20:06:25.125Z","etag":null,"topics":["console","formatting","list","powershell","powershell-module","terminal","tree"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","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/yoannchaudet.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":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2021-03-21T05:22:56.000Z","updated_at":"2024-11-13T20:34:38.000Z","dependencies_parsed_at":"2022-08-23T08:30:36.248Z","dependency_job_id":null,"html_url":"https://github.com/yoannchaudet/hospitable","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannchaudet%2Fhospitable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannchaudet%2Fhospitable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannchaudet%2Fhospitable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannchaudet%2Fhospitable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoannchaudet","download_url":"https://codeload.github.com/yoannchaudet/hospitable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243414530,"owners_count":20287137,"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":["console","formatting","list","powershell","powershell-module","terminal","tree"],"created_at":"2024-10-04T06:01:50.844Z","updated_at":"2025-03-13T13:32:28.535Z","avatar_url":"https://github.com/yoannchaudet.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- PROJECT LOGO --\u003e\n\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/yoannchaudet/hospitable\"\u003e\n    \u003cimg src=\"images/hospitable.png\" alt=\"Hospitable logo\" width=\"640\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n![PowerShell Gallery Version](https://img.shields.io/powershellgallery/v/hospitable) [![codecov](https://codecov.io/gh/yoannchaudet/hospitable/branch/main/graph/badge.svg?token=oaUoNkiZgp)](https://codecov.io/gh/yoannchaudet/hospitable)\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [About The Project](#about-the-project)\n- [Built With](#built-with)\n- [Getting Started](#getting-started)\n- [Usage and Examples](#usage-and-examples)\n  - [Text Formatting](#text-formatting)\n  - [Get-Lists](#get-lists)\n  - [Get-Tree](#get-tree)\n- [License](#license)\n- [Contact](#contact)\n\n## About The Project\n\nA good host is said to be *hospitable*. I like bad puns so this project which contains a set of PowerShell [cmdlets][cmdlets] (in the form of [advanced functions][advanced-functions]) for printing stuff on terminal/console is perfectly named.\n\nThis project supports PowerShell 7+ and is compatible with Windows 10+, MacOS and Linux. Because most pretty outputs rely on [virtual terminal sequences (based on VT-100)][vt-100], older versions of Windows are not supported.\n\n## Built With\n\n- [PowerShell][powershell], a great (and now interoperable!) scripting language\n- [Pester][pester], a test framework for PowerShell\n\n## Getting Started\n\nTo get started, follow these steps:\n\n- Install [PowerShell][powershell]\n\n- In a PowerShell prompt, install the latest version from the PowerShell Gallery with:\n\n   ```powershell\n  Install-Module Hospitable -Scope CurrentUser\n   ```\n\n- Or in any shell, get yourself a local development environment with:\n\n   ```sh\n   # Install build dependencies\n   ./install-build-dependencies.ps1\n\n   # Run tests\n   ./build.ps1 Test\n\n   # Import the local module in the current shell (so cmdlets can be called)\n   ./build.ps1 Import\n   ```\n\n## Usage and Examples\n\nThe following examples can be run in a PowerShell prompt.\n\n### Text Formatting\n\nThe following text formatting is supported:\n\n```powershell\n# Bold, underline and negative formats\nGet-Bold bold\nGet-Underline underline\nGet-Negative negative\n\n# Strike through (available in PowerShell v7.2.0-preview.3 +)\n# See https://github.com/PowerShell/PowerShell/pull/14461\nGet-StrikeThrough strikethrough\n\n# They can be combined too (e.g. using pipes)\n'hello there' | Get-Bold | Get-Underline\n```\n\n![text formatting example](./images/text-formatting.png)\n\n### Get-Lists\n\nFormat a list (of lists).\n\n```powershell\n# A 3-element list including a nested list\nGet-Lists 'item 1', @('sub group item 1', 'sub group item 2'), 'item 3'\n\n# With some formatting\nGet-Lists ('item 1' | Get-Underline), ('item 2' | Get-Underline)\n```\n\n![Get-Lists example](./images/get-lists.png)\n\n### Get-Tree\n\nFormat a tree.\n\n```powershell\nGet-Tree {\n  Node 'Fruits' {\n    Node '🥝 Kiwi'\n    Node '🥭 Mango'\n    Node '🍌 Banana'\n  }\n\n  Node 'Vegetables' {\n    Node '🥕 Carrot'\n    Node '🥔 Potato'\n  }\n}\n```\n\n![Get-Tree (simple)](./images/get-tree1.png)\n\nA tree is specified using a simple [domain-specific language (DSL)][dsl] and it supports the following extra features:\n\n1. A node may have multiple columns (that are displayed as space-separated strings)\n2. Columns can be aligned (left, right and centered)\n3. Nodes can have their column aligned together into \"alignment groups\", by default all nodes are part of the `0` alignment group\n\nHere are few examples showcasing these features.\n\n```powershell\nGet-Tree {\n  Node 'Stock' {\n    # Align the first column (0-indexed) of all children (recursively) to the right\n    ChildrenColumnAlignment 0 'Right'\n    Node (Get-Bold 'ITOT'), 'iShares Core S\u0026P Total US Stock Market ETF', (Get-Negative '$89.93')\n    Node (Get-Bold 'IXUS'), 'iShares Core MSCI Total International Stock ETF', (Get-Negative '$69.50')\n  }\n\n  Node 'Crypto' {\n    Node 'Bitcoin' {\n      Node (Get-Bold 'GBTC'), 'Grayscale Bitcoin Trust (Btc)', (Get-Negative '$44.54') {\n        # Specifically align the first column to the left\n        ColumnAlignment 0 'Right'\n      }\n    }\n  }\n}\n```\n\n![Get-Tree (column alignment)](./images/get-tree2.png)\n\n```powershell\nGet-Tree {\n  Node 'Show', 'Year'\n  Node 'Episode', 'Title', 'Rating' {\n    ColumnAlignment 0 'Right'\n\n    # Specifically group this node in the alignment group 1 (instead of the default which is 0)\n    AlignmentGroup 1\n  }\n\n  Node (\"The Queen's Gambit\" | Get-Bold), '2020' {\n    Node 'Season 1' {\n      # Group all children nodes in the alignment group 1\n      ChildrenAlignmentGroup 1\n\n      Node 'Ep1', 'Openings', '8.5/10'\n      Node 'Ep2', 'Exchanges', '8.8/10'\n      Node 'Ep3', 'Doubled Pawns', '8.5/10'\n      Node 'Ep4', 'Middle Game', '8.5/10'\n      Node 'Ep5', 'Fork', '8.3/10'\n      Node 'Ep6', 'Adjournment', '8.5/10'\n      Node 'Ep7', 'End Game', '9.3/10'\n    }\n  }\n\n  Node ('Pushing Daisies' | Get-Bold), '2007–2009' {\n    Node 'Season 1' {\n      ChildrenAlignmentGroup 1\n\n      Node 'Ep1', 'Pie-lette', '8.8/10'\n      Node 'Ep2', 'Dummy', '8.2/10'\n      Node 'Ep3', 'The Fun in Funeral', '8.3/10'\n      Node 'Ep4', 'Pigeon', '8.4/10'\n      Node 'Ep5', 'Girth', '8.3/10'\n      Node 'Ep6', 'Bitches', '8.2/10'\n      Node 'Ep7', 'Smell of Success', '8.3/10'\n      Node 'Ep8', 'Bitter Sweets', '8.6/10'\n      Node 'Ep9', 'Corpsicle', '8.6/10'\n    }\n\n    Node 'Season 2' {\n      ChildrenAlignmentGroup 1\n\n      Node 'Ep1', 'Bzzzzzzzzz!', '8.5/10'\n      Node 'Ep2', 'Circus', '8.4/10'\n      Node 'Ep3', 'Bad Habits', '8.4/10'\n      Node 'Ep4', 'Frescorts', '8.5/10'\n      Node 'Ep5', 'Dim Sum Lose Some', '8.6/10'\n      Node 'Ep6', \"Oh Oh Oh... It's Magic\", '8.7/10'\n      Node 'Ep7', 'Robbing Hood', '8.3/10'\n      Node 'Ep8', 'Comfort Food', '9.0/10'\n      Node 'Ep9', 'The Legend of Merle McQuoddy', '8.4/10'\n      Node 'Ep10', 'The Norwegians', '8.8/10'\n      Node 'Ep11', 'Window Dressed to Kill', '8.8/10'\n      Node 'Ep12', 'Water \u0026 Power', '8.6/10'\n      Node 'Ep13', 'Kerplunk', '8.9/10'\n    }\n  }\n}\n```\n\n![Get-Tree (alignment group)](./images/get-tree3.png)\n\n## License\n\nDistributed under the MIT License. See [`LICENSE`](./LICENSE) for more information.\n\n## Contact\n\n[Project link][hospitable-at-github]\n\n\u003c!-- MARKDOWN LINKS --\u003e\n[hospitable-at-github]: https://github.com/yoannchaudet/hospitable\n[advanced-functions]:https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced?view=powershell-7.1\n[cmdlets]:https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/cmdlet-overview?view=powershell-7.1\n[pester]: https://pester.dev/\n[powershell]: https://github.com/PowerShell/PowerShell\n[vt-100]: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences\n[dsl]: https://en.wikipedia.org/wiki/Domain-specific_language","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoannchaudet%2Fhospitable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoannchaudet%2Fhospitable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoannchaudet%2Fhospitable/lists"}