agentgate 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/package.json +1 -1
- package/src/cli.js +7 -4
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -37,12 +37,15 @@ Examples:
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
async function main() {
|
|
40
|
-
if (
|
|
40
|
+
if (command === '-h' || command === '--help') {
|
|
41
41
|
printUsage();
|
|
42
42
|
process.exit(0);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
// Default to start if no command given
|
|
46
|
+
const cmd = command || 'start';
|
|
47
|
+
|
|
48
|
+
if (cmd === 'start') {
|
|
46
49
|
// Parse port from args
|
|
47
50
|
const portIdx = args.findIndex(a => a === '-p' || a === '--port');
|
|
48
51
|
if (portIdx !== -1 && args[portIdx + 1]) {
|
|
@@ -51,7 +54,7 @@ async function main() {
|
|
|
51
54
|
|
|
52
55
|
// Import and run the server
|
|
53
56
|
await import('./index.js');
|
|
54
|
-
} else if (
|
|
57
|
+
} else if (cmd === 'keys') {
|
|
55
58
|
const subcommand = args[0];
|
|
56
59
|
const { createApiKey, listApiKeys, deleteApiKey } = await import('./lib/db.js');
|
|
57
60
|
|
|
@@ -103,7 +106,7 @@ async function main() {
|
|
|
103
106
|
process.exit(1);
|
|
104
107
|
}
|
|
105
108
|
} else {
|
|
106
|
-
console.error(`Unknown command: ${
|
|
109
|
+
console.error(`Unknown command: ${cmd}`);
|
|
107
110
|
printUsage();
|
|
108
111
|
process.exit(1);
|
|
109
112
|
}
|