Micro-toolkit

microsh

Embedded devices need a small command console over an existing byte stream.

A fixed-capacity shell parses ASCII commands and calls registered argc/argv handlers.

DevelopmentMITC99
Last verified
Not audited against current README/docs
Platform scope
Portable C99; integration depends on caller-provided adapters

What it solves

Embedded devices need a small command console over an existing byte stream.

How it works

1Byte stream2line editor3command table4handler5output callback

Use it when

Add a UART service console
Expose status and diagnostic commands
Drive the shell from an RTT or USB CDC stream

Quick Start

#include "msh.h"
static msh_t shell;
msh_init(&shell,uart_print,NULL);
msh_register(&shell,"status","Show status",cmd_status);
msh_prompt(&shell);
/* Expected terminal: prompt; status prints ok. */

Real scenarios

01

Add a UART service console

A fixed-capacity shell parses ASCII commands and calls registered argc/argv handlers.

02

Expose status and diagnostic commands

A fixed-capacity shell parses ASCII commands and calls registered argc/argv handlers.

03

Drive the shell from an RTT or USB CDC stream

A fixed-capacity shell parses ASCII commands and calls registered argc/argv handlers.

Engineering evidence

  • CMake package and C/C++ consumer examples are documented

Known limits

  • ASCII-oriented; no Unicode line editing
  • msh_feed is not ISR-safe or reentrant
  • Output callbacks are synchronous