apiblaze 0.4.0 → 0.4.1
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 +63 -71
- package/dist/index.js +35 -71
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,44 +1,38 @@
|
|
|
1
1
|
# apiblaze
|
|
2
2
|
|
|
3
|
-
CLI for [APIblaze](https://apiblaze.com) —
|
|
3
|
+
CLI for [APIblaze](https://apiblaze.com) — turn any backend into a managed API: add a key, auth, rate limits, a spec, and your own domain, in seconds.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
npx apiblaze --help # run without installing
|
|
9
|
+
npm install -g apiblaze # or install globally
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
Requires Node.js 18+.
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
The easiest way is to just chat with it:
|
|
12
17
|
|
|
13
18
|
```bash
|
|
14
|
-
npx apiblaze
|
|
19
|
+
npx apiblaze agent
|
|
15
20
|
```
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
> Talk in plain English — "make an API for httpbin.org", "rate-limit it to 50/sec",
|
|
23
|
+
> "give me a key". It does the work and shows what each step costs.
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Quick start
|
|
25
|
+
Prefer commands? A few one-liners:
|
|
22
26
|
|
|
23
27
|
```bash
|
|
24
|
-
#
|
|
28
|
+
# Make an API in one line — no account needed (prints a claim URL)
|
|
25
29
|
npx apiblaze create --target https://api.example.com
|
|
26
30
|
|
|
27
|
-
#
|
|
28
|
-
npx apiblaze login
|
|
29
|
-
|
|
30
|
-
# Create a proxy under your team
|
|
31
|
-
npx apiblaze create --name myapi --target https://api.example.com --auth api_key
|
|
32
|
-
|
|
33
|
-
# Start a dev tunnel (defaults to port 3000)
|
|
34
|
-
npx apiblaze dev
|
|
35
|
-
|
|
36
|
-
# Or specify a port
|
|
31
|
+
# Run your localhost through a public URL
|
|
37
32
|
npx apiblaze dev 3000
|
|
38
33
|
|
|
39
|
-
#
|
|
40
|
-
npx apiblaze
|
|
41
|
-
|
|
34
|
+
# Sign in to manage APIs under your team
|
|
35
|
+
npx apiblaze login
|
|
42
36
|
```
|
|
43
37
|
|
|
44
38
|
## Help
|
|
@@ -59,64 +53,62 @@ apiblaze throttle myapi --rate 50 --verbose
|
|
|
59
53
|
|
|
60
54
|
## Commands
|
|
61
55
|
|
|
62
|
-
###
|
|
56
|
+
### Chat (the easy way)
|
|
63
57
|
|
|
64
|
-
| Command |
|
|
58
|
+
| Command | What it does |
|
|
65
59
|
|---|---|
|
|
66
|
-
| `apiblaze
|
|
67
|
-
| `apiblaze
|
|
68
|
-
| `apiblaze
|
|
69
|
-
| `apiblaze
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
| `apiblaze claim [code]` | Claim an anonymously-created proxy into your team |
|
|
73
|
-
| `apiblaze dev [port]` | Start a dev tunnel for your localhost projects |
|
|
74
|
-
|
|
75
|
-
### Manage a proxy
|
|
76
|
-
|
|
77
|
-
| Command | Description |
|
|
78
|
-
|---|---|
|
|
79
|
-
| `apiblaze delete <project> [version]` | Delete a proxy (full cascade) — shows impact, then confirms |
|
|
80
|
-
| `apiblaze target <project> --url <u> [--env <e>]` | Set the target URL (per-environment with `--env`, else project-level) |
|
|
81
|
-
| `apiblaze throttle <project> [--rate n] [--quota n] [--period daily\|weekly\|monthly]` | Set rate limits + quota |
|
|
82
|
-
| `apiblaze rename <project> --display-name <name>` | Change the display name |
|
|
83
|
-
| `apiblaze spec get <project>` | Print the current OpenAPI document |
|
|
84
|
-
| `apiblaze spec set <project> --file <path>` | Replace the OpenAPI spec from a local file |
|
|
60
|
+
| `apiblaze agent` | Chat about anything — create, configure, and inspect your APIs |
|
|
61
|
+
| `apiblaze agent openapi <project>` | Chat to build your API spec from real traffic |
|
|
62
|
+
| `apiblaze agent authz <project>` | Chat to design and turn on access rules |
|
|
63
|
+
| `apiblaze agent mcp <project>` | Chat to build an MCP server for your API |
|
|
64
|
+
|
|
65
|
+
Every chat turn shows its cost.
|
|
85
66
|
|
|
86
|
-
###
|
|
67
|
+
### Getting started
|
|
87
68
|
|
|
88
|
-
| Command |
|
|
69
|
+
| Command | What it does |
|
|
89
70
|
|---|---|
|
|
90
|
-
| `apiblaze
|
|
91
|
-
| `apiblaze
|
|
92
|
-
| `apiblaze
|
|
93
|
-
| `apiblaze
|
|
94
|
-
| `apiblaze
|
|
71
|
+
| `apiblaze create --target <url>` | Make an API from a backend (no account needed) |
|
|
72
|
+
| `apiblaze dev [port]` | Put your localhost behind a public URL |
|
|
73
|
+
| `apiblaze login` / `logout` | Sign in / out |
|
|
74
|
+
| `apiblaze whoami` | Who am I, and which team |
|
|
75
|
+
| `apiblaze team [name]` | Switch team |
|
|
76
|
+
| `apiblaze projects` | List your APIs |
|
|
77
|
+
| `apiblaze claim [code]` | Claim an API you made before signing in |
|
|
95
78
|
|
|
96
|
-
###
|
|
79
|
+
### Manage an API
|
|
97
80
|
|
|
98
|
-
| Command |
|
|
81
|
+
| Command | What it does |
|
|
99
82
|
|---|---|
|
|
100
|
-
| `apiblaze
|
|
101
|
-
| `apiblaze
|
|
102
|
-
| `apiblaze
|
|
103
|
-
| `apiblaze
|
|
104
|
-
| `apiblaze
|
|
105
|
-
| `apiblaze
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
| Command | Description |
|
|
83
|
+
| `apiblaze target <project> --url <url> [--env <e>]` | Change where it forwards requests |
|
|
84
|
+
| `apiblaze throttle <project> [--rate n] [--quota n] [--period daily\|weekly\|monthly]` | Set rate limits and quotas |
|
|
85
|
+
| `apiblaze rename <project> --display-name <name>` | Rename it |
|
|
86
|
+
| `apiblaze spec get <project>` | Print its OpenAPI spec |
|
|
87
|
+
| `apiblaze spec set <project> --file <path>` | Replace its OpenAPI spec from a file |
|
|
88
|
+
| `apiblaze delete <project>` | Delete it and everything under it (asks first) |
|
|
89
|
+
|
|
90
|
+
### Your own domain
|
|
91
|
+
|
|
92
|
+
| Command | What it does |
|
|
112
93
|
|---|---|
|
|
113
|
-
| `apiblaze
|
|
114
|
-
| `apiblaze
|
|
115
|
-
| `apiblaze
|
|
116
|
-
| `apiblaze
|
|
94
|
+
| `apiblaze domain add <project> --domain <host>` | Add your domain (shows the DNS records to set) |
|
|
95
|
+
| `apiblaze domain status <project> --id <id>` | Check if it's verified yet |
|
|
96
|
+
| `apiblaze domain list <project>` / `rm <project> --id <id>` | List / remove |
|
|
97
|
+
| `apiblaze domain set-base <project> [--env <e>]` | Pick which version/env your main URL serves |
|
|
117
98
|
|
|
118
|
-
|
|
119
|
-
|
|
99
|
+
### Users & keys
|
|
100
|
+
|
|
101
|
+
| Command | What it does |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `apiblaze tenant create --name <name>` | Create a tenant (a separate group of your API's users) |
|
|
104
|
+
| `apiblaze tenant attach <project> --tenant <slug>` | Give a proxy its own set of users |
|
|
105
|
+
| `apiblaze tenant cors --tenant <slug> --origins <a,b>` | Set which websites can call it |
|
|
106
|
+
| `apiblaze tenant list` / `delete <slug>` | List / delete |
|
|
107
|
+
| `apiblaze key mint [--desc <text>]` | Make a key to manage your account from scripts |
|
|
108
|
+
| `apiblaze key list` / `revoke <id>` | List / revoke |
|
|
109
|
+
|
|
110
|
+
> See what any command does under the hood with `--verbose`. Most management
|
|
111
|
+
> commands take `--team`, `--apiversion`, and `--json`.
|
|
120
112
|
|
|
121
113
|
## How it works
|
|
122
114
|
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var import_commander = require("commander");
|
|
|
28
28
|
var import_chalk25 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// package.json
|
|
31
|
-
var version = "0.4.
|
|
31
|
+
var version = "0.4.1";
|
|
32
32
|
|
|
33
33
|
// src/types.ts
|
|
34
34
|
var ApiError = class extends Error {
|
|
@@ -2637,6 +2637,23 @@ program.command("create").description("Create a new API proxy (no login needed \
|
|
|
2637
2637
|
process.exit(1);
|
|
2638
2638
|
}
|
|
2639
2639
|
});
|
|
2640
|
+
var agent = program.command("agent").description("Chat with an assistant that builds and runs your APIs (billed per turn)").option("--team <id|name>", "Team to work in (defaults to your active team)").action(action((opts) => runAgent(opts)));
|
|
2641
|
+
agent.command("authz").description("Chat to design and turn on access rules for an API").argument("<project>", "Project name or id").argument("[apiVersion]", "API version (defaults to the project's)").action(action((project, apiVersion) => runAuthz(project, apiVersion)));
|
|
2642
|
+
agent.command("openapi").description("Chat to build your API spec from real traffic").argument("<project>", "Project name or id").argument("[apiVersion]", "API version (defaults to the project's)").action(action((project, apiVersion) => runOpenapi(project, apiVersion)));
|
|
2643
|
+
agent.command("mcp").description("Chat to build an MCP server for an API").argument("<project>", "Project name or id").argument("[apiVersion]", "API version (defaults to the project's)").option("--environment <env>", "Environment to publish (default: prod)").action(action((project, apiVersion, opts) => runMcp(project, apiVersion, opts)));
|
|
2644
|
+
program.command("dev").description("Put your localhost behind a public URL (dev tunnel)").argument("[port]", "Local port to tunnel (positional; overrides --port)").option("-p, --port <number>", "Local port to tunnel", "3000").option("-o, --capture-file <path>", "Stream full request/response traffic to a file (JSON lines)").action(async (port, opts) => {
|
|
2645
|
+
try {
|
|
2646
|
+
const resolved = parseInt(port ?? opts.port, 10);
|
|
2647
|
+
if (Number.isNaN(resolved)) {
|
|
2648
|
+
console.error(import_chalk25.default.red(`Invalid port: ${port ?? opts.port}`));
|
|
2649
|
+
process.exit(1);
|
|
2650
|
+
}
|
|
2651
|
+
await runDev({ port: resolved, captureFile: opts.captureFile });
|
|
2652
|
+
} catch (err) {
|
|
2653
|
+
printError(err);
|
|
2654
|
+
process.exit(1);
|
|
2655
|
+
}
|
|
2656
|
+
});
|
|
2640
2657
|
program.command("logout").description("Sign out \u2014 remove stored credentials from this machine").action(async () => {
|
|
2641
2658
|
try {
|
|
2642
2659
|
await runLogout();
|
|
@@ -2677,100 +2694,47 @@ program.command("projects").description("List the projects in your team").action
|
|
|
2677
2694
|
process.exit(1);
|
|
2678
2695
|
}
|
|
2679
2696
|
});
|
|
2680
|
-
program.command("
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
} catch (err) {
|
|
2684
|
-
printError(err);
|
|
2685
|
-
process.exit(1);
|
|
2686
|
-
}
|
|
2687
|
-
});
|
|
2688
|
-
program.command("openapi").description("Design your OpenAPI spec from captured traffic interactively (chat), then publish it").argument("<project>", "Project name or id (see `apiblaze projects`)").argument("[apiVersion]", "API version (defaults to the project's version)").action(async (project, apiVersion) => {
|
|
2689
|
-
try {
|
|
2690
|
-
await runOpenapi(project, apiVersion);
|
|
2691
|
-
} catch (err) {
|
|
2692
|
-
printError(err);
|
|
2693
|
-
process.exit(1);
|
|
2694
|
-
}
|
|
2695
|
-
});
|
|
2696
|
-
program.command("mcp").description("Design an MCP server from the spec + traffic interactively (chat), then publish it").argument("<project>", "Project name or id (see `apiblaze projects`)").argument("[apiVersion]", "API version (defaults to the project's version)").option("--environment <env>", "Environment to publish (default: prod)").action(async (project, apiVersion, opts) => {
|
|
2697
|
-
try {
|
|
2698
|
-
await runMcp(project, apiVersion, opts);
|
|
2699
|
-
} catch (err) {
|
|
2700
|
-
printError(err);
|
|
2701
|
-
process.exit(1);
|
|
2702
|
-
}
|
|
2703
|
-
});
|
|
2704
|
-
program.command("dev").description("Start a dev tunnel for your localhost projects").argument("[port]", "Local port to tunnel (positional; overrides --port)").option("-p, --port <number>", "Local port to tunnel", "3000").option("-o, --capture-file <path>", "Stream full request/response traffic to a file (JSON lines)").action(async (port, opts) => {
|
|
2705
|
-
try {
|
|
2706
|
-
const resolved = parseInt(port ?? opts.port, 10);
|
|
2707
|
-
if (Number.isNaN(resolved)) {
|
|
2708
|
-
console.error(import_chalk25.default.red(`Invalid port: ${port ?? opts.port}`));
|
|
2709
|
-
process.exit(1);
|
|
2710
|
-
}
|
|
2711
|
-
await runDev({ port: resolved, captureFile: opts.captureFile });
|
|
2712
|
-
} catch (err) {
|
|
2713
|
-
printError(err);
|
|
2714
|
-
process.exit(1);
|
|
2715
|
-
}
|
|
2716
|
-
});
|
|
2717
|
-
program.command("delete").description("Delete a proxy (full cascade) \u2014 shows impact, then confirms").argument("<project>", "Project name or id (see `apiblaze projects`)").argument("[version]", "API version (defaults to the first match)").option("--team <id|name>", "Team the project is in (defaults to active team)").option("-y, --yes", "Skip the confirmation prompt").option("--json", "Output machine-readable JSON").action(action((project, version2, opts) => runDelete(project, version2, opts)));
|
|
2718
|
-
program.command("target").description("Set a proxy's target URL (per-environment with --env, else project-level)").argument("<project>", "Project name or id").requiredOption("--url <url>", "Target URL to forward to").option("--env <env>", "Environment to scope the target to (e.g. prod, dev)").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version (defaults to the first match)").option("--json", "Output machine-readable JSON").action(action((project, opts) => runTargetSet(project, opts)));
|
|
2719
|
-
program.command("throttle").description("Set per-proxy throttling (rate limits + quota)").argument("<project>", "Project name or id").option("--rate <n>", "User rate limit (requests/sec)").option("--end-user-rate <n>", "Per-end-user rate limit (requests/sec)").option("--quota <n>", "Proxy quota (requests/period)").option("--period <p>", "Quota period: daily | weekly | monthly").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").option("--json", "Output machine-readable JSON").action(action((project, opts) => runThrottleSet(project, opts)));
|
|
2697
|
+
program.command("delete").description("Delete a proxy and everything under it (asks first)").argument("<project>", "Project name or id (see `apiblaze projects`)").argument("[version]", "API version (defaults to the first match)").option("--team <id|name>", "Team the project is in (defaults to active team)").option("-y, --yes", "Skip the confirmation prompt").option("--json", "Output machine-readable JSON").action(action((project, version2, opts) => runDelete(project, version2, opts)));
|
|
2698
|
+
program.command("target").description("Change where a proxy forwards requests").argument("<project>", "Project name or id").requiredOption("--url <url>", "Target URL to forward to").option("--env <env>", "Environment to scope the target to (e.g. prod, dev)").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version (defaults to the first match)").option("--json", "Output machine-readable JSON").action(action((project, opts) => runTargetSet(project, opts)));
|
|
2699
|
+
program.command("throttle").description("Set rate limits and quotas for a proxy").argument("<project>", "Project name or id").option("--rate <n>", "User rate limit (requests/sec)").option("--end-user-rate <n>", "Per-end-user rate limit (requests/sec)").option("--quota <n>", "Proxy quota (requests/period)").option("--period <p>", "Quota period: daily | weekly | monthly").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").option("--json", "Output machine-readable JSON").action(action((project, opts) => runThrottleSet(project, opts)));
|
|
2720
2700
|
program.command("rename").description("Change a proxy's display name").argument("<project>", "Project name or id").requiredOption("--display-name <name>", "New human-friendly display name").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").option("--json", "Output machine-readable JSON").action(action((project, opts) => runRename(project, opts)));
|
|
2721
|
-
var domain = program.command("domain").description("
|
|
2722
|
-
domain.command("add").description("
|
|
2701
|
+
var domain = program.command("domain").description("Use your own domain for a proxy");
|
|
2702
|
+
domain.command("add").description("Add your own domain (shows the DNS records to set)").argument("<project>", "Project name or id").requiredOption("--domain <host>", "Custom hostname to add").option("--tenant <slug>", "Tenant to scope the domain to").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").option("--json", "Output machine-readable JSON").action(action((project, opts) => runDomainAdd(project, opts)));
|
|
2723
2703
|
domain.command("list").description("List custom domains for a proxy").argument("<project>", "Project name or id").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").option("--json", "Output machine-readable JSON").action(action((project, opts) => runDomainList(project, opts)));
|
|
2724
2704
|
domain.command("status").description("Check a custom domain's validation status").argument("<project>", "Project name or id").requiredOption("--id <domainId>", "Domain id (see `domain list`)").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").option("--json", "Output machine-readable JSON").action(action((project, opts) => runDomainStatus(project, opts)));
|
|
2725
2705
|
domain.command("rm").description("Remove a custom domain").argument("<project>", "Project name or id").requiredOption("--id <domainId>", "Domain id (see `domain list`)").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").action(action((project, opts) => runDomainRemove(project, opts)));
|
|
2726
|
-
domain.command("set-base").description("
|
|
2727
|
-
var tenant = program.command("tenant").description("Manage tenants
|
|
2706
|
+
domain.command("set-base").description("Choose which version/environment your main URL serves").argument("<project>", "Project name or id").option("--env <env>", "Environment (default: prod)").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").action(action((project, opts) => runDomainSetBase(project, opts)));
|
|
2707
|
+
var tenant = program.command("tenant").description("Manage tenants \u2014 separate groups of your API's users");
|
|
2728
2708
|
tenant.command("list").description("List tenants in your team").option("--team <id|name>", "Team (defaults to active team)").option("--json", "Output machine-readable JSON").action(action((opts) => runTenantList(opts)));
|
|
2729
2709
|
tenant.command("create").description("Create a tenant in your team").requiredOption("--name <display>", "Display name").option("--slug <tenant_name>", "Explicit tenant slug (generated if omitted)").option("--team <id|name>", "Team (defaults to active team)").option("--json", "Output machine-readable JSON").action(action((opts) => runTenantCreate(opts)));
|
|
2730
2710
|
tenant.command("attach").description("Attach a tenant to a proxy").argument("<project>", "Project name or id").requiredOption("--tenant <slug>", "Tenant slug to attach").option("--auth-config <id>", "Auth config id to bind").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").option("--json", "Output machine-readable JSON").action(action((project, opts) => runTenantAttach(project, opts)));
|
|
2731
2711
|
tenant.command("delete").description("Delete a tenant (full cascade)").argument("<slug>", "Tenant slug to delete").option("--team <id|name>", "Team (defaults to active team)").option("-y, --yes", "Skip the confirmation prompt").action(action((slug, opts) => runTenantDelete(slug, opts)));
|
|
2732
2712
|
tenant.command("cors").description("Set the CORS allow-list for a tenant").requiredOption("--tenant <slug>", "Tenant slug").option("--origins <list>", 'Comma-separated origins (or "*"); empty clears').option("--team <id|name>", "Team (defaults to active team)").action(action((opts) => runTenantCors(opts)));
|
|
2733
|
-
var key = program.command("key").description("
|
|
2713
|
+
var key = program.command("key").description("Create keys to manage your account from scripts or curl");
|
|
2734
2714
|
key.command("list").description("List developer keys in your team").option("--team <id|name>", "Team (defaults to active team)").option("--json", "Output machine-readable JSON").action(action((opts) => runKeyList(opts)));
|
|
2735
2715
|
key.command("mint").description("Mint a consumer-admin developer key (secret shown once)").option("--desc <text>", "Description").option("--expires-days <n>", "Expiry in days (default 90 server-side)").option("--team <id|name>", "Team (defaults to active team)").option("--json", "Output machine-readable JSON").action(action((opts) => runKeyMint(opts)));
|
|
2736
2716
|
key.command("revoke").description("Revoke a developer key").argument("<keyId>", "Key id (see `key list`)").option("--team <id|name>", "Team (defaults to active team)").action(action((keyId, opts) => runKeyRevoke(keyId, opts)));
|
|
2737
|
-
var spec = program.command("spec").description("
|
|
2717
|
+
var spec = program.command("spec").description("View or update a proxy's OpenAPI spec (or build one by chatting: apiblaze agent openapi)");
|
|
2738
2718
|
spec.command("get").description("Print the current OpenAPI document").argument("<project>", "Project name or id").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").option("--json", "Compact JSON output").action(action((project, opts) => runSpecGet(project, opts)));
|
|
2739
2719
|
spec.command("set").description("Replace the stored OpenAPI spec from a local file").argument("<project>", "Project name or id").requiredOption("--file <path>", "OpenAPI JSON or YAML file to upload").option("--team <id|name>", "Team the project is in").option("--apiversion <version>", "API version").option("--json", "Output machine-readable JSON").action(action((project, opts) => runSpecSet(project, opts)));
|
|
2740
|
-
program.command("agent").description("Chat with a producer assistant that can create/manage your proxies, tenants, keys, domains, and specs (billed per turn)").option("--team <id|name>", "Team to operate in (defaults to active team)").action(action((opts) => runAgent(opts)));
|
|
2741
2720
|
program.addHelpText(
|
|
2742
2721
|
"after",
|
|
2743
2722
|
`
|
|
2744
2723
|
Examples:
|
|
2745
|
-
#
|
|
2746
|
-
$ npx apiblaze
|
|
2747
|
-
|
|
2748
|
-
# Non-interactive (CI / scripts):
|
|
2749
|
-
$ npx apiblaze create --target https://api.example.com --name myapi --json
|
|
2724
|
+
# Just talk to it \u2014 create, configure, inspect your APIs by chatting:
|
|
2725
|
+
$ npx apiblaze agent
|
|
2750
2726
|
|
|
2751
|
-
#
|
|
2752
|
-
$ npx apiblaze
|
|
2753
|
-
$ npx apiblaze create --name myapi --target https://api.example.com --auth api_key
|
|
2727
|
+
# Make an API in one line (no account needed; prints a claim URL):
|
|
2728
|
+
$ npx apiblaze create --target https://api.example.com
|
|
2754
2729
|
|
|
2755
|
-
#
|
|
2756
|
-
# traffic (full headers + body, secrets masked) until your server is up:
|
|
2730
|
+
# Run your localhost through a public URL:
|
|
2757
2731
|
$ npx apiblaze dev 3000
|
|
2758
|
-
$ npx apiblaze dev 3000 --capture-file traffic.jsonl
|
|
2759
2732
|
|
|
2760
|
-
#
|
|
2761
|
-
$ npx apiblaze
|
|
2762
|
-
$ npx apiblaze
|
|
2763
|
-
$ npx apiblaze throttle myapi --rate 50 --quota 100000 --period daily
|
|
2764
|
-
$ npx apiblaze rename myapi --display-name "My API"
|
|
2733
|
+
# Or drive it yourself (add --verbose to see the equivalent API calls):
|
|
2734
|
+
$ npx apiblaze target myapi --url https://api.example.com
|
|
2735
|
+
$ npx apiblaze throttle myapi --rate 50
|
|
2765
2736
|
$ npx apiblaze domain add myapi --domain api.mysite.com
|
|
2766
|
-
$ npx apiblaze tenant create --name "Acme" && npx apiblaze tenant attach myapi --tenant acme
|
|
2767
|
-
$ npx apiblaze key mint --desc "ci key"
|
|
2768
|
-
$ npx apiblaze spec set myapi --file ./openapi.json
|
|
2769
2737
|
$ npx apiblaze delete myapi --verbose
|
|
2770
|
-
$ npx apiblaze whoami | team | logout
|
|
2771
|
-
|
|
2772
|
-
# Or just chat (billed per turn):
|
|
2773
|
-
$ npx apiblaze agent
|
|
2774
2738
|
`
|
|
2775
2739
|
);
|
|
2776
2740
|
function printError(err) {
|