Skip to content

Commit 785b951

Browse files
kev1nclaude
andcommitted
fix(login): read key from global --api-key flag; release 0.1.1
The login subcommand redefined --api-key, colliding with the root global flag so Commander routed the value to the root and login saw nothing (required-option error). Drop the duplicate and read the global flag, matching every other command. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9d88c03 commit 785b951

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "anyapi-cli",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Official CLI for AnyAPI, a unified marketplace for scraping and data APIs.",
55
"type": "module",
66
"bin": {

‎src/index.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ program
2323
.name('anyapi')
2424
.description('Official CLI for AnyAPI.')
2525
.option('--api-key <apiKey>', 'AnyAPI API key. Overrides ANYAPI_API_KEY and local config.')
26-
.version('0.1.0');
26+
.version('0.1.1');
2727

2828
program
2929
.command('signup')
@@ -35,9 +35,8 @@ program
3535

3636
program
3737
.command('login')
38-
.description('Store an existing AnyAPI key locally.')
39-
.requiredOption('--api-key <apiKey>', 'Existing aa_live_ key.')
40-
.action((options) => run(() => loginCommand(ctx, options)));
38+
.description('Store an existing AnyAPI key locally. Pass the key with the global --api-key flag.')
39+
.action(() => run(() => loginCommand(ctx, globalOptions())));
4140

4241
program
4342
.command('search')

0 commit comments

Comments
 (0)