@doist/outline-cli 2.0.9 → 2.1.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 +6 -0
- package/README.md +1 -1
- package/dist/commands/auth.js +7 -9
- package/dist/commands/auth.js.map +1 -1
- package/dist/lib/auth.d.ts +8 -7
- package/dist/lib/auth.js +13 -22
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/skills/content.d.ts +1 -1
- package/dist/lib/skills/content.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [2.1.0](https://github.com/Doist/outline-cli/compare/v2.0.9...v2.1.0) (2026-09-16)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **auth:** refresh an expiring OAuth token before `token view` / `status` ([#123](https://github.com/Doist/outline-cli/issues/123)) ([2584eaf](https://github.com/Doist/outline-cli/commit/2584eaf33f0368285ee47e4d3d94adcd6696d66f))
|
|
6
|
+
|
|
1
7
|
## [2.0.9](https://github.com/Doist/outline-cli/compare/v2.0.8...v2.0.9) (2026-09-15)
|
|
2
8
|
|
|
3
9
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -88,7 +88,7 @@ If you prefer using an API token directly:
|
|
|
88
88
|
```bash
|
|
89
89
|
ol auth token <your-api-token> # save a token (verifies it against your instance)
|
|
90
90
|
ol auth token # prompt for the token interactively
|
|
91
|
-
ol auth token view # print the stored token to stdout
|
|
91
|
+
ol auth token view # print the stored token to stdout (refreshes an expiring OAuth token first)
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
Generate a token in Outline under Settings → API Tokens. Pass
|
package/dist/commands/auth.js
CHANGED
|
@@ -5,7 +5,7 @@ import { TOKEN_ENV_VAR } from '../lib/auth-constants.js';
|
|
|
5
5
|
import { logClearResult, logSaveResult } from '../lib/auth-output.js';
|
|
6
6
|
import { renderError, renderSuccess } from '../lib/auth-pages.js';
|
|
7
7
|
import { createOutlineAuthProvider, createOutlineTokenStore, getActiveTokenSource, identifyAccount, prompt, resolveBaseUrl, } from '../lib/auth-provider.js';
|
|
8
|
-
import {
|
|
8
|
+
import { getTokenRefreshOptions } from '../lib/auth.js';
|
|
9
9
|
import { CliError } from '../lib/errors.js';
|
|
10
10
|
import { isJsonMode } from '../lib/global-args.js';
|
|
11
11
|
import { withUserRefAware } from '../lib/user-ref-store.js';
|
|
@@ -89,17 +89,14 @@ export function registerAuthCommand(program) {
|
|
|
89
89
|
attachStatusCommand(auth, {
|
|
90
90
|
store: refAware,
|
|
91
91
|
description: 'Show current authentication state',
|
|
92
|
+
// Outline access tokens last ~an hour; without a refresh `auth status`
|
|
93
|
+
// can't self-heal even though normal commands do. cli-core rotates the
|
|
94
|
+
// selected account's token first and hands `fetchLive` the live one.
|
|
95
|
+
refresh: getTokenRefreshOptions(),
|
|
92
96
|
async fetchLive({ account, token }) {
|
|
93
97
|
try {
|
|
94
|
-
// Refresh the *selected* account before the check (scoped via
|
|
95
|
-
// its id + base URL/client id), then probe with the rotated
|
|
96
|
-
// token. Outline access tokens last ~an hour; without this
|
|
97
|
-
// `auth status` can't self-heal even though normal commands
|
|
98
|
-
// do. Passing the resolved token keeps the check tied to the
|
|
99
|
-
// requested account rather than the default.
|
|
100
|
-
const liveToken = await refreshedTokenForStatus(account, token);
|
|
101
98
|
const [{ data: info }, source] = await Promise.all([
|
|
102
|
-
apiRequest('auth.info', {}, { token
|
|
99
|
+
apiRequest('auth.info', {}, { token, baseUrl: account.baseUrl }),
|
|
103
100
|
// Scope the source to the selected account so `auth status
|
|
104
101
|
// --user <ref>` reports where *that* account's token lives,
|
|
105
102
|
// not the default/env source. Empty id (env/legacy snapshot)
|
|
@@ -165,6 +162,7 @@ export function registerAuthCommand(program) {
|
|
|
165
162
|
name: 'view',
|
|
166
163
|
store: refAware,
|
|
167
164
|
envVarName: TOKEN_ENV_VAR,
|
|
165
|
+
refresh: getTokenRefreshOptions(),
|
|
168
166
|
description: 'Print the stored token for the active user (or --user <ref>) to stdout for scripts',
|
|
169
167
|
});
|
|
170
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAEH,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EAGf,MAAM,EACN,cAAc,GACjB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAEH,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EAGf,MAAM,EACN,cAAc,GACjB,MAAM,yBAAyB,CAAA;A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QAAQ;gBACtB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,MAAM,EAAE,UAAU,CAAC,MAAM;aAC5B,CAAA;QACL,CAAC;QACD,kBAAkB;YACd,MAAM,IAAI,QAAQ,CAAC,mBAAmB,EAAE,uCAAuC,CAAC,CAAA;QACpF,CAAC;KACJ,CAAC,CAAA;IAEF,mBAAmB,CAAiB,IAAI,EAAE;QACtC,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,4BAA4B;QACzC,SAAS,CAAC,EAAE,IAAI,EAAE;YACd,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAA;QACnD,CAAC;KACJ,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,IAAI;SAChB,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,uEAAuE,CAAC;SACpF,MAAM,CAAC,kBAAkB,EAAE,uCAAuC,CAAC;SACnE,MAAM,CAAC,CAAC,KAAyB,EAAE,OAA6B,EAAE,EAAE,CACjE,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CACnC,CAAA;IAEL,sBAAsB,CAAiB,QAAQ,EAAE;QAC7C,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,QAAQ;QACf,UAAU,EAAE,aAAa;QACzB,OAAO,EAAE,sBAAsB,EAAE;QACjC,WAAW,EACP,oFAAoF;KAC3F,CAAC,CAAA;AACN,CAAC"}
|
package/dist/lib/auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SecureStoreUnavailableError } from '@doist/cli-core/auth';
|
|
1
|
+
import { SecureStoreUnavailableError, type TokenRefreshOptions } from '@doist/cli-core/auth';
|
|
2
2
|
import { TOKEN_ENV_VAR } from './auth-constants.js';
|
|
3
3
|
import { getActiveTokenSource } from './auth-provider.js';
|
|
4
4
|
import { CliError } from './errors.js';
|
|
@@ -26,13 +26,14 @@ export declare class NoTokenError extends CliError {
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function proactiveRefresh(handshake?: RequestContext['handshake']): Promise<string | undefined>;
|
|
28
28
|
/**
|
|
29
|
-
* Refresh
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* Refresh wiring for cli-core's `auth status` / `auth token view` attachers,
|
|
30
|
+
* so both hand back a token that is usable right now rather than whatever
|
|
31
|
+
* was last stored. The attachers pass their own (`--user`-aware) store, so
|
|
32
|
+
* the handshake is resolved from the account cli-core actually selected —
|
|
33
|
+
* pinning the refresh to that account's instance and client id. Env, legacy
|
|
34
|
+
* and record-less accounts carry no refresh token and are served as-is.
|
|
34
35
|
*/
|
|
35
|
-
export declare function
|
|
36
|
+
export declare function getTokenRefreshOptions(): TokenRefreshOptions<OutlineAccount>;
|
|
36
37
|
/**
|
|
37
38
|
* Reactive rotation after a 401. Returns `true` when the token rotated (the
|
|
38
39
|
* caller retries once). A rejected/absent refresh token surfaces as
|
package/dist/lib/auth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { refreshAccessToken, SecureStoreUnavailableError } from '@doist/cli-core/auth';
|
|
1
|
+
import { refreshAccessToken, SecureStoreUnavailableError, } from '@doist/cli-core/auth';
|
|
2
2
|
import { TOKEN_ENV_VAR } from './auth-constants.js';
|
|
3
3
|
import { createOutlineAuthProvider, createOutlineTokenStore, getActiveTokenSource, } from './auth-provider.js';
|
|
4
4
|
import { getConfig, getConfigPath } from './config.js';
|
|
@@ -75,28 +75,19 @@ export async function proactiveRefresh(handshake) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
|
-
* Refresh
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
78
|
+
* Refresh wiring for cli-core's `auth status` / `auth token view` attachers,
|
|
79
|
+
* so both hand back a token that is usable right now rather than whatever
|
|
80
|
+
* was last stored. The attachers pass their own (`--user`-aware) store, so
|
|
81
|
+
* the handshake is resolved from the account cli-core actually selected —
|
|
82
|
+
* pinning the refresh to that account's instance and client id. Env, legacy
|
|
83
|
+
* and record-less accounts carry no refresh token and are served as-is.
|
|
83
84
|
*/
|
|
84
|
-
export
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
provider: authProvider(),
|
|
91
|
-
lockPath: refreshLockPath(),
|
|
92
|
-
ref: account.id,
|
|
93
|
-
handshake: { baseUrl: account.baseUrl, clientId: account.oauthClientId },
|
|
94
|
-
});
|
|
95
|
-
return bundle.accessToken;
|
|
96
|
-
}
|
|
97
|
-
catch {
|
|
98
|
-
return fallback;
|
|
99
|
-
}
|
|
85
|
+
export function getTokenRefreshOptions() {
|
|
86
|
+
return {
|
|
87
|
+
provider: authProvider(),
|
|
88
|
+
lockPath: refreshLockPath(),
|
|
89
|
+
handshake: ({ account }) => ({ baseUrl: account.baseUrl, clientId: account.oauthClientId }),
|
|
90
|
+
};
|
|
100
91
|
}
|
|
101
92
|
/**
|
|
102
93
|
* Reactive rotation after a 401. Returns `true` when the token rotated (the
|
package/dist/lib/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,2BAA2B,GAE9B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EACH,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,GAEvB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,O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CAAC,aAAa;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC,aAAa,CAAA;IACtE,OAAO,MAAM,CAAC,eAAe,CAAA;AACjC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACnC,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAA;IAChC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACpB,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,SAAS,EAAE,EAAE,GAAG,CAAC,CAAA;QACnD,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YACzD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAA;QACtF,CAAC;IACL,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,EAAE,EAAE,CAAA;AAC1C,CAAC"}
|
|
@@ -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- `ol account` - List stored accounts; `ol account use <id|name>` sets the default\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## Global Options\n\n- `--user <id|name>` - Act as a specific stored account, matched by Outline user ID or display name. Each `ol auth login` stores an account (accounts can live on different Outline instances), and `--user` selects which one a command runs as; the token, base URL, and OAuth client ID all resolve from that account. Must be placed **before** the command, e.g. `ol --user scott@example.com doc list`. Omitted, commands use the default account. Overridden by `OUTLINE_API_TOKEN` when set.\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 # OAuth login (opens browser); prompts for base URL + client ID if needed\nol auth login --base-url <url> # Specify Outline base URL for this login (saved for future use)\nol auth login --client-id <id> # Specify OAuth client ID for this login (saved for future use)\nol auth login --callback-port <port> # Override local OAuth callback port\nol auth login --read-only # Request read-only scopes (where supported by the Outline instance)\nol auth login --json | --ndjson # Machine-readable success envelope\nol auth status # Show current auth state\nol auth status --json | --ndjson # Machine-readable status envelope ({id, team, baseUrl, source})\nol auth logout # Clear saved credentials\nol auth logout --json | --ndjson # Machine-readable logout envelope ({ok: true}; --ndjson is silent)\nol auth token <token> # Save a personal API token (validates via auth.info, resolves identity)\nol auth token <token> --base-url <url> # Save a token for a specific Outline instance\nol auth token # Prompt for the token (hidden input; errors in non-interactive shells)\nol auth token view # Print the bare stored token to stdout for scripts (no newline when piped; refuses when OUTLINE_API_TOKEN is set)\nol --user <id|name> auth token view # Print a specific stored account's token (--user is a root flag, before the command)\n```\n\n### Accounts\n```bash\nol account # List stored accounts (default subcommand)\nol account list # List stored accounts, default marked\nol account list --json | --ndjson # Machine-readable list ({accounts, default}; --ndjson streams one per line)\nol account current # Show the active account (honours --user and OUTLINE_API_TOKEN)\nol account current --json | --ndjson # Discriminated by source: {source:\"stored\", account:{id, label, teamName, baseUrl, isDefault}} | {source:\"env\"} | {source:\"legacy\"}\nol account use <id|name> # Set the default account used when --user is omitted\nol account use <id|name> --json # Machine-readable envelope ({ok: true, default: <id>}; --ndjson is silent)\nol account remove <id|name> # Remove a stored account (clears keyring + config entry)\nol account remove <id|name> --json # Machine-readable envelope ({ok: true, removed: <id>}; --ndjson is silent)\n```\n\n### Update & Changelog\n```bash\nol update # Update CLI to latest version\nol update --check # Check for updates without installing, show channel\nol update --check --json # Check for updates as a JSON envelope\nol update --check --ndjson # Check for updates as NDJSON output\nol update --channel # Show current update channel\nol update switch --stable # Switch to stable release channel\nol update switch --pre-release # Switch to pre-release (next) channel\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";
|
|
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- `ol account` - List stored accounts; `ol account use <id|name>` sets the default\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## Global Options\n\n- `--user <id|name>` - Act as a specific stored account, matched by Outline user ID or display name. Each `ol auth login` stores an account (accounts can live on different Outline instances), and `--user` selects which one a command runs as; the token, base URL, and OAuth client ID all resolve from that account. Must be placed **before** the command, e.g. `ol --user scott@example.com doc list`. Omitted, commands use the default account. Overridden by `OUTLINE_API_TOKEN` when set.\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 # OAuth login (opens browser); prompts for base URL + client ID if needed\nol auth login --base-url <url> # Specify Outline base URL for this login (saved for future use)\nol auth login --client-id <id> # Specify OAuth client ID for this login (saved for future use)\nol auth login --callback-port <port> # Override local OAuth callback port\nol auth login --read-only # Request read-only scopes (where supported by the Outline instance)\nol auth login --json | --ndjson # Machine-readable success envelope\nol auth status # Show current auth state\nol auth status --json | --ndjson # Machine-readable status envelope ({id, team, baseUrl, source})\nol auth logout # Clear saved credentials\nol auth logout --json | --ndjson # Machine-readable logout envelope ({ok: true}; --ndjson is silent)\nol auth token <token> # Save a personal API token (validates via auth.info, resolves identity)\nol auth token <token> --base-url <url> # Save a token for a specific Outline instance\nol auth token # Prompt for the token (hidden input; errors in non-interactive shells)\nol auth token view # Print the bare stored token to stdout for scripts (refreshes an expiring OAuth token first; no newline when piped; refuses when OUTLINE_API_TOKEN is set)\nol --user <id|name> auth token view # Print a specific stored account's token (--user is a root flag, before the command)\n```\n\n### Accounts\n```bash\nol account # List stored accounts (default subcommand)\nol account list # List stored accounts, default marked\nol account list --json | --ndjson # Machine-readable list ({accounts, default}; --ndjson streams one per line)\nol account current # Show the active account (honours --user and OUTLINE_API_TOKEN)\nol account current --json | --ndjson # Discriminated by source: {source:\"stored\", account:{id, label, teamName, baseUrl, isDefault}} | {source:\"env\"} | {source:\"legacy\"}\nol account use <id|name> # Set the default account used when --user is omitted\nol account use <id|name> --json # Machine-readable envelope ({ok: true, default: <id>}; --ndjson is silent)\nol account remove <id|name> # Remove a stored account (clears keyring + config entry)\nol account remove <id|name> --json # Machine-readable envelope ({ok: true, removed: <id>}; --ndjson is silent)\n```\n\n### Update & Changelog\n```bash\nol update # Update CLI to latest version\nol update --check # Check for updates without installing, show channel\nol update --check --json # Check for updates as a JSON envelope\nol update --check --ndjson # Check for updates as NDJSON output\nol update --channel # Show current update channel\nol update switch --stable # Switch to stable release channel\nol update switch --pre-release # Switch to pre-release (next) channel\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";
|
|
@@ -88,7 +88,7 @@ ol auth logout --json | --ndjson # Machine-readable logout envelope ({ok:
|
|
|
88
88
|
ol auth token <token> # Save a personal API token (validates via auth.info, resolves identity)
|
|
89
89
|
ol auth token <token> --base-url <url> # Save a token for a specific Outline instance
|
|
90
90
|
ol auth token # Prompt for the token (hidden input; errors in non-interactive shells)
|
|
91
|
-
ol auth token view # Print the bare stored token to stdout for scripts (no newline when piped; refuses when OUTLINE_API_TOKEN is set)
|
|
91
|
+
ol auth token view # Print the bare stored token to stdout for scripts (refreshes an expiring OAuth token first; no newline when piped; refuses when OUTLINE_API_TOKEN is set)
|
|
92
92
|
ol --user <id|name> auth token view # Print a specific stored account's token (--user is a root flag, before the command)
|
|
93
93
|
\`\`\`
|
|
94
94
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/outline-cli",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "CLI for the Outline wiki/knowledge base API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"npm": ">=11"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@doist/cli-core": "1.
|
|
52
|
+
"@doist/cli-core": "1.6.0",
|
|
53
53
|
"chalk": "6.0.0",
|
|
54
54
|
"commander": "15.0.0",
|
|
55
55
|
"marked": "18.0.12",
|