@jvittechs/jai1-cli 0.1.61 → 0.1.62
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/dist/cli.js +106 -15
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ var NetworkError = class extends Jai1Error {
|
|
|
33
33
|
// package.json
|
|
34
34
|
var package_default = {
|
|
35
35
|
name: "@jvittechs/jai1-cli",
|
|
36
|
-
version: "0.1.
|
|
36
|
+
version: "0.1.62",
|
|
37
37
|
description: "Unified CLI for Jai1 Framework Management and Redmine Context Sync",
|
|
38
38
|
type: "module",
|
|
39
39
|
bin: {
|
|
@@ -5067,7 +5067,14 @@ async function handlePasswordGeneration(options) {
|
|
|
5067
5067
|
}
|
|
5068
5068
|
}
|
|
5069
5069
|
function createPasswordCommand() {
|
|
5070
|
-
const cmd = new Command14("password").description("Generate secure random password").option("-l, --length <number>", "Password length", "16").option("--no-lowercase", "Exclude lowercase letters").option("--no-uppercase", "Exclude uppercase letters").option("--no-digits", "Exclude digits").option("--no-symbols", "Exclude symbols").option("--symbol-chars <chars>", "Custom symbol characters").option("-c, --count <number>", "Number of passwords to generate", "1").
|
|
5070
|
+
const cmd = new Command14("password").description("Generate secure random password").option("-l, --length <number>", "Password length", "16").option("--no-lowercase", "Exclude lowercase letters").option("--no-uppercase", "Exclude uppercase letters").option("--no-digits", "Exclude digits").option("--no-symbols", "Exclude symbols").option("--symbol-chars <chars>", "Custom symbol characters").option("-c, --count <number>", "Number of passwords to generate", "1").addHelpText("after", `
|
|
5071
|
+
Examples:
|
|
5072
|
+
$ jai1 utils password
|
|
5073
|
+
$ jai1 utils password --length 24
|
|
5074
|
+
$ jai1 utils password --no-symbols
|
|
5075
|
+
$ jai1 utils password --count 5
|
|
5076
|
+
$ jai1 utils password -l 32 --no-digits
|
|
5077
|
+
`).action(async (options) => {
|
|
5071
5078
|
await handlePasswordGeneration({
|
|
5072
5079
|
...options,
|
|
5073
5080
|
length: parseInt(options.length, 10),
|
|
@@ -5106,7 +5113,14 @@ async function handleUuidGeneration(options) {
|
|
|
5106
5113
|
}
|
|
5107
5114
|
}
|
|
5108
5115
|
function createUuidCommand() {
|
|
5109
|
-
const cmd = new Command15("uuid").description("Generate UUID v4 identifier").option("-c, --count <number>", "Number of UUIDs to generate", "1").option("--uppercase", "Output in uppercase").option("--no-hyphens", "Remove hyphens from output").
|
|
5116
|
+
const cmd = new Command15("uuid").description("Generate UUID v4 identifier").option("-c, --count <number>", "Number of UUIDs to generate", "1").option("--uppercase", "Output in uppercase").option("--no-hyphens", "Remove hyphens from output").addHelpText("after", `
|
|
5117
|
+
Examples:
|
|
5118
|
+
$ jai1 utils uuid
|
|
5119
|
+
$ jai1 utils uuid --count 10
|
|
5120
|
+
$ jai1 utils uuid --uppercase
|
|
5121
|
+
$ jai1 utils uuid --no-hyphens
|
|
5122
|
+
$ jai1 utils uuid --uppercase --no-hyphens
|
|
5123
|
+
`).action(async (options) => {
|
|
5110
5124
|
await handleUuidGeneration({
|
|
5111
5125
|
...options,
|
|
5112
5126
|
count: parseInt(options.count, 10)
|
|
@@ -5160,7 +5174,15 @@ function createHashCommand() {
|
|
|
5160
5174
|
"-a, --algorithm <algorithm>",
|
|
5161
5175
|
"Hash algorithm (md5, sha1, sha256, sha512, bcrypt)",
|
|
5162
5176
|
"sha256"
|
|
5163
|
-
).option("-f, --file <path>", "Hash file contents instead of text").option("-r, --rounds <number>", "Bcrypt rounds (only for bcrypt)", "10").
|
|
5177
|
+
).option("-f, --file <path>", "Hash file contents instead of text").option("-r, --rounds <number>", "Bcrypt rounds (only for bcrypt)", "10").addHelpText("after", `
|
|
5178
|
+
Examples:
|
|
5179
|
+
$ jai1 utils hash "hello world"
|
|
5180
|
+
$ jai1 utils hash "hello" --algorithm md5
|
|
5181
|
+
$ jai1 utils hash "password" --algorithm bcrypt
|
|
5182
|
+
$ jai1 utils hash "password" --algorithm bcrypt --rounds 12
|
|
5183
|
+
$ jai1 utils hash --file ./myfile.txt
|
|
5184
|
+
$ jai1 utils hash --file ./image.png --algorithm sha512
|
|
5185
|
+
`).action(async (input, options) => {
|
|
5164
5186
|
await handleHashGeneration(input, {
|
|
5165
5187
|
...options,
|
|
5166
5188
|
rounds: parseInt(options.rounds, 10)
|
|
@@ -5203,7 +5225,13 @@ async function handleBase64Encode(input, options) {
|
|
|
5203
5225
|
}
|
|
5204
5226
|
}
|
|
5205
5227
|
function createBase64EncodeCommand() {
|
|
5206
|
-
const cmd = new Command17("base64-encode").description("Encode text or file to Base64").argument("[input]", "Text to encode").option("-f, --file <path>", "Encode file contents").option("--url-safe", "Use URL-safe Base64 encoding").
|
|
5228
|
+
const cmd = new Command17("base64-encode").description("Encode text or file to Base64").argument("[input]", "Text to encode").option("-f, --file <path>", "Encode file contents").option("--url-safe", "Use URL-safe Base64 encoding").addHelpText("after", `
|
|
5229
|
+
Examples:
|
|
5230
|
+
$ jai1 utils base64-encode "hello world"
|
|
5231
|
+
$ jai1 utils base64-encode "hello world" --url-safe
|
|
5232
|
+
$ jai1 utils base64-encode --file ./document.txt
|
|
5233
|
+
$ jai1 utils base64-encode --file ./image.png
|
|
5234
|
+
`).action(async (input, options) => {
|
|
5207
5235
|
await handleBase64Encode(input, options);
|
|
5208
5236
|
});
|
|
5209
5237
|
return cmd;
|
|
@@ -5242,7 +5270,13 @@ async function handleBase64Decode(input, options) {
|
|
|
5242
5270
|
}
|
|
5243
5271
|
}
|
|
5244
5272
|
function createBase64DecodeCommand() {
|
|
5245
|
-
const cmd = new Command18("base64-decode").description("Decode Base64 string").argument("[input]", "Base64 string to decode").option("-f, --file <path>", "Decode from file").option("-o, --output <path>", "Write decoded output to file").
|
|
5273
|
+
const cmd = new Command18("base64-decode").description("Decode Base64 string").argument("[input]", "Base64 string to decode").option("-f, --file <path>", "Decode from file").option("-o, --output <path>", "Write decoded output to file").addHelpText("after", `
|
|
5274
|
+
Examples:
|
|
5275
|
+
$ jai1 utils base64-decode "aGVsbG8gd29ybGQ="
|
|
5276
|
+
$ jai1 utils base64-decode --file ./encoded.txt
|
|
5277
|
+
$ jai1 utils base64-decode "aGVsbG8=" --output ./decoded.txt
|
|
5278
|
+
$ jai1 utils base64-decode --file ./encoded.txt --output ./image.png
|
|
5279
|
+
`).action(async (input, options) => {
|
|
5246
5280
|
await handleBase64Decode(input, options);
|
|
5247
5281
|
});
|
|
5248
5282
|
return cmd;
|
|
@@ -5315,7 +5349,15 @@ async function handleHttpRequest(url, options) {
|
|
|
5315
5349
|
}
|
|
5316
5350
|
}
|
|
5317
5351
|
function createHttpCommand() {
|
|
5318
|
-
const cmd = new Command19("http").description("Make HTTP request with formatted output").argument("<url>", "Target URL").option("-X, --method <method>", "HTTP method", "GET").option("-H, --header <header...>", "Request headers (repeatable)").option("-d, --data <data>", "Request body (JSON string)").option("--file <path>", "Read body from file").option("--timeout <ms>", "Request timeout in milliseconds", "30000").option("--no-follow", "Do not follow redirects").option("--only-headers", "Show only response headers").option("--only-body", "Show only response body").
|
|
5352
|
+
const cmd = new Command19("http").description("Make HTTP request with formatted output").argument("<url>", "Target URL").option("-X, --method <method>", "HTTP method", "GET").option("-H, --header <header...>", "Request headers (repeatable)").option("-d, --data <data>", "Request body (JSON string)").option("--file <path>", "Read body from file").option("--timeout <ms>", "Request timeout in milliseconds", "30000").option("--no-follow", "Do not follow redirects").option("--only-headers", "Show only response headers").option("--only-body", "Show only response body").addHelpText("after", `
|
|
5353
|
+
Examples:
|
|
5354
|
+
$ jai1 utils http https://api.example.com/users
|
|
5355
|
+
$ jai1 utils http https://api.example.com/users -X POST -d '{"name":"John"}'
|
|
5356
|
+
$ jai1 utils http https://api.example.com -H "Authorization: Bearer token123"
|
|
5357
|
+
$ jai1 utils http https://api.example.com -H "Content-Type: application/json" -H "Accept: application/json"
|
|
5358
|
+
$ jai1 utils http https://api.example.com --timeout 5000
|
|
5359
|
+
$ jai1 utils http https://api.example.com --only-body
|
|
5360
|
+
`).showHelpAfterError("(add --help for additional examples)").action(async (url, options) => {
|
|
5319
5361
|
await handleHttpRequest(url, {
|
|
5320
5362
|
...options,
|
|
5321
5363
|
timeout: parseInt(options.timeout, 10)
|
|
@@ -5365,12 +5407,22 @@ async function handleJwtEncode(options) {
|
|
|
5365
5407
|
}
|
|
5366
5408
|
function createJwtCommand() {
|
|
5367
5409
|
const jwtCommand = new Command20("jwt").description("Decode and encode JWT tokens");
|
|
5368
|
-
jwtCommand.command("decode").description("Decode JWT token").argument("<token>", "JWT token to decode").
|
|
5410
|
+
jwtCommand.command("decode").description("Decode JWT token").argument("<token>", "JWT token to decode").addHelpText("after", `
|
|
5411
|
+
Examples:
|
|
5412
|
+
$ jai1 utils jwt decode "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
|
|
5413
|
+
$ jai1 utils jwt decode $JWT_TOKEN
|
|
5414
|
+
`).action(async (token) => {
|
|
5369
5415
|
await handleJwtDecode(token);
|
|
5370
5416
|
});
|
|
5371
|
-
jwtCommand.command("encode").description("Encode JWT token (HS256)").requiredOption("-p, --payload <json>", "Payload as JSON string").requiredOption("-s, --secret <secret>", "Secret key for signing").option("-h, --header <json>", "Custom header as JSON string").
|
|
5417
|
+
const encodeCommand = jwtCommand.command("encode").description("Encode JWT token (HS256)").requiredOption("-p, --payload <json>", "Payload as JSON string").requiredOption("-s, --secret <secret>", "Secret key for signing").option("-h, --header <json>", "Custom header as JSON string").addHelpText("after", `
|
|
5418
|
+
Examples:
|
|
5419
|
+
$ jai1 utils jwt encode --payload '{"sub":"123","name":"John"}' --secret "mysecret"
|
|
5420
|
+
$ jai1 utils jwt encode -p '{"userId":"456"}' -s "key123"
|
|
5421
|
+
$ jai1 utils jwt encode -p '{"sub":"789"}' -s "secret" -h '{"alg":"HS256","typ":"JWT"}'
|
|
5422
|
+
`).action(async (options) => {
|
|
5372
5423
|
await handleJwtEncode(options);
|
|
5373
5424
|
});
|
|
5425
|
+
encodeCommand.showHelpAfterError("(add --help for additional examples)");
|
|
5374
5426
|
return jwtCommand;
|
|
5375
5427
|
}
|
|
5376
5428
|
|
|
@@ -5423,7 +5475,15 @@ async function handleUnixTime(input, options) {
|
|
|
5423
5475
|
}
|
|
5424
5476
|
}
|
|
5425
5477
|
function createUnixTimeCommand() {
|
|
5426
|
-
const cmd = new Command21("unix-time").description("Convert unix timestamps to/from dates").argument("[input]", "Unix timestamp or date string").option("-f, --format <format>", "Output format (iso, local, utc)", "iso").option("--ms", "Use milliseconds instead of seconds").
|
|
5478
|
+
const cmd = new Command21("unix-time").description("Convert unix timestamps to/from dates").argument("[input]", "Unix timestamp or date string").option("-f, --format <format>", "Output format (iso, local, utc)", "iso").option("--ms", "Use milliseconds instead of seconds").addHelpText("after", `
|
|
5479
|
+
Examples:
|
|
5480
|
+
$ jai1 utils unix-time
|
|
5481
|
+
$ jai1 utils unix-time 1702550400
|
|
5482
|
+
$ jai1 utils unix-time 1702550400000 --ms
|
|
5483
|
+
$ jai1 utils unix-time "2024-01-15 10:30:00"
|
|
5484
|
+
$ jai1 utils unix-time "2024-01-15" --format local
|
|
5485
|
+
$ jai1 utils unix-time --ms
|
|
5486
|
+
`).action(async (input, options) => {
|
|
5427
5487
|
await handleUnixTime(input, options);
|
|
5428
5488
|
});
|
|
5429
5489
|
return cmd;
|
|
@@ -5467,7 +5527,13 @@ async function handleTimezoneConversion(time, options) {
|
|
|
5467
5527
|
}
|
|
5468
5528
|
}
|
|
5469
5529
|
function createTimezoneCommand() {
|
|
5470
|
-
const cmd = new Command22("timezone").description("Convert time between timezones").argument("[time]", 'Time to convert (e.g., "2024-01-15 10:00")').option("--from <timezone>", "Source timezone").option("--to <timezone>", "Target timezone").option("--list", "Show available timezones").
|
|
5530
|
+
const cmd = new Command22("timezone").description("Convert time between timezones").argument("[time]", 'Time to convert (e.g., "2024-01-15 10:00")').option("--from <timezone>", "Source timezone").option("--to <timezone>", "Target timezone").option("--list", "Show available timezones").addHelpText("after", `
|
|
5531
|
+
Examples:
|
|
5532
|
+
$ jai1 utils timezone --list
|
|
5533
|
+
$ jai1 utils timezone "2024-01-15 10:00" --from "America/New_York" --to "Asia/Tokyo"
|
|
5534
|
+
$ jai1 utils timezone "2024-01-15 14:30" --from "UTC" --to "America/Los_Angeles"
|
|
5535
|
+
$ jai1 utils timezone "2024-12-25 12:00" --from "Europe/London" --to "Asia/Ho_Chi_Minh"
|
|
5536
|
+
`).action(async (time, options) => {
|
|
5471
5537
|
await handleTimezoneConversion(time, options);
|
|
5472
5538
|
});
|
|
5473
5539
|
return cmd;
|
|
@@ -5495,7 +5561,13 @@ async function handleUrlEncode(input, options) {
|
|
|
5495
5561
|
}
|
|
5496
5562
|
}
|
|
5497
5563
|
function createUrlEncodeCommand() {
|
|
5498
|
-
const cmd = new Command23("url-encode").description("Encode URL component or full URL").argument("<input>", "Text to encode").option("--full", "Encode full URL (use encodeURI instead of encodeURIComponent)").
|
|
5564
|
+
const cmd = new Command23("url-encode").description("Encode URL component or full URL").argument("<input>", "Text to encode").option("--full", "Encode full URL (use encodeURI instead of encodeURIComponent)").addHelpText("after", `
|
|
5565
|
+
Examples:
|
|
5566
|
+
$ jai1 utils url-encode "hello world"
|
|
5567
|
+
$ jai1 utils url-encode "hello world & test"
|
|
5568
|
+
$ jai1 utils url-encode "name=John Doe&age=30"
|
|
5569
|
+
$ jai1 utils url-encode "https://example.com/path with spaces" --full
|
|
5570
|
+
`).showHelpAfterError("(add --help for additional examples)").action(async (input, options) => {
|
|
5499
5571
|
await handleUrlEncode(input, options);
|
|
5500
5572
|
});
|
|
5501
5573
|
return cmd;
|
|
@@ -5523,7 +5595,13 @@ async function handleUrlDecode(input, options) {
|
|
|
5523
5595
|
}
|
|
5524
5596
|
}
|
|
5525
5597
|
function createUrlDecodeCommand() {
|
|
5526
|
-
const cmd = new Command24("url-decode").description("Decode URL-encoded string").argument("<input>", "Text to decode").option("--full", "Decode full URL (use decodeURI instead of decodeURIComponent)").
|
|
5598
|
+
const cmd = new Command24("url-decode").description("Decode URL-encoded string").argument("<input>", "Text to decode").option("--full", "Decode full URL (use decodeURI instead of decodeURIComponent)").addHelpText("after", `
|
|
5599
|
+
Examples:
|
|
5600
|
+
$ jai1 utils url-decode "hello%20world"
|
|
5601
|
+
$ jai1 utils url-decode "hello%20world%20%26%20test"
|
|
5602
|
+
$ jai1 utils url-decode "name%3DJohn%20Doe%26age%3D30"
|
|
5603
|
+
$ jai1 utils url-decode "https://example.com/path%20with%20spaces" --full
|
|
5604
|
+
`).showHelpAfterError("(add --help for additional examples)").action(async (input, options) => {
|
|
5527
5605
|
await handleUrlDecode(input, options);
|
|
5528
5606
|
});
|
|
5529
5607
|
return cmd;
|
|
@@ -5573,7 +5651,14 @@ async function handleCronParse(expression) {
|
|
|
5573
5651
|
}
|
|
5574
5652
|
}
|
|
5575
5653
|
function createCronCommand() {
|
|
5576
|
-
const cmd = new Command25("cron").description("Parse and explain cron expression").argument("<expression>", 'Cron expression (e.g., "0 5 * * *")').
|
|
5654
|
+
const cmd = new Command25("cron").description("Parse and explain cron expression").argument("<expression>", 'Cron expression (e.g., "0 5 * * *")').addHelpText("after", `
|
|
5655
|
+
Examples:
|
|
5656
|
+
$ jai1 utils cron "0 5 * * *"
|
|
5657
|
+
$ jai1 utils cron "*/15 * * * *"
|
|
5658
|
+
$ jai1 utils cron "0 0 1 * *"
|
|
5659
|
+
$ jai1 utils cron "0 9-17 * * 1-5"
|
|
5660
|
+
$ jai1 utils cron "30 2 * * 0"
|
|
5661
|
+
`).showHelpAfterError("(add --help for additional examples)").action(async (expression) => {
|
|
5577
5662
|
await handleCronParse(expression);
|
|
5578
5663
|
});
|
|
5579
5664
|
return cmd;
|
|
@@ -5608,7 +5693,13 @@ async function handleMarkdownPreview(file, options) {
|
|
|
5608
5693
|
}
|
|
5609
5694
|
}
|
|
5610
5695
|
function createMarkdownPreviewCommand() {
|
|
5611
|
-
const cmd = new Command26("markdown-preview").description("Preview markdown file in terminal").argument("<file>", "Markdown file path").option("--raw", "Show raw markdown instead of rendered").
|
|
5696
|
+
const cmd = new Command26("markdown-preview").description("Preview markdown file in terminal").argument("<file>", "Markdown file path").option("--raw", "Show raw markdown instead of rendered").addHelpText("after", `
|
|
5697
|
+
Examples:
|
|
5698
|
+
$ jai1 utils markdown-preview README.md
|
|
5699
|
+
$ jai1 utils markdown-preview ./docs/guide.md
|
|
5700
|
+
$ jai1 utils markdown-preview CHANGELOG.md --raw
|
|
5701
|
+
$ jai1 utils markdown-preview ./notes.md
|
|
5702
|
+
`).showHelpAfterError("(add --help for additional examples)").action(async (file, options) => {
|
|
5612
5703
|
await handleMarkdownPreview(file, options);
|
|
5613
5704
|
});
|
|
5614
5705
|
return cmd;
|