md-runbook 0.0.0-stage → 0.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +58 -2
- package/cli.js +519 -0
- package/package.json +38 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 smojon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,59 @@
|
|
|
1
|
-
#
|
|
1
|
+
# md-runbook
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run the shell blocks of a **Markdown runbook** from the command line, in CI, on servers or on a
|
|
4
|
+
schedule, and keep their output in the same `.md` file. It is the command-line runner of the
|
|
5
|
+
[Markdown Runbook](https://marketplace.visualstudio.com/items?itemName=smojon.md-runbook) VS Code
|
|
6
|
+
extension: the same file format, cell options, checks and secret redaction.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npx md-runbook run deploy.md --param TARGET=staging --report report.html --junit junit.xml
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
````markdown
|
|
13
|
+
```bash retry=20 every=15s expect="successfully rolled out"
|
|
14
|
+
kubectl rollout status deploy/web --timeout=10s
|
|
15
|
+
```
|
|
16
|
+
<!-- md-runbook:output start exit=0 ran=2026-10-19T09:12:00+02:00 attempts=3 check=ok -->
|
|
17
|
+
```text
|
|
18
|
+
deployment "web" successfully rolled out
|
|
19
|
+
```
|
|
20
|
+
<!-- md-runbook:output end -->
|
|
21
|
+
````
|
|
22
|
+
|
|
23
|
+
- **bash, PowerShell (pwsh or Windows PowerShell) and cmd**, on Windows, macOS and Linux. Blocks
|
|
24
|
+
marked `os=windows` / `os=linux,macos` are alternatives: each system runs its own.
|
|
25
|
+
- **Checks and retries:** `expect="text"`, `expect=/regex/`, `expect-exit=N`,
|
|
26
|
+
`retry=10 every=15s`, and values passed between blocks with `capture=NAME` / `${out:NAME}`.
|
|
27
|
+
- **No prompts:** `${secret:NAME}` and `${input:NAME}` come from environment variables,
|
|
28
|
+
`${param:NAME}` from `--param` or the front matter. Secrets are redacted from everything
|
|
29
|
+
printed and written.
|
|
30
|
+
- **Safe by default:** risky commands (`rm -rf`, `delete`, `--force`, …) don't run without
|
|
31
|
+
`--yes` (a run that has any stops before its first step and lists them), and cells proposed or
|
|
32
|
+
written by an AI assistant never run.
|
|
33
|
+
- **Part of a runbook:** `--from 6` resumes at the step a run stopped at (numbered as the run
|
|
34
|
+
prints them), `--to 9` ends earlier, and `--section "3."` runs the steps under the headings
|
|
35
|
+
that start with that text.
|
|
36
|
+
- **Reports:** the filled-in runbook, `--report` (HTML), `--pdf` (with the Chrome or Edge already
|
|
37
|
+
installed), `--junit` (one test case per step), and a job summary on GitHub Actions.
|
|
38
|
+
- **Checks without running:** `md-runbook lint runbooks/*.md` reports invalid or unknown cell
|
|
39
|
+
options and placeholders with nothing behind them, with GitHub annotations on pull requests.
|
|
40
|
+
- **Notifications:** with `MD_RUNBOOK_NOTIFY_URL` set, a failed run posts a summary to Slack,
|
|
41
|
+
Microsoft Teams (Workflows), Discord or Google Chat.
|
|
42
|
+
- Exit code `0` when every step passed, `1` when one failed, `2` for wrong usage.
|
|
43
|
+
|
|
44
|
+
Requires Node.js 20 or newer; no other dependencies. `md-runbook --help` lists every option.
|
|
45
|
+
Full documentation:
|
|
46
|
+
[docs/features/cli.md](https://github.com/smojon/md-runbook/blob/main/docs/features/cli.md);
|
|
47
|
+
the file format (cell options, placeholders, output markers):
|
|
48
|
+
[docs/syntax.md](https://github.com/smojon/md-runbook/blob/main/docs/syntax.md).
|
|
49
|
+
|
|
50
|
+
On GitHub Actions you can also use the action, which builds the runner from its own source:
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
- uses: smojon/md-runbook@v0.19.3
|
|
54
|
+
with:
|
|
55
|
+
runbook: runbooks/smoke.md
|
|
56
|
+
report: report.html
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
License: MIT.
|