@jvittechs/jai1-cli 0.1.94 → 0.1.95
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 +37 -8
- 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.95",
|
|
37
37
|
description: "A unified CLI tool for JV-IT TECHS developers to manage Jai1 Framework. Please contact TeamAI for usage instructions.",
|
|
38
38
|
type: "module",
|
|
39
39
|
bin: {
|
|
@@ -5608,7 +5608,12 @@ var ImageService = class {
|
|
|
5608
5608
|
"Content-Type": "application/json",
|
|
5609
5609
|
"JAI1-Access-Key": config.accessKey
|
|
5610
5610
|
},
|
|
5611
|
-
body: JSON.stringify(
|
|
5611
|
+
body: JSON.stringify({
|
|
5612
|
+
prompt: options.prompt,
|
|
5613
|
+
model: options.model,
|
|
5614
|
+
size: options.size || "1024x1024",
|
|
5615
|
+
quality: options.quality || "hd"
|
|
5616
|
+
})
|
|
5612
5617
|
});
|
|
5613
5618
|
if (!response.ok) {
|
|
5614
5619
|
let errorMessage = `HTTP ${response.status}`;
|
|
@@ -5681,26 +5686,50 @@ var ImageService = class {
|
|
|
5681
5686
|
|
|
5682
5687
|
// src/commands/image/gen.ts
|
|
5683
5688
|
import terminalImage from "terminal-image";
|
|
5689
|
+
var SUPPORTED_SIZES = [
|
|
5690
|
+
"1024x1024",
|
|
5691
|
+
// 1:1 (default)
|
|
5692
|
+
"1792x1024",
|
|
5693
|
+
// 16:9 (landscape)
|
|
5694
|
+
"1024x1792",
|
|
5695
|
+
// 9:16 (portrait)
|
|
5696
|
+
"1024x768",
|
|
5697
|
+
// 4:3 (landscape)
|
|
5698
|
+
"768x1024"
|
|
5699
|
+
// 3:4 (portrait)
|
|
5700
|
+
];
|
|
5684
5701
|
function createImageGenCommand() {
|
|
5685
|
-
return new Command16("gen").description("Generate an image from text prompt").argument("<prompt>", "Image description prompt").option("-m, --model <model>", "Model to use", "gemini-3-
|
|
5702
|
+
return new Command16("gen").description("Generate an image from text prompt").argument("<prompt>", "Image description prompt").option("-m, --model <model>", "Model to use", "gemini-3-pro-image-preview").option("-s, --size <size>", `Image size: ${SUPPORTED_SIZES.join(", ")}`, "1024x1024").option("-q, --quality <quality>", "Image quality: standard, hd", "hd").option("--no-display", "Don't display image in terminal").action(async (prompt, options) => {
|
|
5686
5703
|
const configService = new ConfigService();
|
|
5687
5704
|
const config = await configService.load();
|
|
5688
5705
|
if (!config) {
|
|
5689
5706
|
throw new ValidationError('Not initialized. Run "jai1 auth" first.');
|
|
5690
5707
|
}
|
|
5708
|
+
const size = options.size;
|
|
5709
|
+
if (!SUPPORTED_SIZES.includes(size)) {
|
|
5710
|
+
console.error(`
|
|
5711
|
+
\u274C Invalid size: ${size}`);
|
|
5712
|
+
console.error(` Supported sizes: ${SUPPORTED_SIZES.join(", ")}`);
|
|
5713
|
+
console.error("\n Size reference:");
|
|
5714
|
+
console.error(" 1024x1024 - Square (1:1)");
|
|
5715
|
+
console.error(" 1792x1024 - Landscape wide (16:9)");
|
|
5716
|
+
console.error(" 1024x1792 - Portrait tall (9:16)");
|
|
5717
|
+
console.error(" 1024x768 - Landscape (4:3)");
|
|
5718
|
+
console.error(" 768x1024 - Portrait (3:4)");
|
|
5719
|
+
process.exit(1);
|
|
5720
|
+
}
|
|
5691
5721
|
const imageService = new ImageService();
|
|
5692
5722
|
console.log("\u{1F3A8} Generating image...");
|
|
5693
5723
|
console.log(` Prompt: ${prompt}`);
|
|
5694
5724
|
console.log(` Model: ${options.model}`);
|
|
5725
|
+
console.log(` Size: ${size}`);
|
|
5726
|
+
console.log(` Quality: ${options.quality}`);
|
|
5695
5727
|
try {
|
|
5696
5728
|
const result = await imageService.generate(config, {
|
|
5697
5729
|
prompt,
|
|
5698
5730
|
model: options.model,
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
...options.ratio && { aspectRatio: options.ratio },
|
|
5702
|
-
...options.negative && { negativePrompt: options.negative },
|
|
5703
|
-
...options.seed && { seed: parseInt(options.seed) }
|
|
5731
|
+
size,
|
|
5732
|
+
quality: options.quality
|
|
5704
5733
|
});
|
|
5705
5734
|
console.log("\n\u2705 Image generated successfully!");
|
|
5706
5735
|
console.log(` URL: ${result.url}`);
|