@doist/outline-cli 1.2.1 → 1.4.0

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,3 +1,15 @@
1
+ ## [1.4.0](https://github.com/Doist/outline-cli/compare/v1.3.0...v1.4.0) (2026-04-02)
2
+
3
+ ### Features
4
+
5
+ * add `ol changelog` command ([#50](https://github.com/Doist/outline-cli/issues/50)) ([60656e5](https://github.com/Doist/outline-cli/commit/60656e5d816af6080f5084e3f44d0d9763e6c354))
6
+
7
+ ## [1.3.0](https://github.com/Doist/outline-cli/compare/v1.2.1...v1.3.0) (2026-04-02)
8
+
9
+ ### Features
10
+
11
+ * add `ol update` command ([#49](https://github.com/Doist/outline-cli/issues/49)) ([fa5608e](https://github.com/Doist/outline-cli/commit/fa5608ea50392a71150f7d1140204f0160680d8a))
12
+
1
13
  ## [1.2.1](https://github.com/Doist/outline-cli/compare/v1.2.0...v1.2.1) (2026-03-31)
2
14
 
3
15
  ### Bug Fixes
@@ -0,0 +1,7 @@
1
+ import { Command } from 'commander';
2
+ interface ChangelogOptions {
3
+ count: string;
4
+ }
5
+ export declare function changelogAction(options: ChangelogOptions): Promise<void>;
6
+ export declare function registerChangelogCommand(program: Command): void;
7
+ export {};
@@ -0,0 +1,95 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { dirname, join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import chalk from 'chalk';
5
+ import packageJson from '../../package.json' with { type: 'json' };
6
+ const CHANGELOG_PATH = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'CHANGELOG.md');
7
+ const CHANGELOG_URL = `https://github.com/Doist/outline-cli/blob/v${packageJson.version}/CHANGELOG.md`;
8
+ function formatInline(text) {
9
+ return text
10
+ .replace(/\*\*([^*]+)\*\*/g, (_, content) => chalk.bold(content))
11
+ .replace(/`([^`]+)`/g, (_, code) => chalk.cyan(code));
12
+ }
13
+ function formatForTerminal(text) {
14
+ return text
15
+ .split('\n')
16
+ .map((line) => {
17
+ // Version headers: ## 1.25.0 (date) → bold green
18
+ if (line.startsWith('## ')) {
19
+ return chalk.green.bold(line.slice(3));
20
+ }
21
+ // Section headers: ### Features → bold
22
+ if (line.startsWith('### ')) {
23
+ return chalk.bold(line.slice(4));
24
+ }
25
+ // Bullet items: * or - description → dimmed bullet + text
26
+ if (line.startsWith('* ')) {
27
+ return ` ${chalk.dim('•')} ${formatInline(line.slice(2))}`;
28
+ }
29
+ if (line.startsWith('- ')) {
30
+ return ` ${chalk.dim('•')} ${formatInline(line.slice(2))}`;
31
+ }
32
+ return formatInline(line);
33
+ })
34
+ .join('\n');
35
+ }
36
+ function cleanChangelog(text) {
37
+ return (text
38
+ // Version headers: ## [1.25.0](https://...) (date) → ## 1.25.0 (date)
39
+ .replace(/## \[([^\]]+)\]\([^)]*\)/g, '## $1')
40
+ // Remove commit hash links: ([abc1234](https://...))
41
+ .replace(/ \([a-f0-9]{7}\)/g, '')
42
+ .replace(/ \(\[[a-f0-9]{7}\]\([^)]*\)\)/g, '')
43
+ // Issue/PR links: [#151](https://...) → #151
44
+ .replace(/\[#(\d+)\]\([^)]*\)/g, '#$1')
45
+ // Remove **deps:** dependency update lines (not useful to end users)
46
+ .replace(/^[*-] \*\*deps:\*\*.*$/gm, '')
47
+ // Remove **scope:** prefixes but keep the text: **task:** foo → foo
48
+ .replace(/\*\*[\w-]+:\*\* /g, '')
49
+ // Clean up blank lines left by removed dep lines
50
+ .replace(/\n{3,}/g, '\n\n')
51
+ // Remove section headers left empty after filtering (e.g. ### Bug Fixes with no items)
52
+ .replace(/### [\w ]+\n\n(?=#|$)/gm, ''));
53
+ }
54
+ function parseChangelog(content, count) {
55
+ const sections = content.split(/\n(?=## (?:\d|\[))/);
56
+ const versionSections = sections.filter((s) => /^## (?:\d|\[)/.test(s));
57
+ const selected = versionSections.slice(0, count);
58
+ if (selected.length === 0) {
59
+ return { text: 'No changelog entries found.', hasMore: false };
60
+ }
61
+ return {
62
+ text: cleanChangelog(selected.join('\n').trimEnd()),
63
+ hasMore: versionSections.length > count,
64
+ };
65
+ }
66
+ export async function changelogAction(options) {
67
+ const count = Number(options.count);
68
+ if (!Number.isInteger(count) || count < 1) {
69
+ console.error(chalk.red('Error:'), 'Count must be a positive number');
70
+ process.exitCode = 1;
71
+ return;
72
+ }
73
+ let content;
74
+ try {
75
+ content = await readFile(CHANGELOG_PATH, 'utf-8');
76
+ }
77
+ catch {
78
+ console.error(chalk.red('Error:'), 'Could not read changelog file');
79
+ process.exitCode = 1;
80
+ return;
81
+ }
82
+ const { text, hasMore } = parseChangelog(content, count);
83
+ console.log(formatForTerminal(text));
84
+ if (hasMore) {
85
+ console.log(chalk.dim(`\nView full changelog: ${CHANGELOG_URL}`));
86
+ }
87
+ }
88
+ export function registerChangelogCommand(program) {
89
+ program
90
+ .command('changelog')
91
+ .description('Show recent changelog entries')
92
+ .option('-n, --count <number>', 'Number of versions to show', '5')
93
+ .action(changelogAction);
94
+ }
95
+ //# sourceMappingURL=changelog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/commands/changelog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAElE,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAA;AAChG,MAAM,aAAa,GAAG,8CAA8C,WAAW,CAAC,OAAO,eAAe,C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 export declare function updateAction(options: {
3
+ check?: boolean;
4
+ }): Promise<void>;
5
+ export declare function registerUpdateCommand(program: Command): void;
@@ -0,0 +1,93 @@
1
+ import { spawn } from 'node:child_process';
2
+ import chalk from 'chalk';
3
+ import packageJson from '../../package.json' with { type: 'json' };
4
+ import { withSpinner } from '../lib/spinner.js';
5
+ import { fetchWithRetry } from '../transport/fetch-with-retry.js';
6
+ const PACKAGE_NAME = '@doist/outline-cli';
7
+ const REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
8
+ async function fetchLatestVersion() {
9
+ const response = await fetchWithRetry({ url: REGISTRY_URL });
10
+ if (!response.ok) {
11
+ throw new Error(`Registry request failed (HTTP ${response.status})`);
12
+ }
13
+ const data = (await response.json());
14
+ return data.version;
15
+ }
16
+ function detectPackageManager() {
17
+ const execPath = process.env.npm_execpath || process.argv[1] || '';
18
+ if (execPath.includes('pnpm'))
19
+ return 'pnpm';
20
+ return 'npm';
21
+ }
22
+ function runInstall(pm) {
23
+ const command = pm === 'pnpm' ? 'add' : 'install';
24
+ return new Promise((resolve, reject) => {
25
+ const child = spawn(pm, [command, '-g', `${PACKAGE_NAME}@latest`], {
26
+ stdio: ['ignore', 'ignore', 'pipe'],
27
+ shell: process.platform === 'win32',
28
+ });
29
+ let stderr = '';
30
+ child.stderr?.on('data', (data) => {
31
+ stderr += data.toString();
32
+ });
33
+ child.on('error', reject);
34
+ child.on('close', (code) => resolve({ exitCode: code ?? 1, stderr }));
35
+ });
36
+ }
37
+ export async function updateAction(options) {
38
+ const currentVersion = packageJson.version;
39
+ let latestVersion;
40
+ try {
41
+ latestVersion = await withSpinner({ text: 'Checking for updates...', color: 'blue' }, fetchLatestVersion);
42
+ }
43
+ catch (error) {
44
+ const message = error instanceof Error ? error.message : String(error);
45
+ console.error(chalk.red('Error:'), `Failed to check for updates: ${message}`);
46
+ process.exitCode = 1;
47
+ return;
48
+ }
49
+ if (currentVersion === latestVersion) {
50
+ console.log(chalk.green('✓'), `Already up to date (v${currentVersion})`);
51
+ return;
52
+ }
53
+ console.log(`Update available: ${chalk.dim(`v${currentVersion}`)} → ${chalk.green(`v${latestVersion}`)}`);
54
+ if (options.check) {
55
+ return;
56
+ }
57
+ const pm = detectPackageManager();
58
+ let result;
59
+ try {
60
+ result = await withSpinner({ text: `Updating to v${latestVersion}...`, color: 'blue' }, () => runInstall(pm));
61
+ }
62
+ catch (error) {
63
+ const message = error instanceof Error ? error.message : String(error);
64
+ console.error(chalk.red('Error:'), `Install failed: ${message}`);
65
+ process.exitCode = 1;
66
+ return;
67
+ }
68
+ if (result.exitCode !== 0) {
69
+ if (result.stderr &&
70
+ (result.stderr.includes('EACCES') || result.stderr.includes('EPERM'))) {
71
+ console.error(chalk.red('Error:'), 'Permission denied. Try running with sudo:');
72
+ console.error(chalk.dim(` sudo ${pm} ${pm === 'pnpm' ? 'add' : 'install'} -g ${PACKAGE_NAME}@latest`));
73
+ }
74
+ else {
75
+ console.error(chalk.red('Error:'), `${pm} exited with code ${result.exitCode}`);
76
+ if (result.stderr) {
77
+ console.error(chalk.dim(result.stderr.trim()));
78
+ }
79
+ }
80
+ process.exitCode = 1;
81
+ return;
82
+ }
83
+ console.log(chalk.green('✓'), `Updated to v${latestVersion}`);
84
+ console.log(chalk.dim(' Run'), chalk.cyan('ol changelog'), chalk.dim('to see what changed'));
85
+ }
86
+ export function registerUpdateCommand(program) {
87
+ program
88
+ .command('update')
89
+ .description('Update the CLI to the latest version')
90
+ .option('--check', 'Check for updates without installing')
91
+ .action(updateAction);
92
+ }
93
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;A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AC,CAAC,SAAS,OAAO,YAAY,SAAS,CAChF,CACJ,CAAA;QACL,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,qBAAqB,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA;YAC/E,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAChB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;YAClD,CAAC;QACL,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;QACpB,OAAM;IACV,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,eAAe,aAAa,EAAE,CAAC,CAAA;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAA;AACjG,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IAClD,OAAO;SACF,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,SAAS,EAAE,sCAAsC,CAAC;SACzD,MAAM,CAAC,YAAY,CAAC,CAAA;AAC7B,CAAC"}
package/dist/index.js CHANGED
@@ -1,10 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
3
  import { registerAuthCommand } from './commands/auth.js';
4
+ import { registerChangelogCommand } from './commands/changelog.js';
4
5
  import { registerCollectionCommand } from './commands/collection.js';
5
6
  import { registerDocumentCommand } from './commands/document.js';
6
7
  import { registerSearchCommand } from './commands/search.js';
7
8
  import { registerSkillCommand } from './commands/skill.js';
9
+ import { registerUpdateCommand } from './commands/update.js';
8
10
  const program = new Command();
9
11
  program
10
12
  .name('ol')
@@ -20,6 +22,8 @@ registerSearchCommand(program);
20
22
  registerDocumentCommand(program);
21
23
  registerCollectionCommand(program);
22
24
  registerSkillCommand(program);
25
+ registerChangelogCommand(program);
26
+ registerUpdateCommand(program);
23
27
  program.parseAsync().catch((err) => {
24
28
  console.error(err.message);
25
29
  process.exit(1);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE1D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AAE7B,OAAO;KACF,IAAI,CAAC,IAAI,CAAC;KACV,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,6CAA6C,CAAC;KAC1D,MAAM,CAAC,cAAc,EAAE,4BAA4B,CAAC;KACpD,WAAW,CACR,OAAO,EACP;;;kEAG0D,CAC7D,CAAA;AAEL,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAC5B,qBAAqB,CAAC,OAAO,CAAC,CAAA;AAC9B,uBAAuB,CAAC,OAAO,CAAC,CAAA;AAChC,yBAAyB,CAAC,OAAO,CAAC,CAAA;AAClC,oBAAoB,CAAC,OAAO,CAAC,CAAA;AAE7B,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;IACtC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAC1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I,CAAC,CAAC,CAAC,CAAA;AACnB,CAAC,CAAC,CAAA"}
@@ -1,3 +1,3 @@
1
1
  export declare const SKILL_NAME = "outline-cli";
2
2
  export declare const SKILL_DESCRIPTION = "Search and manage Outline wiki documents and collections via the ol CLI";
3
- export declare const SKILL_CONTENT = "# Outline CLI (ol)\n\nUse this skill when the user wants to interact with their Outline wiki/knowledge base.\n\n## Quick Reference\n\n- `ol search \"query\"` - Search documents\n- `ol doc list` - List documents\n- `ol doc get <id>` - Read a document\n- `ol doc open <id>` - Open document in browser\n- `ol doc create --title \"Title\" --collection <id>` - Create document\n- `ol col list` - List collections\n\n## Output Formats\n\nAll list commands support:\n- `--json` - JSON output (essential fields)\n- `--ndjson` - Newline-delimited JSON (streaming)\n- `--full` - Include all fields in JSON\n\n## Document References\n\nDocuments can be referenced by:\n- URL ID (the slug suffix after the last hyphen)\n- Full Outline URL (auto-extracted)\n- Document ID\n\n## Commands\n\n### Search\n```bash\nol search \"query\"\nol search \"query\" --limit 10\nol search \"query\" --collection <id>\nol search \"query\" --status published\nol search \"query\" --json\n```\n\n### Documents\n```bash\nol doc list --collection <id> --limit 25\nol doc list --sort title --direction ASC\nol doc get <id> # Rendered markdown\nol doc get <id> --raw # Raw markdown\nol doc get <id> --json\nol doc open <id> # Open in browser\nol doc create --title \"Title\" --collection <id> --text \"# Content\"\nol doc create --title \"Title\" --parent <ref> --text \"# Content\" # Nest under parent (collection inferred)\nol doc create --title \"Title\" --collection <id> --file ./doc.md\nol doc update <id> --title \"New Title\"\nol doc update <id> --file ./updated.md\nol doc move <id> --collection <target-id> # Move to collection root\nol doc move <id> --parent <ref> # Nest under parent (collection inferred)\nol doc archive <id>\nol doc unarchive <id>\nol doc delete <id> --confirm\n```\n\n### Collections\n```bash\nol col list\nol col get <id>\nol col create --name \"Name\" --description \"Desc\" --color \"#hex\"\nol col create --name \"Private\" --private\nol col update <id> --name \"New Name\"\nol col delete <id> --confirm\n```\n\n### Authentication\n```bash\nol auth login # Configure API token and base URL\nol auth status # Show current auth state\nol auth logout # Clear saved credentials\n```\n\n## Examples\n\n### Find and read a document\n```bash\nol search \"onboarding\" --json | jq '.[0].document.urlId'\nol doc get <urlId>\n```\n\n### Create a document from a file\n```bash\nol doc create --title \"Meeting Notes\" --collection <id> --file ./notes.md --publish\n```\n\n### List all collections and their documents\n```bash\nol col list --json\nol doc list --collection <id> --sort title --direction ASC\n```\n\n### Bulk export with ndjson\n```bash\nol doc list --ndjson --full | jq -r '.title'\n```\n";
3
+ export declare const SKILL_CONTENT = "# Outline CLI (ol)\n\nUse this skill when the user wants to interact with their Outline wiki/knowledge base.\n\n## Quick Reference\n\n- `ol search \"query\"` - Search documents\n- `ol doc list` - List documents\n- `ol doc get <id>` - Read a document\n- `ol doc open <id>` - Open document in browser\n- `ol doc create --title \"Title\" --collection <id>` - Create document\n- `ol col list` - List collections\n\n## Output Formats\n\nAll list commands support:\n- `--json` - JSON output (essential fields)\n- `--ndjson` - Newline-delimited JSON (streaming)\n- `--full` - Include all fields in JSON\n\n## Document References\n\nDocuments can be referenced by:\n- URL ID (the slug suffix after the last hyphen)\n- Full Outline URL (auto-extracted)\n- Document ID\n\n## Commands\n\n### Search\n```bash\nol search \"query\"\nol search \"query\" --limit 10\nol search \"query\" --collection <id>\nol search \"query\" --status published\nol search \"query\" --json\n```\n\n### Documents\n```bash\nol doc list --collection <id> --limit 25\nol doc list --sort title --direction ASC\nol doc get <id> # Rendered markdown\nol doc get <id> --raw # Raw markdown\nol doc get <id> --json\nol doc open <id> # Open in browser\nol doc create --title \"Title\" --collection <id> --text \"# Content\"\nol doc create --title \"Title\" --parent <ref> --text \"# Content\" # Nest under parent (collection inferred)\nol doc create --title \"Title\" --collection <id> --file ./doc.md\nol doc update <id> --title \"New Title\"\nol doc update <id> --file ./updated.md\nol doc move <id> --collection <target-id> # Move to collection root\nol doc move <id> --parent <ref> # Nest under parent (collection inferred)\nol doc archive <id>\nol doc unarchive <id>\nol doc delete <id> --confirm\n```\n\n### Collections\n```bash\nol col list\nol col get <id>\nol col create --name \"Name\" --description \"Desc\" --color \"#hex\"\nol col create --name \"Private\" --private\nol col update <id> --name \"New Name\"\nol col delete <id> --confirm\n```\n\n### Authentication\n```bash\nol auth login # Configure API token and base URL\nol auth status # Show current auth state\nol auth logout # Clear saved credentials\n```\n\n### Update & Changelog\n```bash\nol update # Update to the latest version\nol update --check # Check for updates without installing\nol changelog # Show recent changelog entries\nol changelog -n 3 # Show last 3 versions\n```\n\n## Examples\n\n### Find and read a document\n```bash\nol search \"onboarding\" --json | jq '.[0].document.urlId'\nol doc get <urlId>\n```\n\n### Create a document from a file\n```bash\nol doc create --title \"Meeting Notes\" --collection <id> --file ./notes.md --publish\n```\n\n### List all collections and their documents\n```bash\nol col list --json\nol doc list --collection <id> --sort title --direction ASC\n```\n\n### Bulk export with ndjson\n```bash\nol doc list --ndjson --full | jq -r '.title'\n```\n";
@@ -75,6 +75,14 @@ ol auth status # Show current auth state
75
75
  ol auth logout # Clear saved credentials
76
76
  \`\`\`
77
77
 
78
+ ### Update & Changelog
79
+ \`\`\`bash
80
+ ol update # Update to the latest version
81
+ ol update --check # Check for updates without installing
82
+ ol changelog # Show recent changelog entries
83
+ ol changelog -n 3 # Show last 3 versions
84
+ \`\`\`
85
+
78
86
  ## Examples
79
87
 
80
88
  ### Find and read a document
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAA;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAC1B,yEAAyE,CAAA;AAE7E,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkG5B,CAAA"}
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/lib/skills/content.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAA;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAC1B,yEAAyE,CAAA;AAE7E,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0G5B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/outline-cli",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
4
4
  "description": "CLI for the Outline wiki/knowledge base API",
5
5
  "type": "module",
6
6
  "bin": {
@@ -35,7 +35,7 @@
35
35
  "test:watch": "vitest",
36
36
  "postinstall": "node scripts/postinstall.js",
37
37
  "check:skill-sync": "node scripts/check-skill-sync.js",
38
- "sync:skill": "node scripts/sync-skill.js",
38
+ "sync:skill": "npm run build && node scripts/sync-skill.js",
39
39
  "prepublishOnly": "npm run build && npm test"
40
40
  },
41
41
  "keywords": [