{"id":33244122,"url":"https://github.com/marcinbor85/microshell","last_synced_at":"2026-01-16T15:42:15.604Z","repository":{"id":43664572,"uuid":"356020643","full_name":"marcinbor85/microshell","owner":"marcinbor85","description":"MicroShell is a lightweight pure C implementation of shell emulator dedicated for embedded bare-metal systems.","archived":false,"fork":false,"pushed_at":"2024-06-20T12:20:57.000Z","size":645,"stargazers_count":223,"open_issues_count":6,"forks_count":32,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-06-24T01:03:17.396Z","etag":null,"topics":["arduino","bash","cli","embedded","esp32","filesystem","path","root","serial","shell","stm32","terminal","vt100"],"latest_commit_sha":null,"homepage":"https://microshell.pl","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/marcinbor85.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":"2021-04-08T19:04:46.000Z","updated_at":"2024-06-20T19:35:02.000Z","dependencies_parsed_at":"2024-06-24T01:01:45.520Z","dependency_job_id":"6b0d2e0d-2139-4d4b-b532-889debbb7fd6","html_url":"https://github.com/marcinbor85/microshell","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/marcinbor85/microshell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcinbor85%2Fmicroshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcinbor85%2Fmicroshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcinbor85%2Fmicroshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcinbor85%2Fmicroshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcinbor85","download_url":"https://codeload.github.com/marcinbor85/microshell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcinbor85%2Fmicroshell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":["arduino","bash","cli","embedded","esp32","filesystem","path","root","serial","shell","stm32","terminal","vt100"],"created_at":"2025-11-16T21:00:28.147Z","updated_at":"2026-01-16T15:42:15.598Z","avatar_url":"https://github.com/marcinbor85.png","language":"C","readme":"[![Build Status](https://travis-ci.org/marcinbor85/microshell.svg?branch=main)](https://travis-ci.org/marcinbor85/microshell)\n[![codecov](https://codecov.io/gh/marcinbor85/microshell/branch/main/graph/badge.svg?token=stcqeq0uMq)](https://codecov.io/gh/marcinbor85/microshell)\n\n# MicroShell\nLightweight pure C implementation of virtual shell, compatible with VT100 terminal. Support root tree, run-time mounting paths, global commands, and much more. Works out-of-the-box on Arduino-compatible boards. Dedicated for bare-metal embedded systems. Thanks to the asynchronous architecture it does not block operations and can be easily implemented even on small microcontrollers with relatively small resources.\n\n[Project Homepage](https://microshell.pl/)\\\n[LIVE DEMO](https://microshell.pl/demo) \u003c- needs PC web browser (not mobile)\n\n![alt text](https://github.com/marcinbor85/microshell/blob/main/website/screen.png?raw=true \"Screenshot\")\n\n## Features\n* names autocompletation (do You like a TAB-functionality on You favorite bash shell?)\n* no dynamic allocations (no memory leaks - no problem)\n* hardware independent (works just as well on AVR, PIC, STM32, ESP32 as it on x86 or RPI)\n* rich set of examples (available in the Arduino Library Manager)\n* pure C source code (works on rich set of compilers)\n* backspace key feature (simply works)\n* compatible vith VT100 standard (works out of the box with default putty configuration)\n* easy to extend (adding more \"weird\" features it has never been easier)\n* buildin commands (must-have, basic support of LS, CAT, PWD, HELP, XXD, ECHO)\n* scalable (configuration allows You to exclude unnecessary modules from building)\n* translation-ready (do You want Hindi translation? no problem!)\n* no internal buffers (support unlimited data stream lengths)\n* no static variables (possibility to use multiple independent shells in single system)\n* object oriented architecture (pointers attack!)\n* support root tree with static virtual files with callbacks (full customization)\n* extremely simple to integrate (only 1 simple interface with IO operations)\n* asynchronous architecture (static callbacks is not a problem)\n* non-blocking api (You just need to call one non-blocking function on main loop)\n* unit and functional tests (for greater certainty that nothing will break down)\n\n## Build\n\nIn case you didn't use git clone --recursive you'll need to manually pull in additional submodules with:\n\n```sh\ngit submodule update --init\n```\n\nBuild, test and run DEMO:\n\n```sh\ncmake -Bbuild .\ncd build\nmake\nmake test\nmake coverage\n./bin/demo\n```\n\n## Usage\n\nDefine I/O interface:\n\n```c\n// non-blocking read interface\nstatic int ush_read(struct ush_object *self, char *ch)\n{\n    // should be implemented as a FIFO\n    if (Serial.available() \u003e 0) {\n        *ch = Serial.read();\n        return 1;\n    }\n    return 0;\n}\n\n// non-blocking write interface\nstatic int ush_write(struct ush_object *self, char ch)\n{\n    // should be implemented as a FIFO\n    return (Serial.write(ch) == 1);\n}\n\n// I/O interface descriptor\nstatic const struct ush_io_interface ush_iface = {\n    .read = ush_read,\n    .write = ush_write,\n};\n```\n\nDefine shell descriptor and shell instance:\n\n```c\n// working buffers allocations (size could be customized)\n#define BUF_IN_SIZE    32\n#define BUF_OUT_SIZE   32\n#define PATH_MAX_SIZE  32\n\nstatic char ush_in_buf[BUF_IN_SIZE];\nstatic char ush_out_buf[BUF_OUT_SIZE];\n\n// microshell instance handler\nstatic struct ush_object ush;\n\n// microshell descriptor\nstatic const struct ush_descriptor ush_desc = {\n    .io = \u0026ush_iface,                           // I/O interface pointer\n    .input_buffer = ush_in_buf,                 // working input buffer\n    .input_buffer_size = sizeof(ush_in_buf),    // working input buffer size\n    .output_buffer = ush_out_buf,               // working output buffer\n    .output_buffer_size = sizeof(ush_out_buf),  // working output buffer size\n    .path_max_length = PATH_MAX_SIZE,           // path maximum length (stack)\n    .hostname = \"arduino\",                      // hostname (in prompt)\n};\n\n// root directory handler\nstatic struct ush_node_object root;\n```\n\nSetup and run:\n\n```c\nvoid setup()\n{\n    // initialize I/O interface\n    Serial.begin(115200UL);\n\n    // initialize microshell instance\n    ush_init(\u0026ush, \u0026ush_desc);\n\n    // mount root directory (root must be first)\n    ush_node_mount(\u0026ush, \"/\", \u0026root, NULL, 0);\n\n    // mount other directories here\n    // ...\n}\n\nvoid loop()\n{\n    // non-blocking microshell service\n    ush_service(\u0026ush);\n\n    // do other non-blocking stuff here\n    // ...\n}\n```\n\n## Contribution\n\nIf You want to contribute this project - excellent! Fork it, make bugs, and send a PR :)\\\nIf You want to support me in developing this project - please donate!\\\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=EQJAX25PAQKCS)\n","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=EQJAX25PAQKCS"],"categories":["User Interface"],"sub_categories":["CLI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcinbor85%2Fmicroshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcinbor85%2Fmicroshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcinbor85%2Fmicroshell/lists"}