@ai-digital-factory/lmt-cli 0.1.5 → 0.1.6
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 +1 -1
- package/dist/index.js +16 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,7 +93,7 @@ Automated coverage: `pnpm --filter @ai-digital-factory/lmt-cli test` runs `src/p
|
|
|
93
93
|
|
|
94
94
|
Press Enter to submit each prompt. At the Operator password prompt, Escape returns to the username; Ctrl+U clears either field. Passwords remain masked. Press Ctrl+C to exit the terminal; use the logout command or menu action when you want to revoke the Operator Session.
|
|
95
95
|
|
|
96
|
-
Interactive mode defaults to `--env
|
|
96
|
+
Interactive mode defaults to `--env dev --profile default` when these options are omitted. A bare `live-market-terminal` invocation (no subcommand) also starts interactive mode with those defaults. Keep the same environment and profile across commands to reuse a session:
|
|
97
97
|
|
|
98
98
|
```sh
|
|
99
99
|
lmt status --env dev --profile my-dev-session
|
package/dist/index.js
CHANGED
|
@@ -3297,6 +3297,7 @@ function formatCliHelp() {
|
|
|
3297
3297
|
return `Live Market Terminal CLI
|
|
3298
3298
|
|
|
3299
3299
|
Usage (lmt is an alias of live-market-terminal):
|
|
3300
|
+
live-market-terminal [--env local|dev] [--profile NAME]
|
|
3300
3301
|
live-market-terminal interactive [--env local|dev] [--profile NAME]
|
|
3301
3302
|
live-market-terminal interactive credential provision [--env local|dev] [--profile NAME]
|
|
3302
3303
|
live-market-terminal login --env local|dev --profile NAME [--timeout DURATION]
|
|
@@ -3322,7 +3323,7 @@ Usage (lmt is an alias of live-market-terminal):
|
|
|
3322
3323
|
Headless options (--env, --profile, --timeout, --attempt, --otp-stdin, --credential-stdin) may appear before or after the command.
|
|
3323
3324
|
|
|
3324
3325
|
From the monorepo root:
|
|
3325
|
-
pnpm cli [--profile NAME] # interactive; --env defaults to
|
|
3326
|
+
pnpm cli [--profile NAME] # interactive; --env defaults to dev
|
|
3326
3327
|
pnpm cli --env dev --profile my-dev-session
|
|
3327
3328
|
pnpm -s cli:headless status --env local --profile default # build step runs quietly (-s)
|
|
3328
3329
|
|
|
@@ -3365,7 +3366,7 @@ Exit codes (headless):
|
|
|
3365
3366
|
4 validation blocked or Zerodha awaiting OTP
|
|
3366
3367
|
|
|
3367
3368
|
Options:
|
|
3368
|
-
--env local|dev Target environment (interactive default:
|
|
3369
|
+
--env local|dev Target environment (interactive default: dev; headless: required)
|
|
3369
3370
|
--profile NAME Client profile (default: default for interactive)
|
|
3370
3371
|
--timeout DURATION Action deadline, e.g. 45s, 2m, 30000ms (headless)
|
|
3371
3372
|
--ce ROW / --pe ROW Market Watch rows for pair assign (CE leg, PE leg)
|
|
@@ -3389,6 +3390,11 @@ var CliInvocationError = class extends Error {
|
|
|
3389
3390
|
function normalizeArgv(argv) {
|
|
3390
3391
|
return argv[0] === "--" ? argv.slice(1) : argv;
|
|
3391
3392
|
}
|
|
3393
|
+
function resolveCliInvocation(argv) {
|
|
3394
|
+
if (argv.length === 0) return { kind: "interactive", argv: ["interactive"] };
|
|
3395
|
+
if (argv[0] === "interactive") return { kind: "interactive", argv };
|
|
3396
|
+
return { kind: "headless", argv };
|
|
3397
|
+
}
|
|
3392
3398
|
async function bootstrapCli(dependencies = {}) {
|
|
3393
3399
|
if (dependencies.runApplication) {
|
|
3394
3400
|
await dependencies.runApplication();
|
|
@@ -3403,14 +3409,15 @@ async function bootstrapCli(dependencies = {}) {
|
|
|
3403
3409
|
process.stdout.write(formatCliHelp());
|
|
3404
3410
|
return;
|
|
3405
3411
|
}
|
|
3406
|
-
|
|
3407
|
-
|
|
3412
|
+
const invocation = resolveCliInvocation(argv);
|
|
3413
|
+
if (invocation.kind === "headless") {
|
|
3414
|
+
process.exitCode = await runHeadlessCli(invocation.argv);
|
|
3408
3415
|
return;
|
|
3409
3416
|
}
|
|
3410
3417
|
let parsed;
|
|
3411
3418
|
let target;
|
|
3412
3419
|
try {
|
|
3413
|
-
parsed = parseInteractiveArguments(argv);
|
|
3420
|
+
parsed = parseInteractiveArguments(invocation.argv);
|
|
3414
3421
|
target = resolveCliTarget({ LMT_ENV: parsed.environment });
|
|
3415
3422
|
} catch (error) {
|
|
3416
3423
|
throw new CliInvocationError(error instanceof Error ? error.message : "Invalid interactive CLI configuration.");
|
|
@@ -3504,7 +3511,7 @@ function parseInteractiveArguments(argv) {
|
|
|
3504
3511
|
if (flag === "--profile") profile2 = value;
|
|
3505
3512
|
}
|
|
3506
3513
|
assertClientProfileName(profile2);
|
|
3507
|
-
return { environment: values2.has("--env") ? environment2 : "
|
|
3514
|
+
return { environment: values2.has("--env") ? environment2 : "dev", profile: profile2, credentialProvision: true };
|
|
3508
3515
|
}
|
|
3509
3516
|
let environment = "";
|
|
3510
3517
|
let profile = "default";
|
|
@@ -3521,7 +3528,7 @@ function parseInteractiveArguments(argv) {
|
|
|
3521
3528
|
if (flag === "--profile") profile = value;
|
|
3522
3529
|
}
|
|
3523
3530
|
assertClientProfileName(profile);
|
|
3524
|
-
return { environment: values.has("--env") ? environment : "
|
|
3531
|
+
return { environment: values.has("--env") ? environment : "dev", profile, credentialProvision: false };
|
|
3525
3532
|
}
|
|
3526
3533
|
var invokedFile = process.argv[1];
|
|
3527
3534
|
if (invokedFile && path4.resolve(fileURLToPath2(import.meta.url)) === realpathSync(invokedFile)) {
|
|
@@ -3536,5 +3543,6 @@ if (invokedFile && path4.resolve(fileURLToPath2(import.meta.url)) === realpathSy
|
|
|
3536
3543
|
export {
|
|
3537
3544
|
bootstrapCli,
|
|
3538
3545
|
normalizeArgv,
|
|
3539
|
-
parseInteractiveArguments
|
|
3546
|
+
parseInteractiveArguments,
|
|
3547
|
+
resolveCliInvocation
|
|
3540
3548
|
};
|