@khanglvm/outline-cli 0.1.1 → 0.1.2
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/CHANGELOG.md +10 -0
- package/README.md +24 -56
- package/package.json +1 -1
- package/src/agent-skills.js +104 -0
- package/src/cli.js +24 -1
- package/src/entry-integrity-manifest.generated.js +4 -4
- package/test/agent-skills.unit.test.js +30 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2 - 2026-03-06
|
|
4
|
+
|
|
5
|
+
- Changes since `v0.1.1`.
|
|
6
|
+
- docs(readme): remove redundant quick-start copy prompt (28ab2cd)
|
|
7
|
+
- feat(help): add quick-start-agent onboarding section (1d21814)
|
|
8
|
+
- docs(readme): rewrite quick start as AI agent instructions (2b3065b)
|
|
9
|
+
- docs(readme): remove duplicated intro wording (88eddcf)
|
|
10
|
+
- docs: remove tracked docs directory and refine README intro (7235f95)
|
|
11
|
+
- docs(readme): prioritize global install usage (052c31b)
|
|
12
|
+
|
|
3
13
|
## 0.1.1 - 2026-03-05
|
|
4
14
|
|
|
5
15
|
- Initial tagged release notes.
|
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# outline-cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
It prioritizes deterministic, machine-friendly output:
|
|
3
|
+
An AI Agent-Optimized CLI for Outline ([`https://getoutline.com`](getoutline.com)).
|
|
6
4
|
|
|
7
5
|
- Stable JSON envelopes
|
|
8
6
|
- Token-efficient `ids` and `summary` views
|
|
@@ -12,46 +10,16 @@ It prioritizes deterministic, machine-friendly output:
|
|
|
12
10
|
|
|
13
11
|
## Quick Start
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- Node.js `>=18.17`
|
|
18
|
-
- An Outline workspace URL
|
|
19
|
-
- An Outline API key (recommended auth mode)
|
|
20
|
-
|
|
21
|
-
Run from npm without installing:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npx @khanglvm/outline-cli --help
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Or install locally in this repo:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm install
|
|
31
|
-
node ./bin/outline-cli.js --help
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Set up a profile (API key mode):
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npx @khanglvm/outline-cli profile add prod \
|
|
38
|
-
--base-url https://app.getoutline.com \
|
|
39
|
-
--api-key "$OUTLINE_API_KEY" \
|
|
40
|
-
--set-default
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Verify auth:
|
|
13
|
+
Install globally:
|
|
44
14
|
|
|
45
15
|
```bash
|
|
46
|
-
|
|
16
|
+
npm i -g @khanglvm/outline-cli
|
|
47
17
|
```
|
|
48
18
|
|
|
49
|
-
|
|
19
|
+
Then run built-in AI onboarding guidance:
|
|
50
20
|
|
|
51
21
|
```bash
|
|
52
|
-
|
|
53
|
-
--args '{"query":"oncall runbook","mode":"semantic","limit":5,"view":"summary"}' \
|
|
54
|
-
--pretty
|
|
22
|
+
outline-cli tools help quick-start-agent --view full
|
|
55
23
|
```
|
|
56
24
|
|
|
57
25
|
## Day-to-Day Usage
|
|
@@ -59,36 +27,36 @@ npx @khanglvm/outline-cli invoke documents.search \
|
|
|
59
27
|
Discover tools and contracts:
|
|
60
28
|
|
|
61
29
|
```bash
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
30
|
+
outline-cli tools list
|
|
31
|
+
outline-cli tools contract documents.search --pretty
|
|
32
|
+
outline-cli tools contract all --result-mode inline
|
|
65
33
|
```
|
|
66
34
|
|
|
67
35
|
Read document metadata by id:
|
|
68
36
|
|
|
69
37
|
```bash
|
|
70
|
-
|
|
38
|
+
outline-cli invoke documents.info \
|
|
71
39
|
--args '{"id":"<document-id>","view":"summary"}'
|
|
72
40
|
```
|
|
73
41
|
|
|
74
42
|
Create a document:
|
|
75
43
|
|
|
76
44
|
```bash
|
|
77
|
-
|
|
45
|
+
outline-cli invoke documents.create \
|
|
78
46
|
--args '{"title":"Release Notes","text":"# Release Notes","publish":false,"view":"summary"}'
|
|
79
47
|
```
|
|
80
48
|
|
|
81
49
|
Update a document (mutation requires `performAction: true`):
|
|
82
50
|
|
|
83
51
|
```bash
|
|
84
|
-
|
|
52
|
+
outline-cli invoke documents.update \
|
|
85
53
|
--args '{"id":"<document-id>","text":"\n\nUpdated by automation.","editMode":"append","performAction":true,"view":"summary"}'
|
|
86
54
|
```
|
|
87
55
|
|
|
88
56
|
Batch multiple calls:
|
|
89
57
|
|
|
90
58
|
```bash
|
|
91
|
-
|
|
59
|
+
outline-cli batch --ops '[
|
|
92
60
|
{"tool":"collections.list","args":{"limit":5,"view":"summary"}},
|
|
93
61
|
{"tool":"documents.search","args":{"query":"incident","limit":5,"view":"ids"}}
|
|
94
62
|
]'
|
|
@@ -101,14 +69,14 @@ Delete is guarded by read-token confirmation.
|
|
|
101
69
|
1. Arm-delete read:
|
|
102
70
|
|
|
103
71
|
```bash
|
|
104
|
-
|
|
72
|
+
outline-cli invoke documents.info \
|
|
105
73
|
--args '{"id":"<document-id>","armDelete":true,"view":"summary"}'
|
|
106
74
|
```
|
|
107
75
|
|
|
108
76
|
2. Copy the returned `deleteReadReceipt.token`, then delete:
|
|
109
77
|
|
|
110
78
|
```bash
|
|
111
|
-
|
|
79
|
+
outline-cli invoke documents.delete \
|
|
112
80
|
--args '{"id":"<document-id>","readToken":"<token>","performAction":true}'
|
|
113
81
|
```
|
|
114
82
|
|
|
@@ -128,9 +96,9 @@ Result mode:
|
|
|
128
96
|
Temp-file management:
|
|
129
97
|
|
|
130
98
|
```bash
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
99
|
+
outline-cli tmp list
|
|
100
|
+
outline-cli tmp cat /absolute/path/from/result.json
|
|
101
|
+
outline-cli tmp gc --older-than-hours 24
|
|
134
102
|
```
|
|
135
103
|
|
|
136
104
|
## Profile Management
|
|
@@ -138,7 +106,7 @@ npx @khanglvm/outline-cli tmp gc --older-than-hours 24
|
|
|
138
106
|
Add password-mode profile:
|
|
139
107
|
|
|
140
108
|
```bash
|
|
141
|
-
|
|
109
|
+
outline-cli profile add internal \
|
|
142
110
|
--base-url https://outline.company.com \
|
|
143
111
|
--auth-type password \
|
|
144
112
|
--username agent@company.com \
|
|
@@ -148,17 +116,17 @@ npx @khanglvm/outline-cli profile add internal \
|
|
|
148
116
|
Select default profile:
|
|
149
117
|
|
|
150
118
|
```bash
|
|
151
|
-
|
|
119
|
+
outline-cli profile use prod
|
|
152
120
|
```
|
|
153
121
|
|
|
154
122
|
Improve AI profile routing metadata:
|
|
155
123
|
|
|
156
124
|
```bash
|
|
157
|
-
|
|
125
|
+
outline-cli profile annotate prod \
|
|
158
126
|
--description "Production knowledge base" \
|
|
159
127
|
--append-keywords "prod,runbook,incident"
|
|
160
128
|
|
|
161
|
-
|
|
129
|
+
outline-cli profile enrich prod \
|
|
162
130
|
--query "incident escalation process" \
|
|
163
131
|
--titles "Incident Playbook,Escalation Matrix"
|
|
164
132
|
```
|
|
@@ -177,8 +145,9 @@ Use this short operating pattern when an AI agent drives the CLI:
|
|
|
177
145
|
For structured AI playbooks and scenario guides:
|
|
178
146
|
|
|
179
147
|
```bash
|
|
180
|
-
|
|
181
|
-
|
|
148
|
+
outline-cli tools help quick-start-agent --view full
|
|
149
|
+
outline-cli tools help ai-skills --view summary
|
|
150
|
+
outline-cli tools help ai-skills --scenario UC-12
|
|
182
151
|
```
|
|
183
152
|
|
|
184
153
|
## Testing (Live Environment)
|
|
@@ -239,6 +208,5 @@ Release prerequisites:
|
|
|
239
208
|
|
|
240
209
|
## Reference Docs
|
|
241
210
|
|
|
242
|
-
- Tool contracts: [`docs/TOOL_CONTRACTS.md`](docs/TOOL_CONTRACTS.md)
|
|
243
211
|
- Agent rules for this repo: [`AGENTS.md`](AGENTS.md)
|
|
244
212
|
- Release script: [`scripts/release.mjs`](scripts/release.mjs)
|
package/package.json
CHANGED
package/src/agent-skills.js
CHANGED
|
@@ -2,6 +2,67 @@ import { CliError } from "./errors.js";
|
|
|
2
2
|
|
|
3
3
|
const AI_SKILL_DATA_VERSION = "2026-03-05.1";
|
|
4
4
|
const AI_HELP_SECTION_ID = "ai-skills";
|
|
5
|
+
const QUICK_START_HELP_SECTION_ID = "quick-start-agent";
|
|
6
|
+
const QUICK_START_HELP_VERSION = "2026-03-05.1";
|
|
7
|
+
|
|
8
|
+
const QUICK_START_AGENT_PLAYBOOK = {
|
|
9
|
+
title: "outline-cli onboarding for non-expert users",
|
|
10
|
+
audience: "AI agents assisting non-expert users in terminal setup and first usage.",
|
|
11
|
+
objective:
|
|
12
|
+
"Install outline-cli globally, discover required setup commands, guide profile creation with follow-up questions, then demonstrate example use cases in natural language.",
|
|
13
|
+
steps: [
|
|
14
|
+
{
|
|
15
|
+
step: 1,
|
|
16
|
+
title: "Install outline-cli globally",
|
|
17
|
+
command: "npm i -g @khanglvm/outline-cli",
|
|
18
|
+
successCheck: "outline-cli --help",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
step: 2,
|
|
22
|
+
title: "Inspect command surfaces before asking the user for inputs",
|
|
23
|
+
commands: [
|
|
24
|
+
"outline-cli --help",
|
|
25
|
+
"outline-cli profile --help",
|
|
26
|
+
"outline-cli tools --help",
|
|
27
|
+
"outline-cli invoke --help",
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
step: 3,
|
|
32
|
+
title: "Ask follow-up questions for missing setup values",
|
|
33
|
+
questions: [
|
|
34
|
+
"What is your Outline base URL?",
|
|
35
|
+
"What is your Outline API key?",
|
|
36
|
+
"What profile id do you want? (default to prod if user has no preference)",
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
step: 4,
|
|
41
|
+
title: "Guide profile setup and set it as default",
|
|
42
|
+
command:
|
|
43
|
+
'outline-cli profile add <profile-id> --base-url <base-url> --api-key "<api-key>" --set-default',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
step: 5,
|
|
47
|
+
title: "Verify profile authentication",
|
|
48
|
+
command: "outline-cli profile test <profile-id> --pretty",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
step: 6,
|
|
52
|
+
title: "Show example use cases in plain language and run one command per example",
|
|
53
|
+
commandTemplates: [
|
|
54
|
+
'outline-cli invoke documents.search --args \'{"query":"onboarding checklist","mode":"semantic","limit":5,"view":"summary"}\' --pretty',
|
|
55
|
+
'outline-cli invoke documents.info --args \'{"id":"<document-id>","view":"summary"}\' --pretty',
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
interactionRules: [
|
|
60
|
+
"Use short and clear explanations for beginners.",
|
|
61
|
+
"Ask one question at a time when required information is missing.",
|
|
62
|
+
"If a command fails, explain the cause and provide the exact next command.",
|
|
63
|
+
"Confirm each step completion before moving to the next step.",
|
|
64
|
+
],
|
|
65
|
+
};
|
|
5
66
|
|
|
6
67
|
const AI_GLOBAL_GUIDANCE = {
|
|
7
68
|
principles: [
|
|
@@ -630,6 +691,32 @@ function normalizeView(view = "summary") {
|
|
|
630
691
|
return normalized;
|
|
631
692
|
}
|
|
632
693
|
|
|
694
|
+
function normalizeQuickStartView(view = "summary") {
|
|
695
|
+
const normalized = String(view || "summary").toLowerCase();
|
|
696
|
+
if (normalized !== "summary" && normalized !== "full") {
|
|
697
|
+
throw new CliError("Invalid view for quick-start-agent help. Expected summary or full.", {
|
|
698
|
+
code: "QUICK_START_HELP_INVALID_VIEW",
|
|
699
|
+
view,
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
return normalized;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
function summarizeQuickStartPlaybook() {
|
|
706
|
+
return {
|
|
707
|
+
title: QUICK_START_AGENT_PLAYBOOK.title,
|
|
708
|
+
audience: QUICK_START_AGENT_PLAYBOOK.audience,
|
|
709
|
+
objective: QUICK_START_AGENT_PLAYBOOK.objective,
|
|
710
|
+
steps: QUICK_START_AGENT_PLAYBOOK.steps.map((row) => ({
|
|
711
|
+
step: row.step,
|
|
712
|
+
title: row.title,
|
|
713
|
+
command: row.command || null,
|
|
714
|
+
})),
|
|
715
|
+
interactionRules: QUICK_START_AGENT_PLAYBOOK.interactionRules,
|
|
716
|
+
nextCommand: "outline-cli tools help quick-start-agent --view full",
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
|
|
633
720
|
function normalizeScenario(input) {
|
|
634
721
|
if (!input) {
|
|
635
722
|
return null;
|
|
@@ -747,8 +834,25 @@ export function getAgentSkillHelp(options = {}) {
|
|
|
747
834
|
};
|
|
748
835
|
}
|
|
749
836
|
|
|
837
|
+
export function getQuickStartAgentHelp(options = {}) {
|
|
838
|
+
const view = normalizeQuickStartView(options.view || "summary");
|
|
839
|
+
return {
|
|
840
|
+
section: QUICK_START_HELP_SECTION_ID,
|
|
841
|
+
version: QUICK_START_HELP_VERSION,
|
|
842
|
+
view,
|
|
843
|
+
...(view === "full" ? QUICK_START_AGENT_PLAYBOOK : summarizeQuickStartPlaybook()),
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
|
|
750
847
|
export function listHelpSections() {
|
|
751
848
|
return [
|
|
849
|
+
{
|
|
850
|
+
id: QUICK_START_HELP_SECTION_ID,
|
|
851
|
+
title: "AI setup onboarding",
|
|
852
|
+
description:
|
|
853
|
+
"Copy-ready AI onboarding instructions to install outline-cli, guide profile setup, and demonstrate first use cases.",
|
|
854
|
+
commandExample: "outline-cli tools help quick-start-agent --view full",
|
|
855
|
+
},
|
|
752
856
|
{
|
|
753
857
|
id: AI_HELP_SECTION_ID,
|
|
754
858
|
title: "AI instruction skills",
|
package/src/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { getAgentSkillHelp, listHelpSections } from "./agent-skills.js";
|
|
3
|
+
import { getAgentSkillHelp, getQuickStartAgentHelp, listHelpSections } from "./agent-skills.js";
|
|
4
4
|
import {
|
|
5
5
|
buildProfile,
|
|
6
6
|
defaultConfigPath,
|
|
@@ -786,6 +786,29 @@ export async function run(argv = process.argv) {
|
|
|
786
786
|
return;
|
|
787
787
|
}
|
|
788
788
|
|
|
789
|
+
if (
|
|
790
|
+
sectionName === "quick-start-agent" ||
|
|
791
|
+
sectionName === "quickstart-agent" ||
|
|
792
|
+
sectionName === "quickstart" ||
|
|
793
|
+
sectionName === "setup"
|
|
794
|
+
) {
|
|
795
|
+
await emitOutput(
|
|
796
|
+
store,
|
|
797
|
+
{
|
|
798
|
+
ok: true,
|
|
799
|
+
...getQuickStartAgentHelp({
|
|
800
|
+
view: merged.view,
|
|
801
|
+
}),
|
|
802
|
+
},
|
|
803
|
+
merged,
|
|
804
|
+
{
|
|
805
|
+
label: "tools-help-quick-start-agent",
|
|
806
|
+
mode: merged.resultMode,
|
|
807
|
+
}
|
|
808
|
+
);
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
|
|
789
812
|
throw new CliError(
|
|
790
813
|
`Unknown tools help section: ${section}. Supported: ${listHelpSections().map((row) => row.id).join(", ")}`
|
|
791
814
|
);
|
|
@@ -3,8 +3,8 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
|
|
|
3
3
|
version: 1,
|
|
4
4
|
algorithm: "sha256",
|
|
5
5
|
signatureAlgorithm: "sha256-salted-manifest-v1",
|
|
6
|
-
signature: "
|
|
7
|
-
generatedAt: "2026-03-
|
|
6
|
+
signature: "db2b8cd3d150b5be3b17246af7a254fc42ec500c3567a8be79ca2e4178f4657a",
|
|
7
|
+
generatedAt: "2026-03-06T00:27:55.266Z",
|
|
8
8
|
files: [
|
|
9
9
|
{
|
|
10
10
|
"path": "src/action-gate.js",
|
|
@@ -12,11 +12,11 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
|
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"path": "src/agent-skills.js",
|
|
15
|
-
"sha256": "
|
|
15
|
+
"sha256": "3ec649a1e4fb475de47882223d2ca0e5bb049720cad1b456ea3ecd6ff1b74ecc"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"path": "src/cli.js",
|
|
19
|
-
"sha256": "
|
|
19
|
+
"sha256": "bf37837390eaedadc6f8a8a8e279e61c12d56792f83cb4c53173439009cf5422"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"path": "src/config-store.js",
|
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
3
|
|
|
4
|
-
import { getAgentSkillHelp, listHelpSections } from "../src/agent-skills.js";
|
|
4
|
+
import { getAgentSkillHelp, getQuickStartAgentHelp, listHelpSections } from "../src/agent-skills.js";
|
|
5
5
|
import { CliError } from "../src/errors.js";
|
|
6
6
|
|
|
7
7
|
test("listHelpSections exposes ai-skills section", () => {
|
|
8
8
|
const sections = listHelpSections();
|
|
9
9
|
assert.ok(Array.isArray(sections));
|
|
10
|
+
assert.ok(sections.some((section) => section.id === "quick-start-agent"));
|
|
10
11
|
assert.ok(sections.some((section) => section.id === "ai-skills"));
|
|
11
12
|
});
|
|
12
13
|
|
|
14
|
+
test("getQuickStartAgentHelp returns summary by default", () => {
|
|
15
|
+
const payload = getQuickStartAgentHelp();
|
|
16
|
+
|
|
17
|
+
assert.equal(payload.section, "quick-start-agent");
|
|
18
|
+
assert.equal(payload.view, "summary");
|
|
19
|
+
assert.ok(Array.isArray(payload.steps));
|
|
20
|
+
assert.ok(payload.steps.length >= 4);
|
|
21
|
+
assert.equal(payload.nextCommand, "outline-cli tools help quick-start-agent --view full");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("getQuickStartAgentHelp returns full payload and validates view", () => {
|
|
25
|
+
const payload = getQuickStartAgentHelp({ view: "full" });
|
|
26
|
+
assert.equal(payload.section, "quick-start-agent");
|
|
27
|
+
assert.equal(payload.view, "full");
|
|
28
|
+
assert.ok(Array.isArray(payload.steps));
|
|
29
|
+
assert.ok(payload.steps.some((row) => row.command === "npm i -g @khanglvm/outline-cli"));
|
|
30
|
+
assert.ok(Array.isArray(payload.interactionRules));
|
|
31
|
+
|
|
32
|
+
assert.throws(
|
|
33
|
+
() => getQuickStartAgentHelp({ view: "compact" }),
|
|
34
|
+
(err) => {
|
|
35
|
+
assert.ok(err instanceof CliError);
|
|
36
|
+
assert.equal(err.details?.code, "QUICK_START_HELP_INVALID_VIEW");
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
|
|
13
42
|
test("getAgentSkillHelp returns summary guidance by default", () => {
|
|
14
43
|
const payload = getAgentSkillHelp();
|
|
15
44
|
|