Skip to content

Commit a4f8e30

Browse files
committed
feat(clawdhub): add auth subcommands
1 parent 2e55827 commit a4f8e30

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

packages/clawdhub/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Create a token on `clawdhub.com` → Settings → API tokens, then:
1414

1515
```bash
1616
clawdhub login
17+
# or
18+
clawdhub auth login
1719
```
1820

1921
## Examples

packages/clawdhub/src/cli.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,36 @@ program
7777
await cmdWhoami(opts)
7878
})
7979

80+
const auth = program
81+
.command('auth')
82+
.description('Authentication commands')
83+
.showHelpAfterError()
84+
.showSuggestionAfterError()
85+
86+
auth
87+
.command('login')
88+
.description('Store API token (for publish)')
89+
.option('--token <token>', 'API token')
90+
.action(async (options) => {
91+
const opts = resolveGlobalOpts()
92+
await cmdLogin(opts, options.token)
93+
})
94+
95+
auth
96+
.command('logout')
97+
.description('Remove stored token')
98+
.action(async () => {
99+
await cmdLogout()
100+
})
101+
102+
auth
103+
.command('whoami')
104+
.description('Validate token')
105+
.action(async () => {
106+
const opts = resolveGlobalOpts()
107+
await cmdWhoami(opts)
108+
})
109+
80110
program
81111
.command('search')
82112
.description('Vector search skills')

0 commit comments

Comments
 (0)