You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,30 @@ The CLI connects to the [Bitrefill MCP server](https://api.bitrefill.com/mcp) an
12
12
npm install -g @bitrefill/cli
13
13
```
14
14
15
-
## Usage
15
+
## Authentication
16
+
17
+
### OAuth (default)
18
+
19
+
On first run, the CLI opens your browser for OAuth authorization. Credentials are stored in `~/.config/bitrefill-cli/`.
20
+
21
+
### API Key
22
+
23
+
Generate an API key at [bitrefill.com/account/developers](https://www.bitrefill.com/account/developers) and pass it via the `--api-key` option or the `BITREFILL_API_KEY` environment variable. This skips the OAuth flow entirely.
const{ client, transport }=awaitcreateMcpClient(mcpUrl,useOAuth);
316
344
317
345
consttoolsResult=awaitclient.request(
318
346
{method: 'tools/list',params: {}},
@@ -326,14 +354,24 @@ async function main(): Promise<void> {
326
354
.description(
327
355
'Bitrefill CLI - browse, buy, and manage gift cards, mobile top-ups, and eSIMs.\n\nTerms: https://www.bitrefill.com/terms\nPrivacy: https://www.bitrefill.com/privacy'
328
356
)
329
-
.version('0.0.1');
357
+
.version('0.1.0')
358
+
.option(
359
+
'--api-key <key>',
360
+
'Bitrefill API key (overrides BITREFILL_API_KEY env var)'
361
+
);
330
362
331
363
program
332
364
.command('logout')
333
365
.description('Clear stored OAuth credentials')
334
366
.action(()=>{
367
+
if(!useOAuth){
368
+
console.log(
369
+
'Using API key authentication — no stored credentials to clear.'
0 commit comments