TODO / Roadmap
v1.0
- Implement base string parsing flow
- Implement user authentication flow
- Implement history buffer support
- Implement autocomplete actions triggered by the Tab key
- Add basic and Blue Pill examples
- Add support for ESC sequences and other ASCII control commands
v2.0
- Review approaches for using the shell module with multiple instances, if needed
- Optimize history handling — fix bugs, improve user experience, replace CRC32 with Jenkins hash, etc.
- Implement advanced autocomplete with flag suggestions
- Simplify configuration file structure
- Add a built-in default command for querying the shell interface
- Optimize options file structure
v2.1
- Support input range only from
spacetill~ - Change command table attachment from storing commands to storing pointers to commands
- Add an extra space (' ') on double-Tab during command autocompletion
- Implement input blocking while waiting for specific keys (Enter, Yes/No, etc.)
- Save previous symbol and handle different terminals setup (
\r,\nor\r\n) - Add string print with deAuth reason on deAuth event
- Automatically generate documentation on GitHub Pages
v2.2
- Add support for storing passwords in encrypted (hashed) form in memory
v2.3
- Review default command behavior and provide more detailed output about it
- Fix fault on history read and write callbacks if history isn't inited
- Review groups, permissions, and access levels for commands, users, and options; document them
- Check the same names for commands and options (if short and long options repited in one command or commands are same)
v2.4 (Security, Robustness & Developer Experience)
Security Improvements
- Implement constant-time comparison for login/password validation to prevent timing attacks
- Add secure memory zeroing for sensitive data (password hash buffer) using volatile loop
- Add comprehensive input validation for login and password lengths
- Improve credential checking with length validation before comparison
Robustness & Bug Fixes
- Fix potential fault in history read/write callbacks when history is not initialized
- Fix escape sequence bug in input handling
- Add duplicate detection for short and long option flags within commands (triggers ASSERT)
- Fix command line flush bug
- Fix argument processing flow
- Multiple small fixes and code quality improvements
Features & Enhancements
- Add history save support for interactive commands
- Add default command description to help output
- Add more detailed build information to shell startup banner (compiler, OS, build date/time)
- Add FreeRTOS version detection support
- Add
WSH_SHELL_PRINT_LEVELmacro for better print control - Add debug build flag support
- Review and document groups, permissions, and access levels system
Documentation & Tooling
- Update documentation for permission rules and access control
- Add ELF size analysis utility script
- Fix grammar and typos in documentation
- Update README with clearer examples
- Fix VSCode task configurations
- Improve Makefile structure
v2.5 (Security & Stability Fixes)
- Fix typo in
WshShellCmd_FindOptparameter validation (pcCmd || pcCmd→pcCmd || pcStr) - Add VLA stack overflow protection in autocomplete (check against
WSH_SHELL_AUTOCOMPLETE_MAX_CANDIDATES) - Add bounds checking before buffer copy in autocomplete to prevent buffer overflow
- Add secure erase of sensitive data (
saltPass) in default hash function using volatile loop - Add
volatilequalifier to constant-time comparison variables to prevent compiler optimization - Add validation for unclosed quotes in command parsing (
WshShellStr_ParseToArgcArgv)
v2.6 (Build System, UX & Developer Tooling)
- Restructure build system: remove static library target, add
gen-configtarget, move config generation toexample/directory - Add compiler selection support (
CC ?= gcc/clang) with passthrough from top-level Makefile - Add
--ping/-pflag to defaultwshcommand for adapter health check - Improve print macros format: add colored
[TAG]prefix toINFO/WARN/ERRmessages for easier log parsing - Fix unknown token handling: print
[WARN]for unrecognized options instead of silently falling back to default behavior - Fix spurious
ERR_EMPTYresponse when valid options are followed by unknown tokens in the same command call - Add entry/exit info messages for interactive mode
- Fix IntelliSense configuration (
c_cpp_properties.json) - Update and improve documentation
- Extend autocomplete to support flag suggestions (not just command names)
v3.0 (Python Adapter, Tests & CI)
- Add Python
wsh_shell_adapterpackage with serial/UART and local PTY transports - Implement shell sync/auth flow with command execution, retry logic, sync probe verification, and structured output parsing
- Add TOML-based adapter configuration
- Add serial port auto-discovery by fixed
portorvid/pid, including interactive port selection helpers - Add adapter unit tests for sync/login flow, JSON parsing, fragmented writes, timeout retry, empty command validation, and config loading
- Add integration tests for running against
example/build/examplevia PTY and for non-zero exit on failedWSH_SHELL_ASSERT - Add adapter and test documentation
- Automate adapter test runs in GitLab CI
v3.1 (Command Model & UX Extensions)
Subcommand Trees
- Add
WSH_SHELL_SUBCOMMANDS/WSH_SHELL_SUBCOMMANDS_MAX_DEPTHconfig flags (default-on, overridable) - Extend
WshShellCmd_twithSubCmds/SubCmdNum(compiled out when feature disabled) - Add
WshShellCmd_GetSubCmdNum,WshShellCmd_GetSubCmdByIndex,WshShellCmd_SearchSubCmdhelpers - Descend subcommand tree in
WshShell_StringHandlerwith argv shifting, depth guard, and per-level access check - Recursively validate subcommand tables on
WshShellCmd_Attach(duplicate names, NULL entries, nested options) - Extend
WshShellCmd_PrintOptionsOverviewto list subcommands; suppress empty "Options overview" section - Extend autocomplete to walk the subcommand tree and complete partial subcommand names
- Add meaningful demo:
wsh user list/wsh user whoamidriven by the existing user table, with flags at every hierarchy level - Keep flat
-u / --userwhenWSH_SHELL_SUBCOMMANDS=0via slot macro; remove it when subcommands are on - Add
ParseErrorfield toWshShellOption_Ctx_t; set it inWshShellCmd_ParseOpton unknown token so handlers can distinguish end-of-options from bad flag without restructuring the loop - Update all handlers (including
WshShellCmdDef) to checkParseErrorand returnERR_PARAMon unknown flags - Document subcommand feature (
usage/subcommands.md, index.md feature list) - Add
usage/writing-commands.md— standard handler template with X-macro tables, parse loop, andParseErrorexplanation
Numeric Literal Base Auto-Detect
- Change
WSH_SHELL_STRTOLbase from10to0inWshShellCmd_GetOptValue—0xprefix → hex,0prefix → octal, else decimal; no API change - Add missing-argument guard in
WshShellCmd_ParseOpt— if flag requires N args but fewer tokens follow, print[WARN]and setParseErrorinstead of crashing inGetOptValue - Replace
ASSERT(false)inWshShellCmd_GetOptValuebounds check with gracefulERR_EMPTY
v3.2
Enum Option Type
- Add
WshShellOptionEnum_tstruct (Values+Count) andEnumfield toWshShellOption_t; always compiled in (no config gate) - Add
WSH_SHELL_OPT_ENUMmacro; all other option macros appendWSH_SHELL_OPT_ENUM_TAIL (,NULL)to suppress-Wmissing-field-initializers - Validate enum value in
WshShellCmd_GetOptValue— unknown value prints[WARN]and returnsERR_PARAM - Extend autocomplete: complete partial enum value after a known ENUM flag; list all values when flag is fully typed followed by a space
- Add
WSH_SHELL_ENUM_VALUE_MAX_LENconfig knob (default16) - Demo:
wsh user list --format [table|short] - Document enum options in
usage/writing-commands.md
Default Command Tree Restructure
- Replace ad-hoc
wshoptions with a clean subcommand tree:wsh user,wsh user list,wsh user whoami,wsh history,wsh history list,wsh history clear - Remove contrived interactive demo from
wshroot; addwsh tokenizeas interactive demo (gatedWSH_SHELL_INTERACTIVE_MODE) - Keep flat
-u / --user,-g / --histprint,-r / --histrstfallback flags whenWSH_SHELL_SUBCOMMANDS=0via slot macros
Ctrl+C Cancel
- Add
WSH_SHELL_SYM_CANCEL (0x03)constant towsh_shell_io.h; always active, no config gate - Handle in
WshShell_SymbolHandler: print^C, exit interactive mode if active (via sharedWshShell_ExitInteractivehelper), clear input buffer, reprint prompt — never deauths -
WshShellPromptWait_Handle: flush active wait and returnERR_EMPTYon Ctrl+C so the cancel handler runs normally - Document Ctrl+C / Ctrl+D behaviour in
usage/writing-commands.md
Hex Dump Utility
- Add
WshShellMisc_HexDump(pBuff, len, offset)towsh_shell_misc—hexdump -Cstyle output, 16 bytes per row - Row width configurable via
WSH_HEXDUMP_COLSinwsh_shell_cfg_def.h(default16) - Demo in
example/shell.c:dumpcommand dumps live PS1 buffer bytes - Document in
usage/writing-commands.mdunder "Shell Utilities"
v3.3 (Fixes & Adapter Extensions)
Python Adapter — IoT Raw Backend
- Add
RawAdapterfor non-shell binary protocols alongside the existing shell adapter (wsh_shell_adapter/raw_adapter.py) - Extend
transport.pyto support raw byte streams in addition to line-based shell I/O - Document raw-adapter usage in
wsh_shell_adapter/README.mdanddocs/usage/python-adapter.md
Integration Test Infrastructure
- Add pytest-based integration test suite under
tests/integration/(smoke, history, features) drivingexample/build/examplevia PTY - Split existing adapter tests into
tests/unit/with sharedconftest.pyfixtures - Add VS Code task entry for running the suite locally
Short Option Length Fix
-
WshShellCmd_FindOpt: match short flags bystrLen <= WSH_SHELL_OPTION_SHORT_NAME_LENinstead of strict equality, so short flags shorter than the configured maximum are recognised whenWSH_SHELL_OPTION_SHORT_NAME_LEN > 2 - Add NULL guard for options without
ShortNameon the short-flag path
IAR Build Compatibility
- Replace Cyrillic
с(U+0441) with Latincin identifiers (Pe159) - Remove VLA in
wsh_shell_autocomplete.c— switchcandidates[cmdNum + 1][...]to the existingWSH_SHELL_AUTOCOMPLETE_MAX_CANDIDATEScap (Pe028)
Misc
- Add
WshShellMisc_AsciiPrinthelper for printable-only output - Autocomplete cleanup and subcommand-related corner-case fixes
- Fix
PtyProcessTransporterror path on Windows in the Python adapter - Trim flash-footprint tables in
README.md/docs/index.mdto only feature-toggle macros (drop numeric-size knobs that don't fit the on/off cost model)
v3.4 (Persistent Session & Prompt-Wait Polish)
Persistent Login Session
- Add
wsh_shell_session.{c,h}— hashedWshShellSession_tdescriptor (reboot budget + user index) with integrator-supplied read/write handlers, mirroring the history I/O pattern - Add
WSH_SHELL_SESSIONconfig flag (default-on); every public function keeps its signature as a stub when disabled -
WshShellSession_Initdiscards an invalid store so uninitialised no-init RAM can never be restored - Add
WshShell_SessionArm/WshShell_SessionRestore/WshShell_SessionIsKeepActive/WshShell_SessionRebootsLeftto the shell API; restore spends one reboot from the budget - Clear the session in
WshShell_DeAuth— a logout must not be silently undone by the next reboot - Add flat
-k / --keep Noption to the default command via slot macro;wshstatus prints the remaining budget - Wire the feature into the PC example:
--session <file>stands in for no-init RAM, so restarting the process models a reboot - Add integration tests covering arming, restore across reboots, budget exhaustion,
--keep 0, logout, and a corrupted store - Document in
usage/session.md,usage/bare-metal.md, index/README feature lists
Prompt-Wait Hint Budget
- Add
WSH_SHELL_PROMPT_WAIT_HINT_RETRIES(default3) andRejectedNumcounter reset on everyWshShellPromptWait_Attach - Add
WshShellPromptWait_HintIsNeeded()for handlers to check before printing their hint; the bell still answers every refused keystroke - Run the handler before the Ctrl+C escape in
WshShellPromptWait_Handleso a wait can undo what it guarded; Ctrl+C still always escapes, whatever the handler returns - Add integration tests for the hint budget, the per-wait reset, and the silent Ctrl+C escape
Fixes
- Print
[WARN]instead of[ERR ]when a command handler returnsWSH_SHELL_RET_STATE_WARNING - Fix autocomplete-disabled notice: emit it on its own line instead of padding it onto the current input
- Python adapter: stop anchoring prompt detection to the end of the buffer and scan for the last prompt match, so async log lines sharing the UART no longer break sync and never leak into command output
- Add
utils/measure-footprint.py+make footprint; refresh the footprint tables inREADME.md/docs/index.mdwith reproducible numbers