overlord-cli 0.2605231102.0 → 0.2605240843.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/README.md CHANGED
@@ -83,7 +83,7 @@ ovld doctor
83
83
 
84
84
  **Antigravity:** Gemini CLI is deprecated. Use `ovld setup antigravity` and `ovld launch antigravity --ticket-id <ticket_id>`. Antigravity manages model selection internally.
85
85
 
86
- For ticket-scoped protocol and launch commands, `ticket_id` values such as `1:899` carry the organization id. The CLI uses that first, then `--organization-id` for UUID compatibility, then stored auth.
86
+ For ticket-scoped protocol and launch commands, `ticket_id` values such as `1:899` carry the organization id. The CLI uses that first, then `--organization-id` for UUID compatibility, then stored auth. `ovld auth login` stores the first available organization as a default when an account belongs to multiple organizations; pass `--organization-id <id>` only when you want a different default.
87
87
 
88
88
  ## Requirements
89
89
 
package/bin/_cli/auth.mjs CHANGED
@@ -456,7 +456,7 @@ async function fetchOrganizations(platformUrl, accessToken, localSecret) {
456
456
  return Array.isArray(data.organizations) ? data.organizations : [];
457
457
  }
458
458
 
459
- async function promptForOrganization(organizations, preselectedId = null) {
459
+ export function selectLoginOrganization(organizations, preselectedId = null) {
460
460
  if (!organizations.length) {
461
461
  throw new Error('No organizations found. Please complete onboarding first.');
462
462
  }
@@ -472,42 +472,13 @@ async function promptForOrganization(organizations, preselectedId = null) {
472
472
  return match;
473
473
  }
474
474
 
475
- if (organizations.length === 1) {
476
- return organizations[0];
477
- }
478
-
479
- if (!process.stdin.isTTY) {
480
- throw new Error(
481
- 'Multiple organizations available but stdin is not a TTY. ' +
482
- 'Pass --organization-id <id> to select non-interactively.'
483
- );
484
- }
485
-
486
- const rl = (await import('node:readline')).createInterface({
487
- input: process.stdin,
488
- output: process.stdout
489
- });
490
-
491
- try {
492
- for (;;) {
493
- console.log('\nOrganizations');
494
- organizations.forEach((organization, index) => {
495
- console.log(` ${index + 1}. ${organization.name} (${organization.id})`);
496
- });
497
-
498
- const answer = await new Promise(resolve => {
499
- rl.question('\nSelect an organization by number: ', resolve);
500
- });
501
- const selected = Number.parseInt(String(answer).trim(), 10);
502
- if (Number.isFinite(selected) && selected >= 1 && selected <= organizations.length) {
503
- return organizations[selected - 1];
504
- }
475
+ return organizations[0];
476
+ }
505
477
 
506
- console.log(`Enter a number between 1 and ${organizations.length}.`);
507
- }
508
- } finally {
509
- rl.close();
510
- }
478
+ function describeOrganization(organization) {
479
+ const name = String(organization?.name ?? '').trim();
480
+ const id = organization?.id;
481
+ return name ? `${name} (${id})` : `organization ${id}`;
511
482
  }
512
483
 
513
484
  // ---------------------------------------------------------------------------
@@ -567,7 +538,7 @@ export async function authLogin(args = []) {
567
538
  credentials.access_token,
568
539
  localSecret
569
540
  );
570
- const selectedOrganization = await promptForOrganization(organizations, preselectedOrganizationId);
541
+ const selectedOrganization = selectLoginOrganization(organizations, preselectedOrganizationId);
571
542
 
572
543
  saveCredentials({
573
544
  access_token: credentials.access_token,
@@ -577,7 +548,14 @@ export async function authLogin(args = []) {
577
548
  platform_url: resolvedPlatformUrl
578
549
  });
579
550
 
580
- console.log('Logged in successfully!');
551
+ if (organizations.length > 1 && preselectedOrganizationId === null) {
552
+ console.log(
553
+ `Logged in successfully. Default organization: ${describeOrganization(selectedOrganization)}. ` +
554
+ 'Ticket-scoped commands override this from the ticket id; use --organization-id to set a different default.'
555
+ );
556
+ } else {
557
+ console.log(`Logged in successfully. Default organization: ${describeOrganization(selectedOrganization)}.`);
558
+ }
581
559
  }
582
560
 
583
561
  async function printVerboseAuthStatus() {
@@ -660,9 +638,9 @@ export async function runAuthCommand(subcommand, args = []) {
660
638
 
661
639
  Subcommands:
662
640
  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)
641
+ --organization-id <id> Optional default organization override
642
+ (ticket-scoped commands infer organization
643
+ from ticket ids such as 1:899)
666
644
  status Show current login status (use --verbose for redacted diagnostics)
667
645
  repair Mirror and chmod shared Desktop/CLI credentials when possible
668
646
  logout Remove stored credentials
@@ -1670,7 +1670,8 @@ async function protocolGetDevice(args) {
1670
1670
  const body = {
1671
1671
  deviceFingerprint,
1672
1672
  ...(flags['device-hostname'] ? { deviceHostname: String(flags['device-hostname']) } : {}),
1673
- ...(flags['device-platform'] ? { devicePlatform: String(flags['device-platform']) } : {})
1673
+ ...(flags['device-platform'] ? { devicePlatform: String(flags['device-platform']) } : {}),
1674
+ ...(flags['device-port'] != null ? { devicePort: Number(flags['device-port']) } : {})
1674
1675
  };
1675
1676
 
1676
1677
  const data = await apiPost(
@@ -1803,7 +1804,8 @@ async function protocolAddProjectResource(args) {
1803
1804
  ...(typeof flags.label === 'string' ? { label: flags.label } : {}),
1804
1805
  ...(flags['is-primary'] === true || flags['is-primary'] === 'true' ? { isPrimary: true } : {}),
1805
1806
  ...(flags['device-hostname'] ? { deviceHostname: String(flags['device-hostname']) } : {}),
1806
- ...(flags['device-platform'] ? { devicePlatform: String(flags['device-platform']) } : {})
1807
+ ...(flags['device-platform'] ? { devicePlatform: String(flags['device-platform']) } : {}),
1808
+ ...(flags['device-port'] != null ? { devicePort: Number(flags['device-port']) } : {})
1807
1809
  };
1808
1810
 
1809
1811
  const data = await apiPost(
@@ -2970,6 +2972,7 @@ get-device:
2970
2972
  Optional:
2971
2973
  --device-hostname <name>
2972
2974
  --device-platform <platform> (darwin|linux|windows)
2975
+ --device-port <port> SSH port for placeholder reconciliation
2973
2976
 
2974
2977
  update-device:
2975
2978
  Required:
@@ -2992,6 +2995,7 @@ add-project-resource:
2992
2995
  --is-primary Mark as primary directory for this device+project
2993
2996
  --device-hostname <name>
2994
2997
  --device-platform <platform>
2998
+ --device-port <port> SSH port for placeholder reconciliation
2995
2999
 
2996
3000
  update-project-resource:
2997
3001
  Required:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overlord-cli",
3
- "version": "0.2605231102.0",
3
+ "version": "0.2605240843.0",
4
4
  "description": "Overlord CLI — launch AI agents on tickets from anywhere",
5
5
  "homepage": "https://www.ovld.ai/docs/",
6
6
  "type": "module",
@@ -260,8 +260,8 @@ This keeps the ticket feed readable while preserving the full document in versio
260
260
  - When a summary or question contains backticks, `$vars`, or other shell-special characters, always use `--summary-file -` (or `--question-file -`) with a single-quoted heredoc (`<<'EOF'`). Never retry by stripping or escaping content — pipe stdin instead.
261
261
  - Use `write-context` for facts a future agent session should know.
262
262
  - 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.
263
- - 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.
263
+ - If you must run `ovld auth login`, `--organization-id <id>` is optional — use it only when you want to set a different default organization than the CLI would choose automatically.
264
264
  - Do not add or commit changes unless the user explicitly asks you to commit.
265
265
  - Delivery is the concluding step. After delivering, stop unless the user follows up or the ticket is reopened.
266
266
 
267
- <!-- version: 0.1.1 -->
267
+ <!-- version: 0.1.2 -->
@@ -97,7 +97,7 @@ For the `record-change-rationales` command and full payload shape with optional
97
97
  - When a summary or question contains backticks, `$vars`, or other shell-special characters, always use `--summary-file -` (or `--question-file -`) with a single-quoted heredoc (`<<'EOF'`). Never retry by stripping or escaping content — pipe stdin instead. See [reference/shell-escaping.md](reference/shell-escaping.md).
98
98
  - Use `write-context` for facts a future agent session should know.
99
99
  - 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.
100
- - 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.
100
+ - If you must run `ovld auth login`, `--organization-id <id>` is optional — use it only when you want to set a different default organization than the CLI would choose automatically.
101
101
  - Do not add or commit changes unless the user explicitly asks you to commit.
102
102
  - Delivery is the concluding step. After delivering, stop unless the user follows up or the ticket is reopened.
103
103
 
@@ -109,5 +109,5 @@ For the `record-change-rationales` command and full payload shape with optional
109
109
  - [reference/context.md](reference/context.md) — Shared state, attachments, and large artifact policy
110
110
  - [reference/shell-escaping.md](reference/shell-escaping.md) — Heredoc stdin piping for special characters in summaries and payloads
111
111
 
112
- <!-- version: 0.5.5 -->
112
+ <!-- version: 0.5.6 -->
113
113
 
@@ -97,7 +97,7 @@ For the `record-change-rationales` command and full payload shape with optional
97
97
  - When a summary or question contains backticks, `$vars`, or other shell-special characters, always use `--summary-file -` (or `--question-file -`) with a single-quoted heredoc (`<<'EOF'`). Never retry by stripping or escaping content — pipe stdin instead. See [reference/shell-escaping.md](reference/shell-escaping.md).
98
98
  - Use `write-context` for facts a future agent session should know.
99
99
  - 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.
100
- - 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.
100
+ - If you must run `ovld auth login`, `--organization-id <id>` is optional — use it only when you want to set a different default organization than the CLI would choose automatically.
101
101
  - Do not add or commit changes unless the user explicitly asks you to commit.
102
102
  - Delivery is the concluding step. After delivering, stop unless the user follows up or the ticket is reopened.
103
103
 
@@ -109,5 +109,5 @@ For the `record-change-rationales` command and full payload shape with optional
109
109
  - [reference/context.md](reference/context.md) — Shared state, attachments, and large artifact policy
110
110
  - [reference/shell-escaping.md](reference/shell-escaping.md) — Heredoc stdin piping for special characters in summaries and payloads
111
111
 
112
- <!-- version: 0.5.5 -->
112
+ <!-- version: 0.5.6 -->
113
113
 
@@ -97,7 +97,7 @@ For the `record-change-rationales` command and full payload shape with optional
97
97
  - When a summary or question contains backticks, `$vars`, or other shell-special characters, always use `--summary-file -` (or `--question-file -`) with a single-quoted heredoc (`<<'EOF'`). Never retry by stripping or escaping content — pipe stdin instead. See [reference/shell-escaping.md](reference/shell-escaping.md).
98
98
  - Use `write-context` for facts a future agent session should know.
99
99
  - 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.
100
- - 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.
100
+ - If you must run `ovld auth login`, `--organization-id <id>` is optional — use it only when you want to set a different default organization than the CLI would choose automatically.
101
101
  - Do not add or commit changes unless the user explicitly asks you to commit.
102
102
  - Do not create or rely on a local Codex `AGENTS.md` bundle for Overlord.
103
103
  - Delivery is the concluding step. After delivering, stop unless the user follows up or the ticket is reopened.
@@ -110,5 +110,5 @@ For the `record-change-rationales` command and full payload shape with optional
110
110
  - [reference/context.md](reference/context.md) — Shared state, attachments, and large artifact policy
111
111
  - [reference/shell-escaping.md](reference/shell-escaping.md) — Heredoc stdin piping for special characters in summaries and payloads
112
112
 
113
- <!-- version: 0.5.5 -->
113
+ <!-- version: 0.5.6 -->
114
114