@lukoweb/apitogo 0.2.59 → 0.2.61
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/dist/cli/cli.js +897 -527
- package/docs/cli/commands.md +6 -6
- package/docs/cli/go-live.md +12 -12
- package/docs/cli/overview.md +26 -27
- package/docs/cli/setup.md +38 -46
- package/docs/cli/shape.md +32 -35
- package/docs/cli/walkthrough.md +19 -19
- package/docs/components/slot.mdx +116 -116
- package/docs/configuration/api-reference.md +1 -1
- package/docs/configuration/authentication.md +3 -3
- package/docs/configuration/footer.mdx +89 -89
- package/docs/configuration/gateway.md +8 -8
- package/docs/configuration/make-config.mdx +20 -10
- package/docs/configuration/overview.md +3 -3
- package/docs/configuration/plans.md +5 -5
- package/docs/configuration/portal.md +36 -0
- package/docs/customization/colors-theme.mdx +255 -255
- package/docs/customization/fonts.md +105 -105
- package/docs/customization/landing-page.md +1 -1
- package/docs/deploy/apitogo.md +3 -3
- package/docs/deployment.md +3 -3
- package/docs/guides/custom-pages.md +3 -3
- package/docs/guides/customer-account.md +1 -1
- package/docs/guides/stripe-setup.mdx +9 -9
- package/docs/markdown/frontmatter.md +2 -2
- package/docs/mcp/go-live.md +7 -7
- package/docs/mcp/overview.md +58 -58
- package/docs/mcp/setup.md +6 -6
- package/docs/mcp/shape.md +2 -2
- package/docs/mcp/tools.md +57 -57
- package/docs/quickstart.md +6 -4
- package/docs/writing.mdx +68 -68
- package/package.json +1 -1
- package/src/config/apitogo-config-core.ts +11 -1
- package/src/config/v2/resolve.ts +19 -0
- package/src/config/v2/rules.ts +88 -0
- package/src/config/v2/schema.ts +28 -0
- package/src/config/v2/wrapper.ts +85 -13
- package/src/vite/config.ts +278 -273
- package/src/vite/markdown-output-path.ts +48 -0
- package/src/vite/plugin-markdown-export.ts +210 -214
- package/src/vite/prerender/prerender.ts +4 -4
- package/src/vite/watch-ignore.ts +19 -0
package/docs/cli/commands.md
CHANGED
|
@@ -62,7 +62,7 @@ Env: `APITOGO_API_KEY_ID`, `APITOGO_API_SECRET`. Optional: `APITOGO_API_URL`.
|
|
|
62
62
|
## Config version 2: add a service
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
|
|
65
|
+
apitogo add gateway
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
`add` puts one service (`portal`, `gateway`, `identity` or `plans`) into `apitogo.config.json`. In a
|
|
@@ -81,8 +81,8 @@ the flag to pass, and `--dry-run` shows the change without writing it.
|
|
|
81
81
|
## Config version 2: create the project, then deploy
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
apitogo project create
|
|
85
|
+
apitogo deploy
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
`project create` makes the platform project, selects the **Free** plan (or the plan from `--plan`),
|
|
@@ -115,7 +115,7 @@ A project on the **Free** platform plan can only publish free plans, and its lim
|
|
|
115
115
|
charge your customers, create the project on a paid platform plan:
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
|
-
|
|
118
|
+
apitogo project create --plan starter
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
The command makes the project, then prints a link to the platform's own checkout (and opens it in
|
|
@@ -136,8 +136,8 @@ See [Walkthrough: from an empty folder to a customer's first call](./walkthrough
|
|
|
136
136
|
### Move a folder to another project
|
|
137
137
|
|
|
138
138
|
```bash
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
apitogo project use fe3a12b0-fbaf-4315-b37f-b731d930ee57
|
|
140
|
+
apitogo deploy
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
`project use <id>` points the folder at another project you own, for good. It checks that the
|
package/docs/cli/go-live.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Go live with CLI
|
|
3
3
|
description: >-
|
|
4
|
-
Deploy your project with
|
|
4
|
+
Deploy your project with apitogo deploy: the hosting plan, the secrets deploy asks for, one
|
|
5
5
|
service at a time, and checking the result.
|
|
6
6
|
sidebar_icon: rocket
|
|
7
7
|
---
|
|
@@ -14,7 +14,7 @@ and plans.
|
|
|
14
14
|
1. Sign in to APItoGo once on this computer:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
|
|
17
|
+
apitogo login
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
In CI, set `APITOGO_API_KEY_ID` and `APITOGO_API_SECRET` (an API key from the dashboard) instead.
|
|
@@ -22,19 +22,19 @@ and plans.
|
|
|
22
22
|
2. Check the config:
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
|
|
25
|
+
apitogo check
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
## Deploy
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
|
|
31
|
+
apitogo deploy
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
On the first run, deploy creates the project: it asks for the hosting plan (**Free**, **Starter** or
|
|
35
35
|
**Professional**) and writes the project's id into `apitogo.config.json`. Starter and Professional
|
|
36
36
|
open the platform's checkout. To create the project without deploying, run
|
|
37
|
-
`
|
|
37
|
+
`apitogo project create --plan <plan>`.
|
|
38
38
|
|
|
39
39
|
Then it sets up each service and prints what it did:
|
|
40
40
|
|
|
@@ -58,8 +58,8 @@ Deploy asks, hidden, for the secrets the config needs and stores them as project
|
|
|
58
58
|
| `identity.connections` has a provider | That provider's client secret, under the name the config gives |
|
|
59
59
|
|
|
60
60
|
[Set up Stripe for paid plans](../guides/stripe-setup.mdx) shows where the Stripe values are. Set or
|
|
61
|
-
change a secret yourself with `
|
|
62
|
-
`
|
|
61
|
+
change a secret yourself with `apitogo secrets set <NAME>`, and list them with
|
|
62
|
+
`apitogo secrets list`.
|
|
63
63
|
|
|
64
64
|
Selling paid plans and using a custom domain need **Starter** or **Professional**. On **Free**,
|
|
65
65
|
deploy stops at a paid plan and says so.
|
|
@@ -67,8 +67,8 @@ deploy stops at a paid plan and says so.
|
|
|
67
67
|
## One service at a time
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
apitogo deploy --only portal
|
|
71
|
+
apitogo deploy --only gateway,plans
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
`--only` takes `portal`, `gateway`, `identity` and `plans`.
|
|
@@ -83,14 +83,14 @@ npx apitogo deploy --only gateway,plans
|
|
|
83
83
|
| `--json` | Print the result as JSON only |
|
|
84
84
|
| `--project-id` | Deploy to this project for this run only |
|
|
85
85
|
|
|
86
|
-
To move the folder to another project for good, use `
|
|
86
|
+
To move the folder to another project for good, use `apitogo project use <id>` (see
|
|
87
87
|
[Commands](./commands.md#move-a-folder-to-another-project)).
|
|
88
88
|
|
|
89
89
|
## After deploy
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
apitogo status # account, project and live checks
|
|
93
|
+
apitogo teardown --yes # delete the project and everything in it
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
## Your plans and APItoGo's
|
package/docs/cli/overview.md
CHANGED
|
@@ -6,20 +6,19 @@ sidebar_icon: terminal
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
The **`apitogo`** CLI lets you manage developer portals from the terminal. You scaffold and shape
|
|
9
|
-
local files, preview with `
|
|
10
|
-
`npx apitogo deploy`.
|
|
9
|
+
local files, preview with `apitogo run`, and publish to APItoGo hosting with `apitogo deploy`.
|
|
11
10
|
|
|
12
11
|
**First time?** Install and wire credentials → **[Install the CLI](./setup.md)**. Then follow
|
|
13
12
|
[Shape](./shape.md) and [Go live](./go-live.md).
|
|
14
13
|
|
|
15
14
|
## What you get
|
|
16
15
|
|
|
17
|
-
- Scaffold a local portal site (`
|
|
18
|
-
- Shape backend, OpenAPI, plans, and docs pages via `
|
|
19
|
-
- Preview locally (`
|
|
20
|
-
- Publish to APItoGo hosting (`
|
|
16
|
+
- Scaffold a local portal site (`apitogo init`)
|
|
17
|
+
- Shape backend, OpenAPI, plans, and docs pages via `apitogo config` and file edits
|
|
18
|
+
- Preview locally (`apitogo run`)
|
|
19
|
+
- Publish to APItoGo hosting (`apitogo deploy`) with platform plans **Free**, **Starter**, or
|
|
21
20
|
**Professional**
|
|
22
|
-
- Check live status (`
|
|
21
|
+
- Check live status (`apitogo status`) and tear down (`apitogo teardown --yes`)
|
|
23
22
|
|
|
24
23
|
## Prerequisites
|
|
25
24
|
|
|
@@ -39,21 +38,21 @@ local files, preview with `npx apitogo run`, and publish to APItoGo hosting with
|
|
|
39
38
|
|
|
40
39
|
## Changing your site
|
|
41
40
|
|
|
42
|
-
| Approach
|
|
43
|
-
|
|
|
44
|
-
| **`
|
|
45
|
-
| **Edit files directly**
|
|
41
|
+
| Approach | When it helps |
|
|
42
|
+
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| **`apitogo config`** | Wire OpenAPI, custom pages, gateway plans, and site title from the terminal. See [Make config](../configuration/make-config.mdx). |
|
|
44
|
+
| **Edit files directly** | Full control — `apitogo.config.json`, `pages/**`, `landing/LandingPage.tsx`, etc. |
|
|
46
45
|
|
|
47
46
|
Common CLI shape tasks:
|
|
48
47
|
|
|
49
|
-
| Change | How
|
|
50
|
-
| ------------------------------- |
|
|
51
|
-
| Backend runtime | `
|
|
52
|
-
| OpenAPI files (`gateway.specs`) | `
|
|
53
|
-
| Custom docs pages | `
|
|
54
|
-
| Gateway / API plans | `
|
|
55
|
-
| Site title | `--title` or edit `apitogo.config.json`
|
|
56
|
-
| Theme and fonts | Edit `apitogo/portal/theme.json`
|
|
48
|
+
| Change | How |
|
|
49
|
+
| ------------------------------- | ------------------------------------------------------------ |
|
|
50
|
+
| Backend runtime | `apitogo config` (backend) |
|
|
51
|
+
| OpenAPI files (`gateway.specs`) | `apitogo config` (openapi) |
|
|
52
|
+
| Custom docs pages | `apitogo config` (page) or add under `apitogo/portal/pages/` |
|
|
53
|
+
| Gateway / API plans | `apitogo config` (plan) or edit `apitogo/plans.json` |
|
|
54
|
+
| Site title | `--title` or edit `apitogo.config.json` |
|
|
55
|
+
| Theme and fonts | Edit `apitogo/portal/theme.json` |
|
|
57
56
|
|
|
58
57
|
The home page is `apitogo/portal/landing/LandingPage.tsx` and the footer
|
|
59
58
|
`apitogo/portal/footer/Footer.tsx`, named by `portal.landing` and `portal.footer`.
|
|
@@ -65,20 +64,20 @@ The home page is `apitogo/portal/landing/LandingPage.tsx` and the footer
|
|
|
65
64
|
| `apitogo.config.json` | The services: portal, gateway, identity, plans |
|
|
66
65
|
| `apitogo/` | Pages, plans, theme, OpenAPI files |
|
|
67
66
|
|
|
68
|
-
Secrets are project secrets (`
|
|
67
|
+
Secrets are project secrets (`apitogo secrets set`), never files. Details:
|
|
69
68
|
[Configuration overview](../configuration/overview.md).
|
|
70
69
|
|
|
71
70
|
## CLI vs MCP
|
|
72
71
|
|
|
73
72
|
Each MCP tool runs one CLI command in the project folder, so both give the same result.
|
|
74
73
|
|
|
75
|
-
| Task | CLI
|
|
76
|
-
| ----------------- |
|
|
77
|
-
| Create | `
|
|
78
|
-
| Shape config | `
|
|
79
|
-
| Preview | `
|
|
80
|
-
| Deploy | `
|
|
81
|
-
| Status / teardown | `
|
|
74
|
+
| Task | CLI | MCP (agent) |
|
|
75
|
+
| ----------------- | ------------------------------------- | ------------------------------------- |
|
|
76
|
+
| Create | `apitogo create` | `apitogo_create` |
|
|
77
|
+
| Shape config | `apitogo config` + file edits | `apitogo_config` + file edits |
|
|
78
|
+
| Preview | `apitogo run` | `apitogo run` (you start it) |
|
|
79
|
+
| Deploy | `apitogo plan` / `apitogo deploy` | `apitogo_plan` / `apitogo_deploy` |
|
|
80
|
+
| Status / teardown | `apitogo status` / `apitogo teardown` | `apitogo_status` / `apitogo_teardown` |
|
|
82
81
|
|
|
83
82
|
Prefer MCP when an agent should drive changes. Prefer CLI for CI, scripts, or terminal-only
|
|
84
83
|
workflows.
|
package/docs/cli/setup.md
CHANGED
|
@@ -6,35 +6,47 @@ sidebar_icon: terminal
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
Use the **`apitogo`** CLI (`@lukoweb/apitogo`) to scaffold a local portal, shape
|
|
9
|
-
`apitogo.config.json`, preview with `
|
|
9
|
+
`apitogo.config.json`, preview with `apitogo run`, and publish with `apitogo deploy`. The
|
|
10
10
|
[MCP tools](../mcp/tools.md) run these same commands for an agent.
|
|
11
11
|
|
|
12
|
-
Examples in these docs
|
|
13
|
-
|
|
12
|
+
Examples in these docs run **`apitogo`** directly, so they assume you have installed the CLI
|
|
13
|
+
globally (see [Install](#install)).
|
|
14
14
|
|
|
15
15
|
## Prerequisites
|
|
16
16
|
|
|
17
17
|
- **Node.js 20+**
|
|
18
|
-
- Platform API credentials from [apitogo.com](https://apitogo.com) when you run `
|
|
18
|
+
- Platform API credentials from [apitogo.com](https://apitogo.com) when you run `apitogo deploy`
|
|
19
19
|
(API key id + secret)
|
|
20
20
|
|
|
21
21
|
## Install
|
|
22
22
|
|
|
23
|
-
The CLI is the npm package **`@lukoweb/apitogo`**. It exposes the **`apitogo`** binary.
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
The CLI is the npm package **`@lukoweb/apitogo`**. It exposes the **`apitogo`** binary. Install it
|
|
24
|
+
globally once:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g @lukoweb/apitogo
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Then check that it works from any folder:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
apitogo --help
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Upgrade later with `npm install -g @lukoweb/apitogo@latest`. Uninstall with
|
|
37
|
+
`npm uninstall -g @lukoweb/apitogo`.
|
|
26
38
|
|
|
27
39
|
### New project (recommended)
|
|
28
40
|
|
|
29
|
-
`
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
`apitogo init` creates a config version 2 project in the current folder. It shows what it will
|
|
42
|
+
create and asks first (pass `--yes` to skip the question), writes `apitogo.config.json`, uses an
|
|
43
|
+
existing `docs/` folder in place, and, in a new folder, creates `package.json` and installs
|
|
44
|
+
`@lukoweb/apitogo`, `react` and `react-dom`:
|
|
33
45
|
|
|
34
46
|
```bash
|
|
35
47
|
mkdir my-portal && cd my-portal
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
apitogo init --name "Books API"
|
|
49
|
+
apitogo run
|
|
38
50
|
```
|
|
39
51
|
|
|
40
52
|
In an existing project the tool never edits your `package.json`. It prints the install command to
|
|
@@ -43,9 +55,9 @@ run instead.
|
|
|
43
55
|
Named folder or site name:
|
|
44
56
|
|
|
45
57
|
```bash
|
|
46
|
-
|
|
58
|
+
apitogo init ./my-portal --name "Books API"
|
|
47
59
|
cd ./my-portal
|
|
48
|
-
|
|
60
|
+
apitogo run
|
|
49
61
|
```
|
|
50
62
|
|
|
51
63
|
#### Scaffold options
|
|
@@ -59,39 +71,19 @@ npx apitogo run
|
|
|
59
71
|
| `--force` | Replace an existing `apitogo.config.json` |
|
|
60
72
|
| `--json` | Print a JSON result payload on stdout |
|
|
61
73
|
|
|
62
|
-
`
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
### How to run `apitogo`
|
|
74
|
+
`apitogo init` is local only — it does not call the platform. After `config`, run `apitogo run` to
|
|
75
|
+
preview, then `apitogo deploy` when ready to go live.
|
|
66
76
|
|
|
67
|
-
|
|
68
|
-
| --------------------------------------------------------- | --------------------------------------------------- |
|
|
69
|
-
| After `init` or `npm install` in the project | `npx apitogo <command>` (e.g. `npx apitogo config`) |
|
|
70
|
-
| One-off, no project yet | `npx @lukoweb/apitogo <command>` |
|
|
71
|
-
| After [optional global install](#optional-global-install) | `apitogo <command>` anywhere |
|
|
77
|
+
### Global CLI and project scripts
|
|
72
78
|
|
|
73
|
-
|
|
74
|
-
install required.
|
|
79
|
+
With the global install, run `apitogo <command>` from any folder (for example `apitogo config`).
|
|
75
80
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm install -g @lukoweb/apitogo
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Then run `apitogo` from any directory:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
apitogo --help
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Upgrade later with `npm install -g @lukoweb/apitogo@latest`. Uninstall with
|
|
89
|
-
`npm uninstall -g @lukoweb/apitogo`. Prefer `npx apitogo` in projects so each site uses the version
|
|
90
|
-
in its `package.json`.
|
|
81
|
+
Projects made by `init` or `create` also list `@lukoweb/apitogo` in their `package.json`, so
|
|
82
|
+
`npm run dev` and `npm run build` use the version pinned in that project.
|
|
91
83
|
|
|
92
84
|
## Platform credentials
|
|
93
85
|
|
|
94
|
-
Export these before `
|
|
86
|
+
Export these before `apitogo deploy`, `apitogo status`, or `apitogo teardown`:
|
|
95
87
|
|
|
96
88
|
| Variable | Required | Purpose |
|
|
97
89
|
| -------------------- | -------- | ----------------- |
|
|
@@ -106,12 +98,12 @@ Optional:
|
|
|
106
98
|
| `APITOGO_CLI_PATH` | Local `@lukoweb/apitogo` / doc-tool checkout for MCP spawn |
|
|
107
99
|
|
|
108
100
|
Never commit secrets. Secrets such as the Stripe key are project secrets: deploy asks for them, and
|
|
109
|
-
`
|
|
101
|
+
`apitogo secrets set <NAME>` changes them. See [Go live](./go-live.md).
|
|
110
102
|
|
|
111
103
|
## Verify
|
|
112
104
|
|
|
113
105
|
```bash
|
|
114
|
-
|
|
106
|
+
apitogo --help
|
|
115
107
|
```
|
|
116
108
|
|
|
117
109
|
You should see `init`, `config`, `run`, `build`, `deploy`, `status`, and `teardown`.
|
|
@@ -119,12 +111,12 @@ You should see `init`, `config`, `run`, `build`, `deploy`, `status`, and `teardo
|
|
|
119
111
|
With credentials set:
|
|
120
112
|
|
|
121
113
|
```bash
|
|
122
|
-
|
|
114
|
+
apitogo status
|
|
123
115
|
```
|
|
124
116
|
|
|
125
117
|
## Next
|
|
126
118
|
|
|
127
119
|
- [CLI overview](./overview.md)
|
|
128
120
|
- [Shape](./shape.md) — scaffold and local preview
|
|
129
|
-
- [Go live](./go-live.md) — `
|
|
121
|
+
- [Go live](./go-live.md) — `apitogo deploy`
|
|
130
122
|
- [Commands](./commands.md) — full catalog
|
package/docs/cli/shape.md
CHANGED
|
@@ -1,43 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Shape with CLI
|
|
3
|
-
description:
|
|
4
|
-
Scaffold and customize a developer portal locally with npx apitogo init, config, and run.
|
|
3
|
+
description: Scaffold and customize a developer portal locally with apitogo init, config, and run.
|
|
5
4
|
sidebar_icon: pencil-ruler
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
**Shape** means: create or update a local portal site (OpenAPI, plans, docs pages, auth) without
|
|
9
|
-
publishing. You preview with `
|
|
8
|
+
publishing. You preview with `apitogo run`.
|
|
10
9
|
|
|
11
10
|
Requires the **`apitogo`** CLI (`@lukoweb/apitogo`). If you have not installed it yet, see
|
|
12
11
|
[Install the CLI](./setup.md).
|
|
13
12
|
|
|
14
13
|
## Happy path
|
|
15
14
|
|
|
16
|
-
`
|
|
17
|
-
|
|
18
|
-
`npx apitogo config`:
|
|
15
|
+
`apitogo init` creates a project in the current folder: it writes `apitogo.config.json`, uses an
|
|
16
|
+
existing `docs/` folder, and installs the CLI. Then shape it with `apitogo config`:
|
|
19
17
|
|
|
20
18
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
apitogo init
|
|
20
|
+
apitogo config # backend, OpenAPI, pages, plans (apply each immediately)
|
|
21
|
+
apitogo run # http://localhost:3000
|
|
24
22
|
```
|
|
25
23
|
|
|
26
24
|
Named folder:
|
|
27
25
|
|
|
28
26
|
```bash
|
|
29
|
-
|
|
27
|
+
apitogo init ./my-portal --name "Books API"
|
|
30
28
|
cd ./my-portal
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
apitogo config
|
|
30
|
+
apitogo run
|
|
33
31
|
```
|
|
34
32
|
|
|
35
|
-
`
|
|
36
|
-
ready to go live.
|
|
33
|
+
`apitogo init` does **not** call the platform. Run `apitogo deploy` when you are ready to go live.
|
|
37
34
|
|
|
38
|
-
## Interactive config (`
|
|
35
|
+
## Interactive config (`apitogo config`)
|
|
39
36
|
|
|
40
|
-
On a TTY, bare `
|
|
37
|
+
On a TTY, bare `apitogo config` opens the wizard. Each choice is written immediately; the loop
|
|
41
38
|
continues until you type `done`:
|
|
42
39
|
|
|
43
40
|
| Choice | What it does |
|
|
@@ -49,8 +46,8 @@ continues until you type `done`:
|
|
|
49
46
|
|
|
50
47
|
Fonts and colors are **not** prompted. See [Colors & theme](../customization/colors-theme.mdx).
|
|
51
48
|
|
|
52
|
-
**Paid plans:** payments go through Stripe. Once a plan has a price, `
|
|
53
|
-
|
|
49
|
+
**Paid plans:** payments go through Stripe. Once a plan has a price, `apitogo deploy` asks for your
|
|
50
|
+
Stripe secret key (if the project has none yet) and stores it as a project secret. Free and
|
|
54
51
|
contact-us plans need no key. [Set up Stripe for paid plans](../guides/stripe-setup.mdx) shows where
|
|
55
52
|
to find the key and how to add the webhook, with pictures. Paid plans also need **Starter** or
|
|
56
53
|
**Professional** platform hosting; **Free** cannot publish paid gateway plans or custom domains.
|
|
@@ -64,10 +61,10 @@ Changes a config version 2 project. Every change to `apitogo.config.json` is che
|
|
|
64
61
|
written. The command does not create a project: use `init` or `create` for that.
|
|
65
62
|
|
|
66
63
|
```bash
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
apitogo config --title "Books API"
|
|
65
|
+
apitogo config --page-slug guides/quickstart --page-title "Quickstart"
|
|
66
|
+
apitogo config --plan '{"sku":"free","displayName":"Free"}'
|
|
67
|
+
apitogo config --no-interactive
|
|
71
68
|
```
|
|
72
69
|
|
|
73
70
|
Common flags:
|
|
@@ -84,7 +81,7 @@ Common flags:
|
|
|
84
81
|
|
|
85
82
|
## Shape by editing files
|
|
86
83
|
|
|
87
|
-
After `
|
|
84
|
+
After `apitogo config`, edit the manifest and site files directly:
|
|
88
85
|
|
|
89
86
|
- **Services, backend, OpenAPI files** — `apitogo.config.json`
|
|
90
87
|
- **Plans** — `apitogo/plans.json`
|
|
@@ -160,14 +157,14 @@ Each card in `apitogo/plans.json` lists, in this order:
|
|
|
160
157
|
}
|
|
161
158
|
```
|
|
162
159
|
|
|
163
|
-
`
|
|
160
|
+
`apitogo run` shows the same cards as the deployed portal.
|
|
164
161
|
|
|
165
162
|
## Add a portal from scratch
|
|
166
163
|
|
|
167
164
|
In a project that has no portal yet:
|
|
168
165
|
|
|
169
166
|
```bash
|
|
170
|
-
|
|
167
|
+
apitogo add portal
|
|
171
168
|
```
|
|
172
169
|
|
|
173
170
|
It adds `portal` to `apitogo.config.json` and writes the files above: `introduction.mdx` (the
|
|
@@ -176,20 +173,20 @@ footer. Docs you already have (a `docs/` folder, for example) are used instead o
|
|
|
176
173
|
`--docs <path>` to name them. Files that exist are never overwritten.
|
|
177
174
|
|
|
178
175
|
Never put secrets in `apitogo.config.json`: the config names a project secret (`secret:NAME`), and
|
|
179
|
-
`
|
|
176
|
+
`apitogo secrets set NAME` stores the value.
|
|
180
177
|
|
|
181
178
|
## Preview locally
|
|
182
179
|
|
|
183
180
|
```bash
|
|
184
|
-
|
|
185
|
-
|
|
181
|
+
apitogo run
|
|
182
|
+
apitogo run --port 4000 --open
|
|
186
183
|
```
|
|
187
184
|
|
|
188
185
|
Production build check:
|
|
189
186
|
|
|
190
187
|
```bash
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
apitogo build
|
|
189
|
+
apitogo build --preview
|
|
193
190
|
```
|
|
194
191
|
|
|
195
192
|
Shape-phase edits hot-reload when the dev server is running.
|
|
@@ -197,14 +194,14 @@ Shape-phase edits hot-reload when the dev server is running.
|
|
|
197
194
|
## Existing docs + OpenAPI folder
|
|
198
195
|
|
|
199
196
|
In a folder that already has docs and an OpenAPI file, run `init` there: it uses the `docs/` folder
|
|
200
|
-
in place, and `
|
|
197
|
+
in place, and `apitogo config` (openapi) adds the OpenAPI file:
|
|
201
198
|
|
|
202
199
|
```bash
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
200
|
+
apitogo init
|
|
201
|
+
apitogo config
|
|
202
|
+
apitogo run
|
|
206
203
|
```
|
|
207
204
|
|
|
208
205
|
## Next
|
|
209
206
|
|
|
210
|
-
When the site looks right, [go live](./go-live.md) with `
|
|
207
|
+
When the site looks right, [go live](./go-live.md) with `apitogo deploy`.
|
package/docs/cli/walkthrough.md
CHANGED
|
@@ -25,19 +25,19 @@ their own key. Every step is a command you run, or something your customer does
|
|
|
25
25
|
## 1. Create the project folder
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
|
|
28
|
+
apitogo init my-portal --yes --name my-portal
|
|
29
29
|
cd my-portal
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
`init` creates a config version 2 project with a portal, and installs the CLI into it. The commands
|
|
33
|
-
below use the installed CLI through `
|
|
33
|
+
below use the installed CLI through `apitogo`.
|
|
34
34
|
|
|
35
35
|
## 2. Add the services
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
apitogo add identity
|
|
39
|
+
apitogo add gateway --origin proxy --url https://httpbin.org --auth identity --create-spec
|
|
40
|
+
apitogo add plans --template free
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
| Service | What it gives you |
|
|
@@ -59,8 +59,8 @@ replaced.
|
|
|
59
59
|
## 3. Create the platform project and deploy
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
apitogo project create
|
|
63
|
+
apitogo deploy
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
`deploy` runs the services in a fixed order and prints what it did:
|
|
@@ -77,8 +77,8 @@ The portal's address is only known once the portal is published. The gateway onl
|
|
|
77
77
|
calls from addresses it knows, so `deploy` sends the gateway its list again after the portal. One
|
|
78
78
|
`deploy` is enough: you do not need to run it twice.
|
|
79
79
|
|
|
80
|
-
Running `deploy` again changes only what changed. Use `
|
|
81
|
-
`
|
|
80
|
+
Running `deploy` again changes only what changed. Use `apitogo status` to see each service and
|
|
81
|
+
`apitogo plan` to see what the next deploy would do.
|
|
82
82
|
|
|
83
83
|
## 4. The customer's side
|
|
84
84
|
|
|
@@ -113,22 +113,22 @@ The customer sees their calls on the **Usage** page. See
|
|
|
113
113
|
Free plans need no payment. To charge your customers, the project needs two things: a Starter or
|
|
114
114
|
Professional plan with APItoGo, and your own Stripe account. Your customers pay you, not APItoGo.
|
|
115
115
|
|
|
116
|
-
1. Create the project on a paid platform plan: `
|
|
117
|
-
|
|
116
|
+
1. Create the project on a paid platform plan: `apitogo project create --plan starter`. This opens
|
|
117
|
+
the platform's checkout for the hosting fee. A project that already exists on the Free plan
|
|
118
118
|
cannot be moved: create a new one. See
|
|
119
119
|
[Selling paid plans needs Starter or Professional](./commands.md#selling-paid-plans-needs-starter-or-professional).
|
|
120
120
|
2. Give a plan a price in `plans.json`: `"priceAmount": 49`, `"priceCurrency": "usd"` and
|
|
121
121
|
`"billingInterval": "month"`. Its limits cannot be higher than your platform plan allows.
|
|
122
122
|
Payments go through Stripe; nothing else in the config changes.
|
|
123
|
-
3. Deploy: `
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
`
|
|
127
|
-
|
|
123
|
+
3. Deploy: `apitogo deploy`. Because a plan now has a price, deploy asks for your Stripe secret key
|
|
124
|
+
(it starts with `sk_test_` while you test) and stores it as the project secret `STRIPE_API_KEY`,
|
|
125
|
+
so it stays out of your files. You can also store it beforehand with
|
|
126
|
+
`apitogo secrets set STRIPE_API_KEY`. The output says whether Stripe is in test or live mode and
|
|
127
|
+
prints your portal's webhook address.
|
|
128
128
|
4. In Stripe, add that address as a webhook endpoint with the events `checkout.session.completed`,
|
|
129
129
|
`customer.subscription.updated`, `customer.subscription.deleted` and `invoice.payment_failed`.
|
|
130
130
|
Copy the signing secret (it starts with `whsec_`), store it with
|
|
131
|
-
`
|
|
131
|
+
`apitogo secrets set STRIPE_WEBHOOK`, add
|
|
132
132
|
`"plans": { "billing": { "webhookSecret": "secret:STRIPE_WEBHOOK" } }` to `apitogo.config.json`,
|
|
133
133
|
and deploy again. Until then a payment does not activate the plan, because the portal cannot
|
|
134
134
|
confirm it came from Stripe.
|
|
@@ -139,7 +139,7 @@ money moves. Never type a live key until you have tested the whole path.
|
|
|
139
139
|
## 6. Remove a test project
|
|
140
140
|
|
|
141
141
|
```bash
|
|
142
|
-
|
|
142
|
+
apitogo teardown --yes
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
This deletes the platform project: the gateway, the identity and its users, the portal, its address
|
|
@@ -151,7 +151,7 @@ and certificate, and the project's email domain. Your local files stay.
|
|
|
151
151
|
- **Sign-up needs a real email address.** Confirmation and password-reset emails are sent to it. For
|
|
152
152
|
tests, an address with a suffix such as `you+test1@example.com` usually reaches your own mailbox.
|
|
153
153
|
- **Secrets stay out of the config.** A value such as an origin key is written as `secret:NAME` and
|
|
154
|
-
set with `
|
|
154
|
+
set with `apitogo secrets`.
|
|
155
155
|
|
|
156
156
|
## Related
|
|
157
157
|
|