@ontology-kit/okb 0.1.0 → 0.3.0-alpha.133
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/README.md +1 -1
- package/dist/check.d.ts +43 -0
- package/dist/check.js +102 -0
- package/dist/checks.d.ts +1 -1
- package/dist/checks.js +27 -4
- package/dist/cli.js +11 -705
- package/dist/clidocs.d.ts +0 -2
- package/dist/clidocs.js +5 -27
- package/dist/clock.js +1 -1
- package/dist/command-table.d.ts +144 -0
- package/dist/command-table.js +85 -0
- package/dist/commands/documents.d.ts +3 -0
- package/dist/commands/documents.js +250 -0
- package/dist/commands/getting-started.d.ts +3 -0
- package/dist/commands/getting-started.js +135 -0
- package/dist/commands/housekeeping.d.ts +3 -0
- package/dist/commands/housekeeping.js +203 -0
- package/dist/commands/modeling.d.ts +3 -0
- package/dist/commands/modeling.js +467 -0
- package/dist/commands/planning.d.ts +3 -0
- package/dist/commands/planning.js +251 -0
- package/dist/commands/reviewing.d.ts +3 -0
- package/dist/commands/reviewing.js +234 -0
- package/dist/commands/skills.d.ts +3 -0
- package/dist/commands/skills.js +53 -0
- package/dist/commands.d.ts +10 -22
- package/dist/commands.js +15 -622
- package/dist/cqanswer.d.ts +51 -0
- package/dist/cqanswer.js +76 -0
- package/dist/diff.d.ts +85 -0
- package/dist/diff.js +323 -0
- package/dist/export-changes.d.ts +40 -0
- package/dist/export-changes.js +115 -0
- package/dist/export-csv.d.ts +17 -0
- package/dist/export-csv.js +188 -0
- package/dist/export-eval-cases.d.ts +38 -0
- package/dist/export-eval-cases.js +40 -0
- package/dist/export.d.ts +34 -3
- package/dist/export.js +70 -12
- package/dist/families.d.ts +1 -1
- package/dist/families.js +1 -1
- package/dist/help.d.ts +11 -2
- package/dist/help.js +51 -57
- package/dist/kbdocs.d.ts +18 -0
- package/dist/kbdocs.js +393 -0
- package/dist/metakb.d.ts +1 -1
- package/dist/metakb.js +1 -1
- package/dist/naming.d.ts +2 -2
- package/dist/naming.js +2 -2
- package/dist/ontology-ref.d.ts +20 -0
- package/dist/ontology-ref.js +108 -0
- package/dist/ops/admin.d.ts +2 -2
- package/dist/ops/admin.js +26 -8
- package/dist/ops/classes.d.ts +1 -1
- package/dist/ops/classes.js +15 -7
- package/dist/ops/common.d.ts +12 -2
- package/dist/ops/common.js +3 -0
- package/dist/ops/instances.d.ts +2 -1
- package/dist/ops/instances.js +9 -3
- package/dist/ops/links.d.ts +2 -2
- package/dist/ops/links.js +3 -2
- package/dist/ops/naming.d.ts +1 -1
- package/dist/ops/naming.js +3 -1
- package/dist/ops/scope.d.ts +14 -3
- package/dist/ops/scope.js +38 -4
- package/dist/ops/slots.d.ts +1 -1
- package/dist/ops/slots.js +21 -8
- package/dist/ops/values.d.ts +1 -1
- package/dist/ops/values.js +5 -1
- package/dist/provenance.d.ts +5 -3
- package/dist/provenance.js +61 -19
- package/dist/release.d.ts +52 -0
- package/dist/release.js +337 -0
- package/dist/render.d.ts +88 -1
- package/dist/render.js +265 -3
- package/dist/resync.d.ts +98 -0
- package/dist/resync.js +234 -0
- package/dist/review.d.ts +1 -1
- package/dist/review.js +1 -1
- package/dist/reviewdocs.d.ts +42 -0
- package/dist/reviewdocs.js +263 -0
- package/dist/runner.d.ts +3 -0
- package/dist/runner.js +84 -0
- package/dist/skills.d.ts +19 -3
- package/dist/skills.js +130 -14
- package/dist/status.d.ts +1 -1
- package/dist/status.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/verifynote.d.ts +19 -0
- package/dist/verifynote.js +93 -0
- package/dist/workflows.d.ts +283 -0
- package/dist/workflows.js +270 -0
- package/meta-kb/data/edges.json +25 -0
- package/meta-kb/data/manifest.json +5 -5
- package/meta-kb/data/nodes.json +46 -9
- package/package.json +9 -4
- package/schema/edge.schema.json +68 -0
- package/schema/edges.schema.json +9 -0
- package/schema/node.schema.json +914 -0
- package/schema/nodes.schema.json +9 -0
- package/schema/okb.schema.json +41 -0
- package/skills/build-domain-kb-from-docs/SKILL.md +21 -3
- package/skills/ontology-coach/SKILL.md +8 -4
- package/skills/ontology-maintainer/SKILL.md +152 -0
- package/skills/ontology-review/SKILL.md +4 -2
- package/skills/ontology-signoff/SKILL.md +182 -0
- package/templates/okb-check.yml +148 -0
- package/templates/pull_request_template.md +16 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/** Getting started: create an ontology, see where you are, learn a concept, check your work. */
|
|
2
|
+
import { opt } from "../command-table.js";
|
|
3
|
+
import { MetaKB } from "../metakb.js";
|
|
4
|
+
import { listExplainable, renderExplainHits, renderFindings, renderInit, renderSearchHits, renderStatus, renderStepGuide, renderStepMove } from "../render.js";
|
|
5
|
+
import { currentStep, explainData, initOntology, moveToStep, status, validate } from "../workflows.js";
|
|
6
|
+
const { str, strs, bool } = opt;
|
|
7
|
+
export const gettingStarted = [
|
|
8
|
+
{
|
|
9
|
+
name: "init",
|
|
10
|
+
group: "Getting started",
|
|
11
|
+
summary: "create a new ontology",
|
|
12
|
+
description: "Creates a new ontology folder with the starting files and shows the guide for step 1.",
|
|
13
|
+
forms: [
|
|
14
|
+
{
|
|
15
|
+
description: "Creates the folder, then tells you what to do first.",
|
|
16
|
+
examples: ["okb init wine --name \"Wine and Food\""],
|
|
17
|
+
args: [
|
|
18
|
+
["<folder>", "path", "Where to create the ontology."],
|
|
19
|
+
["--name", "text", "The ontology's name. Defaults to the folder name."],
|
|
20
|
+
],
|
|
21
|
+
options: { name: str },
|
|
22
|
+
usage: 'Usage: okb init <folder> --name "My Ontology"',
|
|
23
|
+
min: 1,
|
|
24
|
+
cheat: { example: "okb init wine --name \"Wine and Food\"", description: "Start a new ontology" },
|
|
25
|
+
run: (ctx) => {
|
|
26
|
+
const [folder] = ctx.args;
|
|
27
|
+
const name = ctx.opts.name ?? folder;
|
|
28
|
+
const { ont, guide } = initOntology(folder, name);
|
|
29
|
+
ctx.print(renderInit(name, ont.root, folder, guide));
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "status",
|
|
36
|
+
group: "Getting started",
|
|
37
|
+
summary: "where you are and what to do next",
|
|
38
|
+
description: "Shows which step you are on, what is done, and what to do next.",
|
|
39
|
+
forms: [
|
|
40
|
+
{
|
|
41
|
+
description: "Prints every step with its checklist, plus a count of validator findings.",
|
|
42
|
+
examples: ["okb status"],
|
|
43
|
+
args: [],
|
|
44
|
+
cheat: { example: "okb status", description: "See where you are and what to do next" },
|
|
45
|
+
run: async (ctx) => {
|
|
46
|
+
const ont = ctx.load();
|
|
47
|
+
const s = await status(ont);
|
|
48
|
+
ctx.emit(() => s.data, () => renderStatus(ont, s.findings, s.st));
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "step",
|
|
55
|
+
group: "Getting started",
|
|
56
|
+
summary: "move between steps and show the guide",
|
|
57
|
+
description: "Moves between the eight steps and shows the guide for a step.",
|
|
58
|
+
forms: [
|
|
59
|
+
{
|
|
60
|
+
description: "With no argument it shows the guide for your current step. With one, it moves you there.",
|
|
61
|
+
examples: ["okb step", "okb step next", "okb step 4"],
|
|
62
|
+
args: [
|
|
63
|
+
["[n|next|prev]", "number or word", "The step to move to: 1 to 8, `next`, or `prev`. Moving on with a step unfinished is allowed."],
|
|
64
|
+
],
|
|
65
|
+
cheat: { example: "okb step next", description: "Move on to the next step" },
|
|
66
|
+
run: (ctx) => {
|
|
67
|
+
const [which] = ctx.args;
|
|
68
|
+
if (which) {
|
|
69
|
+
const { target, leaving } = moveToStep(ctx.dir, which);
|
|
70
|
+
ctx.print(renderStepMove(target, leaving));
|
|
71
|
+
}
|
|
72
|
+
else
|
|
73
|
+
ctx.print(renderStepGuide(currentStep(ctx.dir)));
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "explain",
|
|
80
|
+
group: "Getting started",
|
|
81
|
+
summary: "learn a concept, rule, step or decision guide",
|
|
82
|
+
description: "Explains a concept, rule, step or decision guide in plain language.",
|
|
83
|
+
forms: [
|
|
84
|
+
{
|
|
85
|
+
description: "With no argument it lists everything you can ask about.",
|
|
86
|
+
examples: ["okb explain class", "okb explain 5", "okb explain --search inverse"],
|
|
87
|
+
args: [
|
|
88
|
+
["[topic]", "text", "A concept, rule key, step number or decision guide."],
|
|
89
|
+
["--search", "text", "Find entries that mention these words instead."],
|
|
90
|
+
],
|
|
91
|
+
options: { search: str },
|
|
92
|
+
cheat: { example: "okb explain class", description: "Learn what a term or rule means" },
|
|
93
|
+
run: (ctx) => {
|
|
94
|
+
const meta = MetaKB.get();
|
|
95
|
+
const { search } = ctx.opts;
|
|
96
|
+
if (search)
|
|
97
|
+
return ctx.print(renderSearchHits(meta.search(search.replace(/[-_]/g, " ")), search));
|
|
98
|
+
if (!ctx.args.length)
|
|
99
|
+
return ctx.print(listExplainable());
|
|
100
|
+
const q = ctx.args.join(" ");
|
|
101
|
+
const hits = meta.resolve(q);
|
|
102
|
+
ctx.emit(() => explainData(hits), () => renderExplainHits(hits, q));
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "validate",
|
|
109
|
+
group: "Getting started",
|
|
110
|
+
summary: "check your ontology against the rules",
|
|
111
|
+
description: "Checks your ontology against the rules. Errors make the command exit with code 1.",
|
|
112
|
+
forms: [
|
|
113
|
+
{
|
|
114
|
+
description: "By default it shows errors, plus warnings and hints for the steps you have reached.",
|
|
115
|
+
examples: ["okb validate", "okb validate --all --why"],
|
|
116
|
+
args: [
|
|
117
|
+
["--all", "flag", "Include warnings and hints from steps you haven't reached."],
|
|
118
|
+
["--why", "flag", "Show why each rule exists."],
|
|
119
|
+
["--rule", "rule key", "Run only this rule. Repeat it for more."],
|
|
120
|
+
["--strict", "flag", "Also exit with code 1 on warnings."],
|
|
121
|
+
["--json", "flag", "Print the findings as JSON."],
|
|
122
|
+
],
|
|
123
|
+
options: { all: bool, why: bool, rule: strs, strict: bool },
|
|
124
|
+
cheat: { example: "okb validate", description: "Check your ontology against the rules" },
|
|
125
|
+
run: async (ctx) => {
|
|
126
|
+
const o = ctx.opts;
|
|
127
|
+
const ont = ctx.load();
|
|
128
|
+
const v = await validate(ont, { all: o.all, rule: o.rule, strict: o.strict });
|
|
129
|
+
ctx.emit(() => v.data, () => renderFindings(v.findings, v.hiddenLater, ont, { all: o.all, verbose: o.why }));
|
|
130
|
+
ctx.exit(v.fail ? 1 : 0);
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
];
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/** Housekeeping: rename, remove, check, diff, release, and the help and version commands. */
|
|
2
|
+
import { opt } from "../command-table.js";
|
|
3
|
+
import * as ops from "../ops.js";
|
|
4
|
+
import { diffMarkdown } from "../diff.js";
|
|
5
|
+
import { renderHelp } from "../help.js";
|
|
6
|
+
import { formatCheck, formatNotes, renderDrift, renderPin, renderReleaseVerify } from "../render.js";
|
|
7
|
+
import { check, diff, drift, pin, release, releaseVerify, versionLine } from "../workflows.js";
|
|
8
|
+
const { str, bool } = opt;
|
|
9
|
+
export const housekeeping = [
|
|
10
|
+
{
|
|
11
|
+
name: "rename",
|
|
12
|
+
group: "Housekeeping",
|
|
13
|
+
summary: "rename something everywhere",
|
|
14
|
+
description: "Renames a class, slot or instance and updates everything that points to it.",
|
|
15
|
+
forms: [
|
|
16
|
+
{
|
|
17
|
+
description: "Renames one thing.",
|
|
18
|
+
examples: ["okb rename Vino Wine"],
|
|
19
|
+
args: [
|
|
20
|
+
["<old name>", "name", "The current name."],
|
|
21
|
+
["<new name>", "text", "The new name."],
|
|
22
|
+
["--force", "flag", "Rename it even if the name breaks your convention."],
|
|
23
|
+
],
|
|
24
|
+
options: { force: bool },
|
|
25
|
+
usage: "Usage: okb rename <old name> <new name>",
|
|
26
|
+
min: 2,
|
|
27
|
+
max: 2,
|
|
28
|
+
cheat: { example: "okb rename Vino Wine", description: "Rename something everywhere" },
|
|
29
|
+
run: (ctx) => ctx.mutate((ont) => ops.rename(ont, ctx.args[0], ctx.args[1], ctx.opts.force)),
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "remove",
|
|
35
|
+
group: "Housekeeping",
|
|
36
|
+
summary: "delete something",
|
|
37
|
+
description: "Deletes a class, slot, instance, term or other node, with the edges that touch it.",
|
|
38
|
+
forms: [
|
|
39
|
+
{
|
|
40
|
+
description: "Deletes one thing.",
|
|
41
|
+
examples: ["okb remove Vino", "okb remove genre --type Slot"],
|
|
42
|
+
args: [
|
|
43
|
+
["<name>", "name", "What to delete."],
|
|
44
|
+
["--type", "text", "Which kind, when a name is ambiguous: Class, Slot, Instance, Term and so on."],
|
|
45
|
+
],
|
|
46
|
+
options: { type: str },
|
|
47
|
+
usage: "Usage: okb remove <name> [--type Class|Slot|Instance|Term|...]",
|
|
48
|
+
min: 1,
|
|
49
|
+
cheat: { example: "okb remove Vino", description: "Delete something" },
|
|
50
|
+
run: (ctx) => ctx.mutate((ont) => ops.remove(ont, ctx.args[0], ctx.opts.type ? [ctx.opts.type] : undefined)),
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "drift",
|
|
56
|
+
group: "Housekeeping",
|
|
57
|
+
summary: "find near-duplicate quotes",
|
|
58
|
+
description: "Finds near-duplicate quotes across the ontologies in the folders you name, which usually means one source was quoted twice or two ontologies drifted apart. It compares quotes with each other, not with their source documents; for that, run `okb source refresh --all`.",
|
|
59
|
+
forms: [
|
|
60
|
+
{
|
|
61
|
+
description: "Checks one or more ontology folders. With none it checks the current folder.",
|
|
62
|
+
examples: ["okb drift .", "okb drift ../wine ../food"],
|
|
63
|
+
args: [
|
|
64
|
+
["[folder]...", "paths", "The ontology folders to check."],
|
|
65
|
+
],
|
|
66
|
+
run: (ctx) => {
|
|
67
|
+
const hits = drift(ctx.args);
|
|
68
|
+
ctx.emit(() => hits, () => renderDrift(hits));
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "check",
|
|
75
|
+
group: "Housekeeping",
|
|
76
|
+
summary: "is this KB safe to merge?",
|
|
77
|
+
description: "Says whether a knowledge base is safe to merge: no validation errors, every quote still in its source, and nothing unverified, unsupported or waiting for approval. Exits non-zero when a check fails, so a CI job can gate on it.",
|
|
78
|
+
forms: [
|
|
79
|
+
{
|
|
80
|
+
description: "Checks the current folder. It reads the folder and its source files and never changes them or takes the write lock. Warnings from `okb validate` don't block a merge. It also warns when the installed okb is older than the `okbVersion` the KB pins in okb.json.",
|
|
81
|
+
examples: ["okb check", "okb check --json", "okb check -C ../wine"],
|
|
82
|
+
args: [
|
|
83
|
+
["--json", "flag", "Print the result as JSON: `ok`, the installed and pinned versions, and each check with its status, summary and problems."],
|
|
84
|
+
],
|
|
85
|
+
usage: "Usage: okb check [--json] (checks the current folder; use -C <folder> for another)",
|
|
86
|
+
max: 0,
|
|
87
|
+
run: async (ctx) => {
|
|
88
|
+
const ont = ctx.load();
|
|
89
|
+
const report = await check(ont);
|
|
90
|
+
ctx.emit(() => report, () => formatCheck(report, ont.meta.name));
|
|
91
|
+
ctx.exit(report.ok ? 0 : 1);
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "pin",
|
|
98
|
+
group: "Housekeeping",
|
|
99
|
+
summary: "record this okb version in okb.json",
|
|
100
|
+
description: "Records the installed okb version in okb.json as `okbVersion`, so `okb check` warns anyone with an older okb and the CI workflow installs that version. Run it again after you upgrade okb.",
|
|
101
|
+
forms: [
|
|
102
|
+
{
|
|
103
|
+
description: "Pins the installed version.",
|
|
104
|
+
examples: ["okb pin"],
|
|
105
|
+
args: [],
|
|
106
|
+
usage: "Usage: okb pin (records the installed okb version in okb.json)",
|
|
107
|
+
max: 0,
|
|
108
|
+
run: (ctx) => ctx.print(renderPin(pin(ctx.dir))),
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "diff",
|
|
114
|
+
group: "Housekeeping",
|
|
115
|
+
summary: "what changed between two versions",
|
|
116
|
+
description: "Shows what changed in the knowledge between two versions of an ontology: added, removed, renamed and changed things, rules side by side, moved quotes and changed links, in words rather than JSON lines.",
|
|
117
|
+
forms: [
|
|
118
|
+
{
|
|
119
|
+
description: "Each side is an ontology folder or a git ref. With one argument, the other side is the current folder, so `okb diff main` shows what this branch changes. It never modifies the folder or checks anything out. The output is Markdown, ready for a PR comment; createdAt and updatedAt changes are not reported.",
|
|
120
|
+
examples: ["okb diff main", "okb diff v1.0 v1.1", "okb diff ../wine-old .", "okb diff main --json"],
|
|
121
|
+
args: [
|
|
122
|
+
["<old>", "folder or git ref", "The earlier version. An existing folder is read as it is; anything else is a branch, tag or commit in the repository around the current folder. A name that is both is an error that shows both spellings (`./name` for the folder, `refs/heads/name` for the branch)."],
|
|
123
|
+
["[new]", "folder or git ref", "The later version. Defaults to the current folder."],
|
|
124
|
+
["--json", "flag", "Print the changes as JSON for other tools."],
|
|
125
|
+
],
|
|
126
|
+
usage: "Usage: okb diff <old> [<new>] (each a folder or a git ref; with one, <new> is the current folder)",
|
|
127
|
+
min: 1,
|
|
128
|
+
max: 2,
|
|
129
|
+
run: (ctx) => {
|
|
130
|
+
const d = diff(ctx.dir, ctx.args[0], ctx.args[1]);
|
|
131
|
+
ctx.emitRaw(() => d, () => diffMarkdown(d));
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "release",
|
|
138
|
+
group: "Housekeeping",
|
|
139
|
+
summary: "cut a pinned release, or verify one",
|
|
140
|
+
description: "Cuts a numbered release of the knowledge base that other tools can pin: a manifest with the SHA-256 of every file and source, and a change log of what changed since the last release.",
|
|
141
|
+
forms: [
|
|
142
|
+
{
|
|
143
|
+
description: "Writes `manifest.json` (the pin), `RELEASES.md` (every release's change log, newest first) and `releases/<version>/` (the files as released, plus `CHANGES.md` and `changes.json`), and records the version in `okb.json`. The change log is `okb diff` against the previous release's snapshot, so it lists renames with old and new names and renamed edge types. It stops, and writes nothing, if `okb validate` reports an error, if the version isn't newer than the last release, if a registered source file is missing or if nothing changed. Commit the files it writes.",
|
|
144
|
+
examples: ["okb release 1.0.0", "okb release 1.1.0 --json"],
|
|
145
|
+
args: [
|
|
146
|
+
["<version>", "semver", "The new version: `1.0.0`, `1.2.3` or `2.0.0-rc.1`. It must be higher than the version in `manifest.json`."],
|
|
147
|
+
["--json", "flag", "Print the version and the manifest as JSON."],
|
|
148
|
+
],
|
|
149
|
+
usage: "Usage: okb release <version> · okb release verify (version is semver, like 1.0.0)",
|
|
150
|
+
min: 1,
|
|
151
|
+
max: 1,
|
|
152
|
+
run: async (ctx) => {
|
|
153
|
+
const r = await release(ctx.dir, ctx.args[0]);
|
|
154
|
+
ctx.emit(() => ({ version: r.version, previous: r.previous ?? null, manifest: r.manifest }), () => formatNotes(r.notes));
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
sub: "verify",
|
|
159
|
+
description: "Checks the files against `manifest.json`: every pinned file must exist and match its SHA-256, and `okb.json` must carry the manifest's version. It changes nothing. It exits 1 when something differs, so it can run in CI or before a server starts.",
|
|
160
|
+
examples: ["okb release verify", "okb release verify -C ../wine --json"],
|
|
161
|
+
args: [
|
|
162
|
+
["--json", "flag", "Print the result as JSON."],
|
|
163
|
+
],
|
|
164
|
+
usage: "Usage: okb release verify (checks the folder against its manifest.json; read-only)",
|
|
165
|
+
max: 0,
|
|
166
|
+
run: (ctx) => {
|
|
167
|
+
const r = releaseVerify(ctx.dir);
|
|
168
|
+
ctx.emit(() => r, () => renderReleaseVerify(r));
|
|
169
|
+
ctx.exit(r.ok ? 0 : 1);
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "help",
|
|
176
|
+
group: "Housekeeping",
|
|
177
|
+
summary: "print this summary",
|
|
178
|
+
description: "Prints a one-screen summary of the commands. `okb --help` and `okb -h` do the same.",
|
|
179
|
+
forms: [
|
|
180
|
+
{
|
|
181
|
+
description: "Prints the summary.",
|
|
182
|
+
examples: ["okb help"],
|
|
183
|
+
args: [],
|
|
184
|
+
run: (ctx) => ctx.print(renderHelp(ctx.commands)),
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "version",
|
|
190
|
+
group: "Housekeeping",
|
|
191
|
+
summary: "print the okb version",
|
|
192
|
+
description: "Prints the okb version and the version of the rules it carries. `okb --version` does the same.",
|
|
193
|
+
aliases: ["--version"],
|
|
194
|
+
forms: [
|
|
195
|
+
{
|
|
196
|
+
description: "Prints both versions.",
|
|
197
|
+
examples: ["okb version"],
|
|
198
|
+
args: [],
|
|
199
|
+
run: (ctx) => ctx.print(versionLine()),
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
];
|