@drsamonline/cli 0.12.17 → 0.12.20

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +19 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drsamonline/cli",
3
- "version": "0.12.17",
3
+ "version": "0.12.20",
4
4
  "description": "The `sui` command line.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/cli.js CHANGED
@@ -17,7 +17,7 @@ import { stdin, stdout } from 'node:process';
17
17
  import { dirname, join, resolve } from 'node:path';
18
18
  import { fileURLToPath } from 'node:url';
19
19
  import { createGateway, loadEnvFile } from '@drsamonline/gateway';
20
- import { auditConfig, defaultConfigPath, hashApiKey, normalizeConfig, providerHasCredentials, runAs, sanitizeConfig, suiHome, INVARIANTS } from '@drsamonline/core';
20
+ import { auditConfig, defaultConfigPath, hashApiKey, normalizeConfig, providerHasCredentials, runAs, sanitizeConfig, suiHome, t, availableLocales, INVARIANTS } from '@drsamonline/core';
21
21
  import { runInit } from './onboarding.js';
22
22
  import { detectTools, writeToolConfig } from './tools.js';
23
23
  import { applyImport, diffImport, readMigrationSource, smokeTest } from './migrate.js';
@@ -71,6 +71,21 @@ export async function run(argv = process.argv.slice(2)) {
71
71
  return cmdUp(flags);
72
72
  case 'keys':
73
73
  return cmdKeys(flags, args);
74
+ case 'lang':
75
+ case 'languages': {
76
+ const rows = availableLocales().map((l) => [l.code, l.name, l.dir]);
77
+ if (flags.json) {
78
+ console.log(JSON.stringify(availableLocales(), null, 2));
79
+ return;
80
+ }
81
+ console.log('');
82
+ console.log(table(['code', 'language', 'direction'], rows));
83
+ console.log('');
84
+ console.log(' Set one with SUI_LANG=hi (or "locale": "hi" in the config).');
85
+ console.log(' Anything not listed falls back to English rather than failing.');
86
+ console.log('');
87
+ return;
88
+ }
74
89
  case 'free-budget':
75
90
  return cmdFreeBudget(flags);
76
91
  case 'catalog':
@@ -601,7 +616,7 @@ function createGatewayConfig(path) {
601
616
 
602
617
  function help() {
603
618
  console.log(`
604
- sui ${VERSION} — one endpoint for every LLM
619
+ sui ${VERSION} — ${t('app.tagline')}
605
620
 
606
621
  ${RUN_AS} first run: find keys, find tools, prove the route, start
607
622
  ${RUN_AS} init the same, explicitly --demo --force --port 8787
@@ -617,6 +632,8 @@ sui ${VERSION} — one endpoint for every LLM
617
632
  ${RUN_AS} migrate <file> import from 9router / OmniRoute / HubGate --apply --only a,b
618
633
  ${RUN_AS} catalog [q] the provider catalogue, and what is still unverified
619
634
  ${RUN_AS} free-budget verified free headroom per month, and what is only a claim
635
+ ${RUN_AS} lang the languages this build speaks (SUI_LANG=hi, gu, mr, ta, te)
636
+ (alias: languages)
620
637
  ${RUN_AS} probe [name] liveness, readiness and suitability checks (B2.3)
621
638
  ${RUN_AS} compress <file|-> [--preset lite|standard|aggressive|ultra] [--text "…"]
622
639
  ${RUN_AS} budget which preset the remaining quota would choose