@khanglvm/outline-cli 0.2.3 → 0.2.5

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.5 - 2026-10-18
4
+
5
+ - Changes since `v0.2.4`.
6
+ - Make default tests offline and retain live tests behind `npm run test:integration`.
7
+ - Add credential-free source PR checks and update contributor workflow guidance.
8
+
9
+ ## 0.2.4 - 2026-10-14
10
+
11
+ - Changes since `v0.2.3`.
12
+ - fix: accept document URLs in documents.info (42a3d36)
13
+ - fix(ci): handle staged npm publication overlap (9cda225)
14
+
3
15
  ## 0.2.3 - 2026-09-19
4
16
 
5
17
  - Changes since `v0.2.2`.
package/README.md CHANGED
@@ -43,13 +43,16 @@ outline-cli invoke documents.search \
43
43
  --args '{"query":"onboarding","limit":5,"view":"summary"}'
44
44
  ```
45
45
 
46
- Copy a document ID from the result to read its contents:
46
+ Read a document using its UUID, slug, or full document URL:
47
47
 
48
48
  ```sh
49
49
  outline-cli invoke documents.info \
50
- --args '{"id":"<document-id>","view":"full"}'
50
+ --args '{"id":"<document-id-or-url>","view":"full"}'
51
51
  ```
52
52
 
53
+ For a pasted `/doc/` URL, `url` is also accepted. Batch reads accept mixed UUIDs,
54
+ slugs, and document URLs in `ids`. URLs use the selected workspace profile.
55
+
53
56
  You can also create drafts, edit pages, manage comments, and inspect revision
54
57
  history. Writes require `performAction:true`. Deleting a document also requires
55
58
  a token from a prior read. See the [usage guide](https://github.com/khanglvm/outline-cli/blob/main/docs/USAGE.md) for examples.
@@ -73,6 +76,19 @@ is available with setup and workflow guidance:
73
76
  npx skills add https://github.com/khanglvm/skills --skill outline-cli -y
74
77
  ```
75
78
 
79
+ ## Development
80
+
81
+ Run the CLI smoke check and offline unit tests from a checkout:
82
+
83
+ ```sh
84
+ npm run check
85
+ npm test
86
+ ```
87
+
88
+ These checks need no Outline account. Live workspace tests require explicit
89
+ opt-in with `npm run test:integration`. See the [development guide](docs/DEVELOPMENT.md)
90
+ for account setup, test cleanup, source PR checks, and releases.
91
+
76
92
  ## More help
77
93
 
78
94
  - [Usage guide](https://github.com/khanglvm/outline-cli/blob/main/docs/USAGE.md): profiles, editing, attachments, batch calls, and safe deletion.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanglvm/outline-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Agent-optimized CLI for Outline API",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,8 @@
16
16
  "scripts": {
17
17
  "start": "node ./bin/outline-cli.js",
18
18
  "check": "node ./bin/outline-cli.js --help",
19
- "test": "node --test ./test/**/*.test.js",
19
+ "test": "node --test ./test/*.unit.test.js",
20
+ "test:integration": "node --test ./test/live.integration.test.js",
20
21
  "integrity:refresh": "node ./scripts/generate-entry-integrity.mjs",
21
22
  "release": "node ./scripts/release.mjs",
22
23
  "release:prepare": "node ./scripts/release.mjs --no-publish --no-push"
@@ -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: "b0d5d8d360178a565978d3392153cadc863df218f0ac6fdcf356ec08db09339e",
7
- generatedAt: "2026-09-19T15:26:58.286Z",
6
+ signature: "473207690cbe47a499645410613964b4fe7a71061f7c032fdfec72c06c4b3145",
7
+ generatedAt: "2026-10-18T11:09:03.780Z",
8
8
  files: [
9
9
  {
10
10
  "path": "src/action-gate.js",
@@ -52,7 +52,7 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
52
52
  },
53
53
  {
54
54
  "path": "src/tool-arg-schemas.js",
55
- "sha256": "ebc813dd48d5aeb44c655914d504f5ee1ec1ef8205bdec7c5f9adebb3337bd0d"
55
+ "sha256": "609c4cc17d57fae611dd2d59446cee2bb5437794af30151b61e195e720147155"
56
56
  },
57
57
  {
58
58
  "path": "src/tools.extended.js",
@@ -60,7 +60,7 @@ export const ENTRY_INTEGRITY_MANIFEST = Object.freeze({
60
60
  },
61
61
  {
62
62
  "path": "src/tools.js",
63
- "sha256": "32ffccc7e6a099fa932a3eb9c026a9ae99cdbeeacd4cd3226e2d3b85c0ee6df2"
63
+ "sha256": "8fed4d1f1c5e83b4a0e9136d2041b60262e4706426bd8c1c7751cc14dafac41c"
64
64
  },
65
65
  {
66
66
  "path": "src/tools.mutation.js",
@@ -1384,6 +1384,7 @@ export const TOOL_ARG_SCHEMAS = {
1384
1384
  "documents.info": {
1385
1385
  properties: {
1386
1386
  id: { type: "string" },
1387
+ url: { type: "string" },
1387
1388
  ids: { type: "string[]" },
1388
1389
  shareId: { type: "string" },
1389
1390
  includePolicies: { type: "boolean" },
@@ -1393,8 +1394,8 @@ export const TOOL_ARG_SCHEMAS = {
1393
1394
  readTokenTtlSeconds: { type: "number", min: 60 },
1394
1395
  },
1395
1396
  custom(args, issues) {
1396
- if (!args.id && !args.ids && !args.shareId) {
1397
- issues.push({ path: "args.id", message: "or args.ids[] or args.shareId is required" });
1397
+ if (!args.id && !args.ids && !args.url && !args.shareId) {
1398
+ issues.push({ path: "args.id", message: "or args.ids[] or args.url or args.shareId is required" });
1398
1399
  }
1399
1400
  },
1400
1401
  },
package/src/tools.js CHANGED
@@ -47,6 +47,30 @@ function normalizeIds(args) {
47
47
  return [...new Set(ids)];
48
48
  }
49
49
 
50
+ function normalizeDocumentReference(value) {
51
+ const reference = String(value).trim();
52
+ if (!reference.includes("://") && !reference.startsWith("/")) {
53
+ return reference;
54
+ }
55
+ let parsed;
56
+ try {
57
+ parsed = new URL(reference, "https://outline.invalid");
58
+ } catch {
59
+ throw new CliError("documents.info requires a document UUID, slug, or /doc/ URL");
60
+ }
61
+ const match = parsed.pathname.match(/^\/doc\/([^/]+)\/?$/);
62
+ if (!["http:", "https:"].includes(parsed.protocol) || !match) {
63
+ throw new CliError("documents.info requires a /doc/ URL; use shareId for shared documents");
64
+ }
65
+ try {
66
+ const slug = decodeURIComponent(match[1]);
67
+ if (!slug || /[/?#\s]/.test(slug)) throw new Error("invalid slug");
68
+ return slug;
69
+ } catch {
70
+ throw new CliError("documents.info URL contains an invalid document slug");
71
+ }
72
+ }
73
+
50
74
  function normalizeSearchRow(row, view = "summary", contextChars = 320) {
51
75
  if (view === "full") {
52
76
  return row;
@@ -624,14 +648,17 @@ async function documentsListTool(ctx, args) {
624
648
  }
625
649
 
626
650
  async function documentsInfoTool(ctx, args) {
627
- const ids = normalizeIds(args);
651
+ if (args.url && args.id && normalizeDocumentReference(args.url) !== normalizeDocumentReference(args.id)) {
652
+ throw new CliError("documents.info id and url must identify the same document");
653
+ }
654
+ const ids = [...new Set(normalizeIds({ ...args, id: args.id || args.url }).map(normalizeDocumentReference))];
628
655
  const view = args.view || "summary";
629
656
  const excerptChars = toInteger(args.excerptChars, 280);
630
657
  const armDelete = args.armDelete === true;
631
658
  const readTokenTtlSeconds = toInteger(args.readTokenTtlSeconds, 900);
632
659
 
633
660
  if (ids.length === 0 && !args.shareId) {
634
- throw new CliError("documents.info requires args.id, args.ids, or args.shareId");
661
+ throw new CliError("documents.info requires args.id, args.ids, args.url, or args.shareId");
635
662
  }
636
663
 
637
664
  const maxAttempts = toInteger(args.maxAttempts, 2);
@@ -1078,8 +1105,8 @@ export const TOOLS = {
1078
1105
  },
1079
1106
  "documents.info": {
1080
1107
  signature:
1081
- "documents.info(args: { id?: string; ids?: string[]; shareId?: string; view?: 'summary'|'full'; includePolicies?: boolean; concurrency?: number; armDelete?: boolean; readTokenTtlSeconds?: number })",
1082
- description: "Read one or many documents by ID.",
1108
+ "documents.info(args: { id?: string; ids?: string[]; url?: string; shareId?: string; view?: 'summary'|'full'; includePolicies?: boolean; concurrency?: number; armDelete?: boolean; readTokenTtlSeconds?: number })",
1109
+ description: "Read one or many documents by UUID, slug, or document URL.",
1083
1110
  usageExample: {
1084
1111
  tool: "documents.info",
1085
1112
  args: {
@@ -1089,7 +1116,8 @@ export const TOOLS = {
1089
1116
  },
1090
1117
  },
1091
1118
  bestPractices: [
1092
- "Use `ids[]` batch mode to fetch multiple docs in one CLI call.",
1119
+ "Use `id` or `url` for one document; `ids[]` accepts mixed UUIDs, slugs, and /doc/ URLs.",
1120
+ "Document URLs are resolved within the selected profile; select the matching workspace first.",
1093
1121
  "Use summary view first; only request full for final chosen docs.",
1094
1122
  "Handle partial failures by checking each item.ok in batched result.",
1095
1123
  "Set armDelete=true when you need a short-lived delete read token for a safe delete flow.",