@dccxx/auggiegw 1.0.2 → 1.0.4
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 +15 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -196,11 +196,19 @@ async function authProxy(proxyId, proxyPassword, apiUrl) {
|
|
|
196
196
|
const data = (await response.json());
|
|
197
197
|
return data;
|
|
198
198
|
}
|
|
199
|
-
async function handleLogin() {
|
|
199
|
+
async function handleLogin(usernameArg, passwordArg) {
|
|
200
200
|
try {
|
|
201
201
|
const config = loadConfig();
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
let username;
|
|
203
|
+
let password;
|
|
204
|
+
if (usernameArg && passwordArg) {
|
|
205
|
+
username = usernameArg;
|
|
206
|
+
password = passwordArg;
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
username = await promptInput('Username: ');
|
|
210
|
+
password = await promptInput('Password: ', true);
|
|
211
|
+
}
|
|
204
212
|
if (!username || !password) {
|
|
205
213
|
console.error('Error: Username and password are required');
|
|
206
214
|
process.exit(1);
|
|
@@ -292,7 +300,10 @@ async function handleFetch() {
|
|
|
292
300
|
}
|
|
293
301
|
const program = new Command();
|
|
294
302
|
program.name('auggiegw').description('CLI tool for auggiegw authentication').version('1.0.0');
|
|
295
|
-
program
|
|
303
|
+
program
|
|
304
|
+
.command('login [username] [password]')
|
|
305
|
+
.description('Login and store credentials')
|
|
306
|
+
.action(handleLogin);
|
|
296
307
|
program.command('logout').description('Logout and remove stored credentials').action(handleLogout);
|
|
297
308
|
program
|
|
298
309
|
.command('fetch')
|