gobananas-cli 1.0.1
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/bin/gobananas-mcp.js +10 -0
- package/bin/gobananas.js +8 -0
- package/dist/commands/account.d.ts +8 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +200 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/character.d.ts +8 -0
- package/dist/commands/character.d.ts.map +1 -0
- package/dist/commands/character.js +493 -0
- package/dist/commands/character.js.map +1 -0
- package/dist/commands/config.d.ts +8 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +232 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/edit.d.ts +19 -0
- package/dist/commands/edit.d.ts.map +1 -0
- package/dist/commands/edit.js +279 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/generate.d.ts +8 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +177 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/image.d.ts +8 -0
- package/dist/commands/image.d.ts.map +1 -0
- package/dist/commands/image.js +212 -0
- package/dist/commands/image.js.map +1 -0
- package/dist/commands/index.d.ts +19 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +19 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/mcp-help.d.ts +8 -0
- package/dist/commands/mcp-help.d.ts.map +1 -0
- package/dist/commands/mcp-help.js +264 -0
- package/dist/commands/mcp-help.js.map +1 -0
- package/dist/commands/mcp.d.ts +9 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +25 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/product.d.ts +8 -0
- package/dist/commands/product.d.ts.map +1 -0
- package/dist/commands/product.js +316 -0
- package/dist/commands/product.js.map +1 -0
- package/dist/commands/scene.d.ts +8 -0
- package/dist/commands/scene.d.ts.map +1 -0
- package/dist/commands/scene.js +448 -0
- package/dist/commands/scene.js.map +1 -0
- package/dist/commands/search.d.ts +8 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +123 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/session.d.ts +8 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +167 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/style.d.ts +8 -0
- package/dist/commands/style.d.ts.map +1 -0
- package/dist/commands/style.js +297 -0
- package/dist/commands/style.js.map +1 -0
- package/dist/commands/usage.d.ts +8 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +144 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/config/config.d.ts +65 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +156 -0
- package/dist/config/config.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +130 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/stdio-proxy.d.ts +8 -0
- package/dist/mcp/stdio-proxy.d.ts.map +1 -0
- package/dist/mcp/stdio-proxy.js +297 -0
- package/dist/mcp/stdio-proxy.js.map +1 -0
- package/dist/mcp-stdio.d.ts +3 -0
- package/dist/mcp-stdio.d.ts.map +1 -0
- package/dist/mcp-stdio.js +8 -0
- package/dist/mcp-stdio.js.map +1 -0
- package/dist/transport/index.d.ts +29 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/dist/transport/index.js +72 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/transport/mcp-client.d.ts +342 -0
- package/dist/transport/mcp-client.d.ts.map +1 -0
- package/dist/transport/mcp-client.js +478 -0
- package/dist/transport/mcp-client.js.map +1 -0
- package/dist/transport/rest-client.d.ts +297 -0
- package/dist/transport/rest-client.d.ts.map +1 -0
- package/dist/transport/rest-client.js +461 -0
- package/dist/transport/rest-client.js.map +1 -0
- package/dist/types/responses.d.ts +230 -0
- package/dist/types/responses.d.ts.map +1 -0
- package/dist/types/responses.js +46 -0
- package/dist/types/responses.js.map +1 -0
- package/dist/utils/file-handler.d.ts +51 -0
- package/dist/utils/file-handler.d.ts.map +1 -0
- package/dist/utils/file-handler.js +189 -0
- package/dist/utils/file-handler.js.map +1 -0
- package/dist/utils/output.d.ts +111 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +240 -0
- package/dist/utils/output.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config Commands
|
|
3
|
+
*
|
|
4
|
+
* Commands for managing CLI configuration.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import { getConfig, setConfig, hasApiKey, getConfigPath, clearConfig, } from '../config/config.js';
|
|
8
|
+
import { RestClient } from '../transport/rest-client.js';
|
|
9
|
+
import * as output from '../utils/output.js';
|
|
10
|
+
export function createConfigCommand() {
|
|
11
|
+
const cmd = new Command('config')
|
|
12
|
+
.alias('cfg')
|
|
13
|
+
.description('Manage CLI configuration');
|
|
14
|
+
// Generic setter (matches README usage: `gb config set apiKey ...`)
|
|
15
|
+
cmd
|
|
16
|
+
.command('set <key> <value>')
|
|
17
|
+
.description('Set a configuration value (apiKey, serverUrl, transport, outputDir, defaultAspectRatio)')
|
|
18
|
+
.action(async (key, value) => {
|
|
19
|
+
const normalized = key.trim();
|
|
20
|
+
if (normalized === 'apiKey' || normalized === 'api-key' || normalized === 'key') {
|
|
21
|
+
// Delegate to the canonical handler (includes connection test)
|
|
22
|
+
await setApiKey(value);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (normalized === 'serverUrl' || normalized === 'server-url' || normalized === 'server') {
|
|
26
|
+
setServerUrl(value);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (normalized === 'transport') {
|
|
30
|
+
setTransport(value);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (normalized === 'outputDir' || normalized === 'output-dir' || normalized === 'dir') {
|
|
34
|
+
setOutputDir(value);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (normalized === 'defaultAspectRatio' || normalized === 'aspect' || normalized === 'ratio') {
|
|
38
|
+
setAspectRatio(value);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
output.error(`Unknown config key: ${key}`);
|
|
42
|
+
output.info('Valid keys: apiKey, serverUrl, transport, outputDir, defaultAspectRatio');
|
|
43
|
+
process.exit(1);
|
|
44
|
+
});
|
|
45
|
+
// Show current config
|
|
46
|
+
cmd
|
|
47
|
+
.command('show')
|
|
48
|
+
.alias('get')
|
|
49
|
+
.description('Show current configuration')
|
|
50
|
+
.option('--path', 'Show config file path only')
|
|
51
|
+
.action((options) => {
|
|
52
|
+
if (options.path) {
|
|
53
|
+
console.log(getConfigPath());
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const config = getConfig();
|
|
57
|
+
output.header('Go Bananas CLI Configuration');
|
|
58
|
+
output.keyValue('Config File', getConfigPath());
|
|
59
|
+
output.newline();
|
|
60
|
+
output.keyValue('Server URL', config.serverUrl);
|
|
61
|
+
output.keyValue('API Key', config.apiKey ? maskApiKey(config.apiKey) : '(not set)');
|
|
62
|
+
output.keyValue('Transport', config.transport);
|
|
63
|
+
output.keyValue('Output Dir', config.outputDir);
|
|
64
|
+
output.keyValue('Default Aspect', config.defaultAspectRatio);
|
|
65
|
+
output.keyValue('Session ID', config.sessionId || '(none)');
|
|
66
|
+
});
|
|
67
|
+
// Set server URL
|
|
68
|
+
cmd
|
|
69
|
+
.command('server <url>')
|
|
70
|
+
.description('Set the Go Bananas server URL')
|
|
71
|
+
.action((url) => {
|
|
72
|
+
setServerUrl(url);
|
|
73
|
+
});
|
|
74
|
+
// Set API key
|
|
75
|
+
cmd
|
|
76
|
+
.command('key <apiKey>')
|
|
77
|
+
.alias('api-key')
|
|
78
|
+
.description('Set your Go Bananas API key')
|
|
79
|
+
.action(async (apiKey) => {
|
|
80
|
+
await setApiKey(apiKey);
|
|
81
|
+
});
|
|
82
|
+
// Set transport mode
|
|
83
|
+
cmd
|
|
84
|
+
.command('transport <mode>')
|
|
85
|
+
.description('Set transport mode: auto, mcp, or rest')
|
|
86
|
+
.action((mode) => {
|
|
87
|
+
setTransport(mode);
|
|
88
|
+
});
|
|
89
|
+
// Set output directory
|
|
90
|
+
cmd
|
|
91
|
+
.command('output-dir <path>')
|
|
92
|
+
.alias('dir')
|
|
93
|
+
.description('Set default output directory for downloaded images')
|
|
94
|
+
.action((path) => {
|
|
95
|
+
setOutputDir(path);
|
|
96
|
+
});
|
|
97
|
+
// Set default aspect ratio
|
|
98
|
+
cmd
|
|
99
|
+
.command('aspect <ratio>')
|
|
100
|
+
.description('Set default aspect ratio')
|
|
101
|
+
.action((ratio) => {
|
|
102
|
+
setAspectRatio(ratio);
|
|
103
|
+
});
|
|
104
|
+
// Quick setup
|
|
105
|
+
cmd
|
|
106
|
+
.command('setup')
|
|
107
|
+
.description('Interactive configuration setup')
|
|
108
|
+
.action(async () => {
|
|
109
|
+
output.header('Go Bananas CLI Setup');
|
|
110
|
+
output.info('Configure your CLI settings\n');
|
|
111
|
+
// For now, just show instructions since we don't have readline
|
|
112
|
+
const config = getConfig();
|
|
113
|
+
output.info('Current settings:');
|
|
114
|
+
output.keyValue(' Server URL', config.serverUrl);
|
|
115
|
+
output.keyValue(' API Key', config.apiKey ? 'Set' : 'Not set');
|
|
116
|
+
output.keyValue(' Transport', config.transport);
|
|
117
|
+
output.newline();
|
|
118
|
+
output.info('To configure, use these commands:');
|
|
119
|
+
console.log(' gb config server <url> - Set server URL');
|
|
120
|
+
console.log(' gb config key <api-key> - Set API key');
|
|
121
|
+
console.log(' gb config transport <mode> - Set transport (auto/mcp/rest)');
|
|
122
|
+
console.log(' gb config output-dir <dir> - Set download directory');
|
|
123
|
+
output.newline();
|
|
124
|
+
if (!hasApiKey()) {
|
|
125
|
+
output.warn('API key not set. You must set an API key to use Go Bananas.');
|
|
126
|
+
output.tip('Get your API key from your Go Bananas console.');
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
// Reset config
|
|
130
|
+
cmd
|
|
131
|
+
.command('reset')
|
|
132
|
+
.description('Reset all configuration to defaults')
|
|
133
|
+
.option('--force', 'Skip confirmation')
|
|
134
|
+
.action((options) => {
|
|
135
|
+
if (!options.force) {
|
|
136
|
+
output.warn('This will clear all configuration including your API key.');
|
|
137
|
+
output.info('Use --force to confirm.');
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
clearConfig();
|
|
141
|
+
output.success('Configuration reset to defaults.');
|
|
142
|
+
});
|
|
143
|
+
// Test connection
|
|
144
|
+
cmd
|
|
145
|
+
.command('test')
|
|
146
|
+
.description('Test connection to Go Bananas server')
|
|
147
|
+
.action(async () => {
|
|
148
|
+
if (!hasApiKey()) {
|
|
149
|
+
output.error('API key not set. Use "gb config key <api-key>" first.');
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
const config = getConfig();
|
|
153
|
+
const spin = output.spinner(`Testing connection to ${config.serverUrl}...`);
|
|
154
|
+
const client = new RestClient();
|
|
155
|
+
const canConnect = await client.testConnection();
|
|
156
|
+
spin.stop();
|
|
157
|
+
if (canConnect) {
|
|
158
|
+
output.success('Connection successful!');
|
|
159
|
+
output.keyValue('Server', config.serverUrl);
|
|
160
|
+
output.keyValue('Transport', config.transport);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
output.error('Connection failed. Check your server URL and API key.');
|
|
164
|
+
process.exit(1);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
return cmd;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Mask API key for display
|
|
171
|
+
*/
|
|
172
|
+
function maskApiKey(key) {
|
|
173
|
+
if (key.length <= 12)
|
|
174
|
+
return '***';
|
|
175
|
+
return key.substring(0, 8) + '...' + key.substring(key.length - 4);
|
|
176
|
+
}
|
|
177
|
+
function setServerUrl(url) {
|
|
178
|
+
// Validate URL format
|
|
179
|
+
try {
|
|
180
|
+
new URL(url);
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
output.error('Invalid URL format');
|
|
184
|
+
process.exit(1);
|
|
185
|
+
}
|
|
186
|
+
// Remove trailing slash
|
|
187
|
+
const cleanUrl = url.replace(/\/+$/, '');
|
|
188
|
+
setConfig('serverUrl', cleanUrl);
|
|
189
|
+
output.success(`Server URL set to: ${cleanUrl}`);
|
|
190
|
+
}
|
|
191
|
+
async function setApiKey(apiKey) {
|
|
192
|
+
// Validate API key format
|
|
193
|
+
if (!apiKey.startsWith('sk_live_') && !apiKey.startsWith('sk_test_')) {
|
|
194
|
+
output.warn('API key should start with sk_live_ or sk_test_');
|
|
195
|
+
}
|
|
196
|
+
setConfig('apiKey', apiKey);
|
|
197
|
+
output.success('API key saved!');
|
|
198
|
+
// Test connection
|
|
199
|
+
output.newline();
|
|
200
|
+
const spin = output.spinner('Testing connection...');
|
|
201
|
+
const client = new RestClient();
|
|
202
|
+
const canConnect = await client.testConnection();
|
|
203
|
+
spin.stop();
|
|
204
|
+
if (canConnect) {
|
|
205
|
+
output.success('Connection successful!');
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
output.warn('Could not verify connection. Check your server URL and API key.');
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function setTransport(mode) {
|
|
212
|
+
const validModes = ['auto', 'mcp', 'rest'];
|
|
213
|
+
if (!validModes.includes(mode)) {
|
|
214
|
+
output.error(`Invalid transport mode. Must be one of: ${validModes.join(', ')}`);
|
|
215
|
+
process.exit(1);
|
|
216
|
+
}
|
|
217
|
+
setConfig('transport', mode);
|
|
218
|
+
output.success(`Transport mode set to: ${mode}`);
|
|
219
|
+
}
|
|
220
|
+
function setOutputDir(path) {
|
|
221
|
+
setConfig('outputDir', path);
|
|
222
|
+
output.success(`Output directory set to: ${path}`);
|
|
223
|
+
}
|
|
224
|
+
function setAspectRatio(ratio) {
|
|
225
|
+
const validRatios = ['square', 'portrait', 'landscape', '16:9', '9:16', '4:3', '3:4', '1:1'];
|
|
226
|
+
if (!validRatios.includes(ratio)) {
|
|
227
|
+
output.warn(`Uncommon aspect ratio. Standard ratios: ${validRatios.join(', ')}`);
|
|
228
|
+
}
|
|
229
|
+
setConfig('defaultAspectRatio', ratio);
|
|
230
|
+
output.success(`Default aspect ratio set to: ${ratio}`);
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,aAAa,EACb,WAAW,GAEZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAE7C,MAAM,UAAU,mBAAmB;IACjC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;SAC9B,KAAK,CAAC,KAAK,CAAC;SACZ,WAAW,CAAC,0BAA0B,CAAC,CAAC;IAE3C,oEAAoE;IACpE,GAAG;SACA,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CACV,yFAAyF,CAC1F;SACA,MAAM,CAAC,KAAK,EAAE,GAAW,EAAE,KAAa,EAAE,EAAE;QAC3C,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QAE9B,IAAI,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;YAChF,+DAA+D;YAC/D,MAAM,SAAS,CAAC,KAAK,CAAC,CAAC;YACvB,OAAO;QACT,CAAC;QAED,IAAI,UAAU,KAAK,WA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M,CAAC,OAAO,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7F,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,2CAA2C,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,SAAS,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IACvC,MAAM,CAAC,OAAO,CAAC,gCAAgC,KAAK,EAAE,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edit Commands
|
|
3
|
+
*
|
|
4
|
+
* Commands for editing images: edit, continue, upload
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
/**
|
|
8
|
+
* Edit image by ID
|
|
9
|
+
*/
|
|
10
|
+
export declare function createEditCommand(): Command;
|
|
11
|
+
/**
|
|
12
|
+
* Continue editing the last image in session
|
|
13
|
+
*/
|
|
14
|
+
export declare function createContinueCommand(): Command;
|
|
15
|
+
/**
|
|
16
|
+
* Upload an image for editing (from URL or local file)
|
|
17
|
+
*/
|
|
18
|
+
export declare function createUploadCommand(): Command;
|
|
19
|
+
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/commands/edit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CA8E3C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CA6E/C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CA6G7C"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edit Commands
|
|
3
|
+
*
|
|
4
|
+
* Commands for editing images: edit, continue, upload
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import { createTransport, getTransportName } from '../transport/index.js';
|
|
8
|
+
import { downloadImage, isUrl, readLocalImageAsBase64 } from '../utils/file-handler.js';
|
|
9
|
+
import * as output from '../utils/output.js';
|
|
10
|
+
/**
|
|
11
|
+
* Format bytes to human-readable string
|
|
12
|
+
*/
|
|
13
|
+
function formatBytes(bytes) {
|
|
14
|
+
if (bytes < 1024)
|
|
15
|
+
return `${bytes} B`;
|
|
16
|
+
if (bytes < 1024 * 1024)
|
|
17
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
18
|
+
return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Edit image by ID
|
|
22
|
+
*/
|
|
23
|
+
export function createEditCommand() {
|
|
24
|
+
const cmd = new Command('edit')
|
|
25
|
+
.alias('e')
|
|
26
|
+
.description('Edit an existing image by ID')
|
|
27
|
+
.argument('<imageId>', 'ID of the image to edit')
|
|
28
|
+
.argument('<prompt>', 'Editing instruction')
|
|
29
|
+
.option('--negative <prompt>', 'Negative prompt - what to avoid')
|
|
30
|
+
.option('-a, --aspect <ratio>', 'Aspect ratio for edited image')
|
|
31
|
+
.option('-d, --download', 'Download the edited image to local disk')
|
|
32
|
+
.option('-o, --output <path>', 'Output path for downloaded image')
|
|
33
|
+
.option('--json', 'Output raw JSON response')
|
|
34
|
+
.action(async (imageId, prompt, options) => {
|
|
35
|
+
const spin = output.spinner('Connecting to Go Bananas...');
|
|
36
|
+
try {
|
|
37
|
+
const transport = await createTransport();
|
|
38
|
+
spin.text = `Connected via ${getTransportName(transport.type)}. Editing image...`;
|
|
39
|
+
const params = {
|
|
40
|
+
imageId: parseInt(imageId, 10),
|
|
41
|
+
prompt,
|
|
42
|
+
negativePrompt: options.negative,
|
|
43
|
+
aspectRatio: options.aspect,
|
|
44
|
+
};
|
|
45
|
+
let result;
|
|
46
|
+
if (transport.type === 'mcp' && transport.mcp) {
|
|
47
|
+
const mcpResult = await transport.mcp.editImage(params);
|
|
48
|
+
const text = mcpResult.content?.[0]?.text || '';
|
|
49
|
+
const urlMatch = text.match(/https?:\/\/[^\s)]+/);
|
|
50
|
+
const idMatch = text.match(/ID:\s*(\d+)/);
|
|
51
|
+
result = {
|
|
52
|
+
url: urlMatch?.[0],
|
|
53
|
+
id: idMatch ? parseInt(idMatch[1], 10) : undefined,
|
|
54
|
+
raw: text,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
else if (transport.rest) {
|
|
58
|
+
const restResult = await transport.rest.editImage(params);
|
|
59
|
+
result = restResult.data;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
throw new Error('No transport available');
|
|
63
|
+
}
|
|
64
|
+
spin.stop();
|
|
65
|
+
if (options.json) {
|
|
66
|
+
output.json(result);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const r = result;
|
|
70
|
+
output.success('Image edited successfully!');
|
|
71
|
+
if (r.id)
|
|
72
|
+
output.keyValue('New ID', r.id);
|
|
73
|
+
const url = (r.url || r.fullUrl);
|
|
74
|
+
if (url)
|
|
75
|
+
output.keyValue('URL', url);
|
|
76
|
+
if (options.download && url) {
|
|
77
|
+
output.newline();
|
|
78
|
+
const downloadSpin = output.spinner('Downloading image...');
|
|
79
|
+
try {
|
|
80
|
+
const savedPath = await downloadImage(url, options.output);
|
|
81
|
+
downloadSpin.succeed(`Saved to: ${savedPath}`);
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
downloadSpin.fail(`Download failed: ${err instanceof Error ? err.message : 'Unknown error'}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (r.raw && !url) {
|
|
88
|
+
output.newline();
|
|
89
|
+
console.log(r.raw);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
spin.stop();
|
|
95
|
+
output.error(err instanceof Error ? err.message : 'Edit failed');
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return cmd;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Continue editing the last image in session
|
|
103
|
+
*/
|
|
104
|
+
export function createContinueCommand() {
|
|
105
|
+
const cmd = new Command('continue')
|
|
106
|
+
.alias('cont')
|
|
107
|
+
.alias('c')
|
|
108
|
+
.description('Continue editing the last generated/edited image')
|
|
109
|
+
.argument('<prompt>', 'Editing instruction')
|
|
110
|
+
.option('--negative <prompt>', 'Negative prompt - what to avoid')
|
|
111
|
+
.option('-a, --aspect <ratio>', 'Aspect ratio for edited image')
|
|
112
|
+
.option('-d, --download', 'Download the edited image to local disk')
|
|
113
|
+
.option('-o, --output <path>', 'Output path for downloaded image')
|
|
114
|
+
.option('--json', 'Output raw JSON response')
|
|
115
|
+
.action(async (prompt, options) => {
|
|
116
|
+
const spin = output.spinner('Connecting to Go Bananas...');
|
|
117
|
+
try {
|
|
118
|
+
const transport = await createTransport();
|
|
119
|
+
spin.text = `Connected via ${getTransportName(transport.type)}. Continuing edit...`;
|
|
120
|
+
const params = {
|
|
121
|
+
prompt,
|
|
122
|
+
negativePrompt: options.negative,
|
|
123
|
+
aspectRatio: options.aspect,
|
|
124
|
+
};
|
|
125
|
+
let result;
|
|
126
|
+
if (transport.type === 'mcp' && transport.mcp) {
|
|
127
|
+
const mcpResult = await transport.mcp.continueEditing(params);
|
|
128
|
+
const text = mcpResult.content?.[0]?.text || '';
|
|
129
|
+
const urlMatch = text.match(/https?:\/\/[^\s)]+/);
|
|
130
|
+
const idMatch = text.match(/ID:\s*(\d+)/);
|
|
131
|
+
result = {
|
|
132
|
+
url: urlMatch?.[0],
|
|
133
|
+
id: idMatch ? parseInt(idMatch[1], 10) : undefined,
|
|
134
|
+
raw: text,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
else if (transport.rest) {
|
|
138
|
+
const restResult = await transport.rest.continueEditing(params);
|
|
139
|
+
result = restResult.data;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
throw new Error('No transport available');
|
|
143
|
+
}
|
|
144
|
+
spin.stop();
|
|
145
|
+
if (options.json) {
|
|
146
|
+
output.json(result);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
const r = result;
|
|
150
|
+
output.success('Image edited successfully!');
|
|
151
|
+
if (r.id)
|
|
152
|
+
output.keyValue('New ID', r.id);
|
|
153
|
+
const url = (r.url || r.fullUrl);
|
|
154
|
+
if (url)
|
|
155
|
+
output.keyValue('URL', url);
|
|
156
|
+
if (options.download && url) {
|
|
157
|
+
output.newline();
|
|
158
|
+
const downloadSpin = output.spinner('Downloading image...');
|
|
159
|
+
try {
|
|
160
|
+
const savedPath = await downloadImage(url, options.output);
|
|
161
|
+
downloadSpin.succeed(`Saved to: ${savedPath}`);
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
downloadSpin.fail(`Download failed: ${err instanceof Error ? err.message : 'Unknown error'}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (r.raw && !url) {
|
|
168
|
+
output.newline();
|
|
169
|
+
console.log(r.raw);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
spin.stop();
|
|
175
|
+
output.error(err instanceof Error ? err.message : 'Continue edit failed');
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
return cmd;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Upload an image for editing (from URL or local file)
|
|
183
|
+
*/
|
|
184
|
+
export function createUploadCommand() {
|
|
185
|
+
const cmd = new Command('upload')
|
|
186
|
+
.alias('up')
|
|
187
|
+
.description('Upload an image for editing (URL or local file)')
|
|
188
|
+
.argument('<source>', 'URL or local file path of the image to upload')
|
|
189
|
+
.option('--filename <name>', 'Optional filename override')
|
|
190
|
+
.option('--mime <type>', 'MIME type (auto-detected if not provided)')
|
|
191
|
+
.option('--json', 'Output raw JSON response')
|
|
192
|
+
.action(async (source, options) => {
|
|
193
|
+
const spin = output.spinner('Connecting to Go Bananas...');
|
|
194
|
+
try {
|
|
195
|
+
const transport = await createTransport();
|
|
196
|
+
// Determine if source is URL or local file
|
|
197
|
+
const isUrlSource = isUrl(source);
|
|
198
|
+
let result;
|
|
199
|
+
if (isUrlSource) {
|
|
200
|
+
// URL-based upload (existing behavior)
|
|
201
|
+
spin.text = `Connected via ${getTransportName(transport.type)}. Uploading from URL...`;
|
|
202
|
+
const params = {
|
|
203
|
+
imageUrl: source,
|
|
204
|
+
fileName: options.filename,
|
|
205
|
+
mimeType: options.mime,
|
|
206
|
+
};
|
|
207
|
+
if (transport.type === 'mcp' && transport.mcp) {
|
|
208
|
+
const mcpResult = await transport.mcp.uploadImageForEditing(params);
|
|
209
|
+
const text = mcpResult.content?.[0]?.text || '';
|
|
210
|
+
const idMatch = text.match(/Image ID:\s*(\d+)/i) || text.match(/image_id:\s*(\d+)/i);
|
|
211
|
+
result = {
|
|
212
|
+
imageId: idMatch ? parseInt(idMatch[1], 10) : undefined,
|
|
213
|
+
raw: text,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
else if (transport.rest) {
|
|
217
|
+
const restResult = await transport.rest.uploadImage(params);
|
|
218
|
+
result = restResult.data;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
throw new Error('No transport available');
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
// Local file upload (NEW - REST only, MCP blocks base64)
|
|
226
|
+
spin.text = 'Reading local file...';
|
|
227
|
+
// Read and validate local file
|
|
228
|
+
const localImage = await readLocalImageAsBase64(source);
|
|
229
|
+
spin.text = `Uploading ${localImage.fileName} (${formatBytes(localImage.sizeBytes)})...`;
|
|
230
|
+
// Local file upload MUST use REST (MCP blocks base64 due to token limits)
|
|
231
|
+
if (!transport.rest) {
|
|
232
|
+
throw new Error('Local file upload requires REST transport. ' +
|
|
233
|
+
'Configure your API key to enable REST API access.');
|
|
234
|
+
}
|
|
235
|
+
const restResult = await transport.rest.uploadImageFromFile({
|
|
236
|
+
imageData: localImage.base64Data,
|
|
237
|
+
fileName: options.filename || localImage.fileName,
|
|
238
|
+
mimeType: options.mime || localImage.mimeType,
|
|
239
|
+
});
|
|
240
|
+
// Handle both wrapped {data: ...} and direct response formats
|
|
241
|
+
result = restResult.data || restResult;
|
|
242
|
+
}
|
|
243
|
+
spin.stop();
|
|
244
|
+
if (options.json) {
|
|
245
|
+
output.json(result);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
const r = result;
|
|
249
|
+
output.success('Image uploaded successfully!');
|
|
250
|
+
// Handle both camelCase and snake_case response fields
|
|
251
|
+
const imageId = (r.imageId || r.image_id);
|
|
252
|
+
if (imageId) {
|
|
253
|
+
output.keyValue('Image ID', imageId);
|
|
254
|
+
output.newline();
|
|
255
|
+
output.tip(`Use "gb edit ${imageId} '<instruction>'" to edit this image`);
|
|
256
|
+
}
|
|
257
|
+
const publicUrl = (r.publicUrl || r.public_url);
|
|
258
|
+
if (publicUrl) {
|
|
259
|
+
output.keyValue('URL', publicUrl);
|
|
260
|
+
}
|
|
261
|
+
const sizeBytes = (r.sizeBytes || r.size_bytes);
|
|
262
|
+
if (sizeBytes) {
|
|
263
|
+
output.keyValue('Size', formatBytes(sizeBytes));
|
|
264
|
+
}
|
|
265
|
+
if (r.raw && !imageId) {
|
|
266
|
+
output.newline();
|
|
267
|
+
console.log(r.raw);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
catch (err) {
|
|
272
|
+
spin.stop();
|
|
273
|
+
output.error(err instanceof Error ? err.message : 'Upload failed');
|
|
274
|
+
process.exit(1);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
return cmd;
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../src/commands/edit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAE7C;;GAEG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,GAAG,KAAK,IAAI,CAAC;IACtC,IAAI,KAAK,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;SAC5B,KAAK,CAAC,GAAG,CAAC;SACV,WAAW,CAAC,8BAA8B,CAAC;SAC3C,QAAQ,CAAC,WAAW,EAAE,yBAAyB,CAAC;SAChD,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;SAC3C,MAAM,CAAC,qBAAqB,EAAE,iCAAiC,CAAC;SAChE,MAAM,CAAC,sBAAsB,EAAE,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