xapi-to 0.1.7 → 0.1.9
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/README.md +3 -3
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/config.ts +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# xapi-
|
|
1
|
+
# xapi-to
|
|
2
2
|
|
|
3
3
|
Agent-friendly command-line interface for [xAPI](https://xapi.to) — discover and call capabilities and APIs from your terminal or AI agent.
|
|
4
4
|
|
|
@@ -6,10 +6,10 @@ Agent-friendly command-line interface for [xAPI](https://xapi.to) — discover a
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# Via npx (no install needed)
|
|
9
|
-
npx
|
|
9
|
+
npx xapi-to --help
|
|
10
10
|
|
|
11
11
|
# Or install globally with bun
|
|
12
|
-
bun add -g
|
|
12
|
+
bun add -g xapi-to
|
|
13
13
|
|
|
14
14
|
# Or from source
|
|
15
15
|
cd xapi-cli && bun install
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -32,7 +32,7 @@ export async function request<T>(
|
|
|
32
32
|
if (data?.statusCode === 401 || data?.error === 'Unauthorized') {
|
|
33
33
|
throw new Error(
|
|
34
34
|
'Authentication failed: ' + (data.message || 'Invalid or missing API key')
|
|
35
|
-
+ '. Run "npx
|
|
35
|
+
+ '. Run "npx xapi-to config set apiKey=<key>" to update your key.',
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
if (data?.error === 'OAuth Required' || (data?.statusCode === 403 && data?.message?.includes('OAuth'))) {
|
package/src/config.ts
CHANGED
|
@@ -44,7 +44,7 @@ export function getConfig(): XapiConfig {
|
|
|
44
44
|
|
|
45
45
|
export function requireApiKey(cfg: XapiConfig): void {
|
|
46
46
|
if (!cfg.apiKey) {
|
|
47
|
-
err('API key not configured', 'Run "npx
|
|
47
|
+
err('API key not configured', 'Run "npx xapi-to register" to create an account, or "npx xapi-to config set apiKey=<key>" to set an existing key.');
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|