@artifactshare/cli 0.11.1 → 0.11.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 CHANGED
@@ -5,6 +5,10 @@ For user-facing announcements, see https://artifactshare.com/updates?product=cli
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.11.2 - 2026-08-12
9
+
10
+ - Direct agents with a user present to project-scoped browser login, and reserve API-token guidance for unattended CI or scripts without browser approval.
11
+
8
12
  ## 0.11.1 - 2026-08-12
9
13
 
10
14
  - Warn in `doctor` when an agent credential's approved project differs from the configured default destination, and provide an `init` command to align them.
package/dist/index.js CHANGED
@@ -542,6 +542,7 @@ function authRecoveryDetails(baseUrl, loginCommand = `${CLI_INVOCATION} login --
542
542
  token_url: tokensUrl(baseUrl),
543
543
  env_var: TOKEN_ENV_VAR,
544
544
  login_command: loginCommand,
545
+ agent_login_command: `${loginCommand} --preset agent`,
545
546
  token_option: TOKEN_OPTION
546
547
  };
547
548
  }
@@ -551,7 +552,7 @@ function authRequiredError(baseUrl) {
551
552
  code: "auth_required",
552
553
  message: "Login is required.",
553
554
  why: `No ${TOKEN_ENV_VAR} or ${TOKEN_OPTION} value was provided.`,
554
- hint: `In an interactive terminal, run ${CLI_INVOCATION} login --profile default. In agents or CI, issue a token at ${url}, then set ${TOKEN_ENV_VAR} or pass ${TOKEN_OPTION}.`,
555
+ hint: `With a user present, run ${CLI_INVOCATION} login --profile default; for an agent, add --preset agent. In unattended CI or scripts without browser approval, issue a token at ${url}, then set ${TOKEN_ENV_VAR} or pass ${TOKEN_OPTION}.`,
555
556
  agentRecoverable: false,
556
557
  requiresHuman: true,
557
558
  recovery: { kind: "ask_human" },
@@ -564,7 +565,7 @@ function profileReauthRequiredError(baseUrl, source, profile) {
564
565
  code: "auth_required",
565
566
  message: "Login is required.",
566
567
  why: `The saved credential for profile "${profile}" is invalid or expired.`,
567
- hint: `In an interactive terminal, run ${loginCommand}. In agents or CI, issue a token at ${tokensUrl(baseUrl)}, then set ${TOKEN_ENV_VAR} or pass ${TOKEN_OPTION}.`,
568
+ hint: `With a user present, run ${loginCommand}; for an agent, add --preset agent. In unattended CI or scripts without browser approval, issue a token at ${tokensUrl(baseUrl)}, then set ${TOKEN_ENV_VAR} or pass ${TOKEN_OPTION}.`,
568
569
  agentRecoverable: false,
569
570
  requiresHuman: true,
570
571
  recovery: { kind: "ask_human" },
@@ -2148,7 +2149,7 @@ async function profileAuthRequired(source, profile, reason, options, globalConfi
2148
2149
  error: {
2149
2150
  ...error,
2150
2151
  why,
2151
- hint: `${switchHint} Or in an interactive terminal run ${CLI_INVOCATION} login --profile ${profile}. In agents or CI, issue a token at ${url}, then set ${TOKEN_ENV_VAR}.`,
2152
+ hint: `${switchHint} Or with a user present run ${CLI_INVOCATION} login --profile ${profile}; for an agent, add --preset agent. In unattended CI or scripts without browser approval, issue a token at ${url}, then set ${TOKEN_ENV_VAR}.`,
2152
2153
  agent_recoverable: true,
2153
2154
  requires_human: false,
2154
2155
  recovery: {
@@ -2170,7 +2171,7 @@ async function profileAuthRequired(source, profile, reason, options, globalConfi
2170
2171
  error: {
2171
2172
  ...error,
2172
2173
  why,
2173
- hint: `In an interactive terminal, run ${CLI_INVOCATION} login --profile ${profile}. In agents or CI, issue a token at ${url}, then set ${TOKEN_ENV_VAR}.`,
2174
+ hint: `With a user present, run ${CLI_INVOCATION} login --profile ${profile}; for an agent, add --preset agent. In unattended CI or scripts without browser approval, issue a token at ${url}, then set ${TOKEN_ENV_VAR}.`,
2174
2175
  details
2175
2176
  }
2176
2177
  };
@@ -5756,7 +5757,8 @@ npx --yes @artifactshare/cli doctor --json
5756
5757
 
5757
5758
  Authentication:
5758
5759
  Interactive terminal: run ${CLI_INVOCATION} login --profile default, then approve in your browser.
5759
- Agents or CI: issue a token at ${DEFAULT_BASE_URL}/settings/tokens, then set ${TOKEN_ENV_VAR} or pass ${TOKEN_OPTION}.
5760
+ Agent with a user present: run ${CLI_INVOCATION} login --profile <name> --preset agent, then approve one project in your browser.
5761
+ Unattended CI or scripts: issue a token at ${DEFAULT_BASE_URL}/settings/tokens, then set ${TOKEN_ENV_VAR} or pass ${TOKEN_OPTION}.
5760
5762
 
5761
5763
  Common failures:
5762
5764
  auth_required Use ${TOKEN_ENV_VAR} or ${TOKEN_OPTION}; tokens are issued at ${DEFAULT_BASE_URL}/settings/tokens
@@ -5780,7 +5782,8 @@ const loginDefinition = define({
5780
5782
  npx --yes @artifactshare/cli login --profile client-a --preset agent --json
5781
5783
 
5782
5784
  login requires browser approval in an interactive terminal.
5783
- For agents or CI, issue a token at ${DEFAULT_BASE_URL}/settings/tokens, then pass it to normal commands with ${TOKEN_ENV_VAR} or ${TOKEN_OPTION}; do not pass the token to login.
5785
+ For an agent with a user present, use --preset agent and approve one project in the browser.
5786
+ For unattended CI or scripts without browser approval, issue a token at ${DEFAULT_BASE_URL}/settings/tokens, then pass it to normal commands with ${TOKEN_ENV_VAR} or ${TOKEN_OPTION}; do not pass the token to login.
5784
5787
 
5785
5788
  Common failures:
5786
5789
  auth_denied The browser approval was denied
@@ -6474,7 +6477,7 @@ const profilesImportTokenDefinition = define({
6474
6477
  },
6475
6478
  examples: `printf '%s' "$TOKEN" | npx --yes @artifactshare/cli profiles import-token --profile client-a --json
6476
6479
 
6477
- Reads the token from standard input only. Use this in agents or CI after issuing a token at ${DEFAULT_BASE_URL}/settings/tokens.
6480
+ Reads the token from standard input only. Use this in unattended CI or scripts without browser approval after issuing a token at ${DEFAULT_BASE_URL}/settings/tokens.
6478
6481
 
6479
6482
  Common failures:
6480
6483
  validation_failed Pass --profile and pipe a non-empty token on standard input
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artifactshare/cli",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Upload and share HTML, Markdown, folders, and static sites from terminals, AI agents, automation, and CI.",
5
5
  "homepage": "https://artifactshare.com/connect",
6
6
  "repository": {
@@ -65,14 +65,14 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
65
65
 
66
66
  ## Authentication
67
67
 
68
- - In non-interactive environments (agents, CI, scripts), ask the user to issue
69
- an API token at `https://artifactshare.com/settings/tokens`, then use
70
- `ARTIFACTSHARE_TOKEN` or `--token` for normal commands.
71
68
  - `login --profile <name> --preset agent --json` starts device login for a
72
69
  project-scoped agent profile. Omit `--preset` for unrestricted login. It may
73
70
  open the OS browser for approval. Use it when a user is present; the pending
74
71
  event on stderr includes `browser_open`. Do not pass API tokens to `login`.
75
72
  Profiles created by `login` renew expired CLI sessions automatically.
73
+ - In unattended CI or scripts without browser approval, ask the user to issue
74
+ an API token at `https://artifactshare.com/settings/tokens`, then use
75
+ `ARTIFACTSHARE_TOKEN` or `--token` for normal commands.
76
76
  - `logout --profile <name> --json` revokes a device-login refresh credential
77
77
  before removing it locally and leaves profile metadata in `config.json`.
78
78
  If remote revoke fails, the local credential is kept and logout fails.
@@ -49,7 +49,7 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
49
49
  exactly one of `--link-expires-at <RFC3339 UTC>` or `--no-link-expiry`; omit
50
50
  both to use the workspace default on share or preserve the current expiry on
51
51
  edit. Results expose `link_expires_at` as a UTC timestamp or `null`.
52
- - For an agent with a user present, prefer `login --preset agent --profile <name> --json` and let the user select one project during browser approval. In unattended CI or scripts, ask the user to issue an API token at `https://artifactshare.com/settings/tokens`, then run normal commands with `ARTIFACTSHARE_TOKEN` or `--token`; do not pass API tokens to `login`.
52
+ - For an agent with a user present, use `login --preset agent --profile <name> --json` and let the user select one project during browser approval. In unattended CI or scripts without browser approval, ask the user to issue an API token at `https://artifactshare.com/settings/tokens`, then run normal commands with `ARTIFACTSHARE_TOKEN` or `--token`; do not pass API tokens to `login`.
53
53
  - To save that token as a named profile without TTY or browser login, pipe it on standard input: `printf '%s' "$TOKEN" | npx --yes @artifactshare/cli profiles import-token --profile <name> --json`. Imported API-token profiles are not renewed by the CLI. Add `--allow-plaintext-token-store` only on a trusted machine without a native token store.
54
54
  - Use `login --profile <name> --json` when a user is present for browser approval. The pending event on stderr includes `browser_open`. Profiles created by `login` renew expired CLI sessions automatically.
55
55
  - Use `logout --profile <name> --json` to revoke a device-login credential before removing it locally; this keeps profile metadata. API-token profiles are removed locally only and their server token is not revoked.