{"id":24739475,"url":"https://github.com/bang-olufsen/yash","last_synced_at":"2025-10-10T08:30:49.181Z","repository":{"id":44625350,"uuid":"386645770","full_name":"bang-olufsen/yash","owner":"bang-olufsen","description":"Yash - Yet Another Shell","archived":false,"fork":false,"pushed_at":"2023-01-27T08:59:23.000Z","size":4197,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-04-14T07:41:10.531Z","etag":null,"topics":["cplusplus","cpp","cpp11","embedded","header-only","minimal","shell"],"latest_commit_sha":null,"homepage":"","language":"C++","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/bang-olufsen.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}},"created_at":"2021-07-16T13:25:11.000Z","updated_at":"2024-02-21T20:37:27.000Z","dependencies_parsed_at":"2023-02-15T07:16:57.759Z","dependency_job_id":null,"html_url":"https://github.com/bang-olufsen/yash","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bang-olufsen%2Fyash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bang-olufsen%2Fyash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bang-olufsen%2Fyash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bang-olufsen%2Fyash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bang-olufsen","download_url":"https://codeload.github.com/bang-olufsen/yash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235936067,"owners_count":19068828,"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":["cplusplus","cpp","cpp11","embedded","header-only","minimal","shell"],"created_at":"2025-01-27T22:58:46.510Z","updated_at":"2025-10-10T08:30:43.827Z","avatar_url":"https://github.com/bang-olufsen.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yash - Yet Another Shell\n\n[![build](https://github.com/bang-olufsen/yash/actions/workflows/build.yml/badge.svg)](https://github.com/bang-olufsen/yash/actions/workflows/build.yml) [![coveralls](https://coveralls.io/repos/github/bang-olufsen/yash/badge.svg?branch=main)](https://coveralls.io/github/bang-olufsen/yash?branch=main) [![codeql](https://github.com/bang-olufsen/yash/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/bang-olufsen/yash/actions/workflows/codeql-analysis.yml) [![lgtm](https://img.shields.io/lgtm/grade/cpp/g/bang-olufsen/yash.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/bang-olufsen/yash/context:cpp) [![license](https://img.shields.io/badge/license-MIT_License-blue.svg?style=flat)](LICENSE)\n\nYash is a C++20 header-only minimal shell for embedded devices with support for command completion.\n\n![](https://raw.githubusercontent.com/bang-olufsen/yash/main/example/example.gif)\n\n It was created as a serial port shell but can be used for other interfaces as well by using `setPrint()`. The prompt can be customized with `setPrompt()` and commands are added as a std::array which can be constexpr to save memory. The command history size can be adjusted by the constructor (default 10). An example can be seen below (taken from [example.cpp](https://github.com/bang-olufsen/yash/blob/main/example/example.cpp) and what is demoed in the image above).\n\n```cpp\n#include \u003cYash.h\u003e\n#include \u003ccon.h\u003e\n\nvoid i2c(const std::string_view command, Yash::CommandArgs args)\n{\n    if (command == \"read\")\n        printf(\"i2cRead(%s, %s, %s)\\n\", args[0].data(), args[1].data(), args[2].data());\n    else if (command == \"write\")\n        printf(\"i2cWrite(%s, %s, %s)\\n\", args[0].data(), args[1].data(), args[2].data());\n}\n\nvoid info(Yash::CommandArgs /* unused */)\n{\n    printf(\"info()\\n\");\n}\n\nint main()\n{\n    static constexpr Yash::Config config { .maxRequiredArgs = 3, .commandHistorySize = 10 };\n    static constexpr auto commands = std::to_array\u003cYash::Command\u003e({\n        { \"i2c read\", \"I2C read \u003caddr\u003e \u003creg\u003e \u003cbytes\u003e\", [](Yash::CommandArgs args) { i2c(\"read\", args); }, 3 },\n        { \"i2c write\", \"I2C write \u003caddr\u003e \u003creg\u003e \u003cvalue\u003e\", [](Yash::CommandArgs args) { i2c(\"write\", args); }, 3 },\n        { \"info\", \"System info\", [](const auto args) { info(args); }, 0 }, // OR auto if preffered\n    });\n\n    Yash::Yash\u003cconfig\u003e yash(commands);\n    yash.setPrint([\u0026](const char* str) { printf(\"%s\", str); });\n    yash.setPrompt(\"$ \");\n\n    while (true)\n        yash.setCharacter(getch());\n\n    return 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbang-olufsen%2Fyash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbang-olufsen%2Fyash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbang-olufsen%2Fyash/lists"}