overlord-cli 5.5.0 → 5.7.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/bin/_cli/auth.mjs CHANGED
@@ -660,6 +660,9 @@ export async function runAuthCommand(subcommand, args = []) {
660
660
 
661
661
  Subcommands:
662
662
  login Authorize the CLI via browser (works locally or over SSH)
663
+ --organization-id <id> Pre-select organization non-interactively
664
+ (required when stdin is not a TTY and
665
+ multiple organizations are available)
663
666
  status Show current login status (use --verbose for redacted diagnostics)
664
667
  repair Mirror and chmod shared Desktop/CLI credentials when possible
665
668
  logout Remove stored credentials
@@ -553,13 +553,16 @@ export async function resolveAuth() {
553
553
  'OVERLORD_ACCESS_TOKEN requires OVERLORD_ORGANIZATION_ID so protocol requests stay scoped.'
554
554
  );
555
555
  }
556
- return {
557
- platformUrl,
558
- bearerToken: envAccessToken,
559
- localSecret,
560
- organizationId: envOrganizationId,
561
- authMode: 'oauth_env'
562
- };
556
+
557
+ if (isEnvAccessTokenUsable(envAccessToken)) {
558
+ return {
559
+ platformUrl,
560
+ bearerToken: envAccessToken,
561
+ localSecret,
562
+ organizationId: envOrganizationId,
563
+ authMode: 'oauth_env'
564
+ };
565
+ }
563
566
  }
564
567
 
565
568
  if (!creds) {
@@ -636,8 +639,9 @@ export async function getAuthStatus() {
636
639
  };
637
640
  }
638
641
 
642
+ const envAccessToken = normalizeAccessToken(process.env.OVERLORD_ACCESS_TOKEN);
639
643
  let tokenSource = 'fallback';
640
- if (normalizeAccessToken(process.env.OVERLORD_ACCESS_TOKEN)) {
644
+ if (envAccessToken && isEnvAccessTokenUsable(envAccessToken)) {
641
645
  tokenSource = 'OVERLORD_ACCESS_TOKEN';
642
646
  } else if (creds?.refresh_token) {
643
647
  tokenSource = getCredentialFileSource();
@@ -690,6 +694,11 @@ function normalizeAccessToken(value) {
690
694
  return value.trim();
691
695
  }
692
696
 
697
+ function isEnvAccessTokenUsable(accessToken) {
698
+ const expiresAt = decodeJwtExpiry(accessToken);
699
+ return expiresAt === null || expiresAt * 1000 - Date.now() > 60_000;
700
+ }
701
+
693
702
  function normalizePlatformUrl(value) {
694
703
  if (typeof value !== 'string') return undefined;
695
704
  const trimmed = value.trim();
@@ -163,8 +163,9 @@ async function apiPost(
163
163
  throw new Error(
164
164
  `Authentication failed (401): ${data.error ?? 'Invalid or missing token.'}\n` +
165
165
  `IMPORTANT: Stop all work immediately. Your Overlord auth session is invalid, expired, or missing required scope.\n` +
166
- `The user should try \`ovld auth repair\` first, then sign in again with Overlord Desktop or \`ovld auth login\` if needed.\n` +
167
- `Ask the user if they would like to proceed without submitting updates to Overlord.`
166
+ `First run \`ovld auth repair\` yourself.\n` +
167
+ `If repair does not fix it, ask the user to sign in again with Overlord Desktop or \`ovld auth login\` if needed.\n` +
168
+ `Then ask whether they would like to proceed without submitting updates to Overlord.`
168
169
  );
169
170
  }
170
171
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overlord-cli",
3
- "version": "5.5.0",
3
+ "version": "5.7.0",
4
4
  "description": "Overlord CLI — launch AI agents on tickets from anywhere",
5
5
  "type": "module",
6
6
  "bin": {
@@ -153,7 +153,9 @@ ovld protocol artifact-download-url --session-key <sessionKey> --ticket-id $TICK
153
153
  - The `summary` in deliver is what the PM reads first, so write it as a narrative, not a command list.
154
154
  - Use `write-context` for facts a future agent session should know.
155
155
  - If `ovld` reports `OVERLORD_URL` is unreachable, request permission escalation or network access before retrying.
156
+ - If a protocol or MCP call fails with auth/session errors, run `ovld auth repair` yourself before asking the user to log in again or proceed without Overlord updates.
157
+ - If you must run `ovld auth login`, always include `--organization-id <id>` — use the organization ID from the ticket prompt context to select the organization non-interactively and avoid a blocking TTY prompt.
156
158
  - Do not add or commit changes unless the user explicitly asks you to commit.
157
159
  - Delivery is the concluding step. After delivering, stop unless the user follows up or the ticket is reopened.
158
160
 
159
- <!-- version: 0.2.3 -->
161
+ <!-- version: 0.2.5 -->
@@ -42,7 +42,8 @@ When in doubt, ask yourself: *can this be done entirely inside a terminal or bro
42
42
  - Use `ovld protocol` commands, the plugin commands, and the MCP tool instead of ad hoc scripts.
43
43
  - Do not invent protocol subcommands. Use `ovld protocol help` when unsure.
44
44
  - If `ovld` reports `OVERLORD_URL` is unreachable, request permission escalation or network access before retrying.
45
+ - If a protocol or MCP call fails with auth/session errors, run `ovld auth repair` yourself before asking the user to log in again or proceed without Overlord updates.
45
46
  - Include at least one progress update before delivering.
46
47
  - When creating follow-up tickets, always set `--execution-target` explicitly using the `agent`/`human` rule above.
47
48
 
48
- <!-- version: 0.2.3 -->
49
+ <!-- version: 0.2.4 -->
@@ -138,5 +138,6 @@ When in doubt, ask yourself: *can this be done entirely inside a terminal or bro
138
138
  - Do not create or rely on a local Codex `AGENTS.md` bundle for Overlord.
139
139
  - If `ovld` reports `OVERLORD_URL` is unreachable, request permission escalation or network access before retrying.
140
140
  - When the ticket was launched by Overlord, the ticket prompt remains authoritative for the specific task objective and ticket-level constraints.
141
+ - If a protocol or MCP call fails with auth/session errors, run `ovld auth repair` yourself before asking the user to log in again or proceed without Overlord updates.
141
142
 
142
- <!-- version: 0.2.3 -->
143
+ <!-- version: 0.2.4 -->