Documentation has always been a crucial part of onboarding onto a non-trivial system. For this reason, developers of packaged software started including README files as part of their distribution documentation dating back to the mid-1970s.
Today, the readme is still around but has morphed into a markdown-based
README.md file that lives in your repo’s version control. It has become part of modern development culture, and you will find them everywhere.
At Stateful, we want to lower development onboarding barriers and make prerequisites, setup, and workflows as approachable as possible. Source code hosting platforms such as GitHub have already elevated the README.md as a repo’s primary entry point in their UX, but they still diverge from code and documentation and we want to see more.
Primarily born out of the annoyance of never-ending README copy & paste, our teammate Adam Babik decided to utilize a Markdown Abstract Syntax Tree parser to generate a naive digest of README snippets and make them easily runnable. This is a prototype (take the happy path!), but we are pleased with the initial results. Illustrated here using Husky - a popular solution to manage git hooks:
💡 We skipped
$ rdme run npm-installfor brevity
Running through husky’s example with ease
The parsing is still far from perfect, but with best-effort pattern-matching of the AST into a data structure of command snippet pairs, we are often able to capture commands and their implied description. The outputted list tries to maintain the order initially defined in the README.md. Feel free to copy & paste the following step-by-step breakdown. You really shouldn’t have to, though, now that you have
$ rdme list
$ rdme run npm-pkg
$ rdme run npx-husky
$ rdme run git-commit
Using a simple
rdme run <name> you can run command blocks (check out the tab completion too) without much fuzz (as illustrated above making a sample commit to trigger the git-pre-commit hook). For a simple CLI tool, we have been pleasantly surprised at how natural the experience feels for interacting with tasks (if you like the terminal). You can find some additional examples inside of rdme’s repo.
Maybe in the future we will employ automation to execute the README’s commands continuously and detect outdated docs, but for now let's catch those issues by running them regularly with
If you are on MacOS and using homebrew, it’s as easy as installing
rdme from our tap:
$ brew install stateful/tap/rdme
You can use
scoop to install a version of
rdme on Windows. However, please note that currently only
shell environments (PowerShell is not supported yet) are supported.
$ scoop bucket add stateful https://github.com/stateful/scoop-bucket.git && scoop install stateful/rdme
For all other platforms, please check out the install section in rdme’s README.md.
rdme internally has led to a lengthy list of possible improvements, but we’ve intentionally decided to keep it simple and release
rdme's codebase as alpha.
Here’s a list of possible improvements:
- more robust parsing, configurability and/or ML/AI
- annotating markdown to achieve deterministic snippets
- introducing interactivity and “color” into CLI experience
- embedding run controls&output in README markdown viewer
- automated ENV resolution, injection of user runtime config
- C/I testability, as in “always know when you are breaking docs”
- deterministic order of commands, without building Makefile inside of READMEs
- what else?
Check out rdme’s GitHub issues to get a better sense of what projects are on the agenda.
rdme struck the same cord with you or, if you have strong feelings in one way or another, we would love to hear about it. Using the tool you will likely uncover edge cases. Please don't be shy to tell us about them on Discord or just drop a line in the comments below.