@the-meridian/cli 1.2.0 → 1.4.0
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/CHANGELOG.md +17 -0
- package/README.md +21 -17
- package/dist/index.js +252 -635
- package/dist/index.js.map +1 -1
- package/dist/skill/SKILL.md +72 -0
- package/dist/skill/references/cli.md +54 -0
- package/dist/skill/references/hosting.md +54 -0
- package/dist/skill/references/sdk.md +71 -0
- package/dist/skill/references/setup.md +68 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @the-meridian/cli
|
|
2
2
|
|
|
3
|
+
## 1.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 20c9059: New `meridian skills install`: writes the Meridian agent skill into the project for Claude Code (`.claude/skills/meridian`), Codex (`.agents/skills/meridian`) and Cursor (`.cursor/skills/meridian`), and adds the Meridian MCP server to each agent's project config, merging with what is there. `meridian login --json` now prints the device code and URL on stderr, so the login can be approved instead of waiting with nothing to show.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 04cb7ba: The stored CLI token is only sent to the API that issued it. When `MERIDIAN_API_URL` or `--api-url` points somewhere else (for example after a shell sourced an app's `.env`), commands stop with an error instead of sending the token there, and `meridian login` signs in to that API afresh. `meridian login` now always records the API it signed in to.
|
|
12
|
+
- 621147d: Raise the `zod` dependency floor to `^4.6.6`, the first release that fixes advisory GHSA-mrhx-c7xc-m3w5. No change to commands or output.
|
|
13
|
+
|
|
14
|
+
## 1.3.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- ea031dc: `meridian dev`, `migrate` and `db` connect only through the Meridian database gateway. The Cloud SQL Auth Proxy path is gone: the CLI no longer downloads `cloud-sql-proxy`, `~/.meridian/bin` is no longer used (you can delete it), and `MERIDIAN_PROXY_PATH`, `MERIDIAN_PROXY_VERSION` and `MERIDIAN_PROXY_SKIP_CHECKSUM` are no longer read.
|
|
19
|
+
|
|
3
20
|
## 1.2.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A managed remote MySQL development database for every developer on your team, with no local database setup.
|
|
4
4
|
|
|
5
|
-
`meridian dev` provisions a private MySQL 8.4 database on Meridian's Cloud SQL instance,
|
|
5
|
+
`meridian dev` provisions a private MySQL 8.4 database on Meridian's Cloud SQL instance, opens a local connection to it through the Meridian database gateway, writes `DATABASE_URL` into your `.env`, and runs your app's dev server. Prisma, `mysql`, and anything else that reads `DATABASE_URL` then talk to `127.0.0.1` as if the database were local.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install -g @the-meridian/cli
|
|
@@ -17,7 +17,7 @@ meridian dev # every day
|
|
|
17
17
|
- Node.js 20 or newer
|
|
18
18
|
- A Meridian account with access to at least one organization and app
|
|
19
19
|
|
|
20
|
-
You do **not** need Docker, a local MySQL server, `gcloud`, or
|
|
20
|
+
You do **not** need Docker, a local MySQL server, `gcloud`, or any proxy. The CLI connects to your database itself, with a certificate issued for you alone.
|
|
21
21
|
|
|
22
22
|
## How it works
|
|
23
23
|
|
|
@@ -26,14 +26,13 @@ meridian dev
|
|
|
26
26
|
│
|
|
27
27
|
├─ POST /app/cli/apps/{app}/dev-database ensure a database exists (polls until ready)
|
|
28
28
|
├─ POST …/dev-database/credentials short-lived MySQL user + password
|
|
29
|
-
├─ POST …/dev-database/
|
|
30
|
-
├─
|
|
31
|
-
├─ spawn proxy on 127.0.0.1:<free port> token passed in the environment, refreshed before it expires
|
|
29
|
+
├─ POST …/dev-database/certificate 24-hour client certificate for a key generated in memory
|
|
30
|
+
├─ forwarder on 127.0.0.1:<free port> TLS to the Meridian database gateway, certificate renewed before it expires
|
|
32
31
|
├─ patch DATABASE_URL into .env every other line preserved
|
|
33
32
|
└─ run your dev command npm run dev by default
|
|
34
33
|
```
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
The connection and your dev server are shut down together: quitting your dev server closes the connection, and Ctrl-C stops both.
|
|
37
36
|
|
|
38
37
|
## Commands
|
|
39
38
|
|
|
@@ -49,6 +48,8 @@ Device-code login: prints a short user code, opens your browser to the verificat
|
|
|
49
48
|
| `--no-browser` | Print the URL instead of opening a browser (also implied by `CI` or `MERIDIAN_NO_BROWSER`) |
|
|
50
49
|
| `--hostname <name>` | Hostname reported to Meridian for this device |
|
|
51
50
|
|
|
51
|
+
With `--json`, the code and URL still go to stderr, so the login can be approved while stdout carries only the JSON result.
|
|
52
|
+
|
|
52
53
|
### `meridian logout`
|
|
53
54
|
|
|
54
55
|
Deletes the stored token. Leaves `.meridian/project.json` alone, and exits `0` when you were not logged in.
|
|
@@ -109,6 +110,17 @@ meridian db credential revoke aws-backend --env production --yes
|
|
|
109
110
|
|
|
110
111
|
Creating and rotating credentials happen in the dashboard (Hosting > Database > External access), behind a browser session: a CLI token cannot issue database access. Revoking needs the Credentials: Manage permission on the app.
|
|
111
112
|
|
|
113
|
+
### `meridian skills install`
|
|
114
|
+
|
|
115
|
+
Installs the Meridian agent skill in the project, so Claude Code, Codex and Cursor know how to use Meridian: the CLI, the SDK, hosting and the Meridian MCP server. It writes the skill to `.claude/skills/meridian`, `.agents/skills/meridian` (Codex) and `.cursor/skills/meridian`, and adds the Meridian MCP server to `.mcp.json`, `.codex/config.toml` and `.cursor/mcp.json`. Existing config files are merged, never overwritten. Run it again after upgrading the CLI to update the skill.
|
|
116
|
+
|
|
117
|
+
| Flag | Behavior |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| `--agent <agents>` | `claude`, `codex`, `cursor` (comma-separated) or `all`. Default: the agents the project already uses (`.claude/`, `CLAUDE.md`, `.codex/`, `.agents/`, `AGENTS.md`, `.cursor/`), or all three |
|
|
120
|
+
| `--no-mcp` | Install the skill only |
|
|
121
|
+
|
|
122
|
+
Replacing a skill folder that differs from this CLI's version asks first (`--yes` to approve).
|
|
123
|
+
|
|
112
124
|
### Global flags
|
|
113
125
|
|
|
114
126
|
Accepted before or after the command name, so both `meridian --json whoami` and `meridian whoami --json` work.
|
|
@@ -129,7 +141,6 @@ Accepted before or after the command name, so both `meridian --json whoami` and
|
|
|
129
141
|
| Path | Contents |
|
|
130
142
|
| --- | --- |
|
|
131
143
|
| `~/.meridian/config.json` | `token`, `token_expires_at`, `user`, `api_base_url`. Mode `0600` |
|
|
132
|
-
| `~/.meridian/bin/` | Cached, checksum-verified `cloud-sql-proxy` binaries |
|
|
133
144
|
| `<project>/.meridian/project.json` | `org_id`, `app_id`, `app_name`, optional `dev_command` and `skip_datasource_check` |
|
|
134
145
|
| `<project>/.meridian/snapshots/` | Pre-migration dumps, pruned to the newest few |
|
|
135
146
|
| `<project>/.meridian/.gitignore` | Written for you, so snapshots and logs stay out of git |
|
|
@@ -196,9 +207,6 @@ Prompts are skipped automatically when stdin/stderr aren't TTYs, when `CI` is se
|
|
|
196
207
|
| `MERIDIAN_NO_BROWSER` | Same as `login --no-browser` |
|
|
197
208
|
| `MERIDIAN_DEV_ACTIVE` | Set to `1` in every process `meridian dev` starts. Read it to detect that your script is already inside a session; setting it yourself makes `meridian dev` refuse to start |
|
|
198
209
|
| `MERIDIAN_DEV_DATABASE_ID` | Exported (alongside `DATABASE_URL`) into the children of `meridian dev`, `migrate` and `db …`, holding the id of the dev database that session provisioned. The Meridian SDK sends it as `devDatabaseId` on its identify call, so installs a locally-run app creates are billed to your dev database. Set by the CLI only. Never set it yourself |
|
|
199
|
-
| `MERIDIAN_PROXY_PATH` | Use an existing proxy binary instead of downloading one |
|
|
200
|
-
| `MERIDIAN_PROXY_VERSION` | Pin a different proxy version (checksum is fetched from that release) |
|
|
201
|
-
| `MERIDIAN_PROXY_SKIP_CHECKSUM=1` | Allow install when no checksum is published. Use only if you trust the source |
|
|
202
210
|
| `NO_COLOR` / `FORCE_COLOR` | Color detection |
|
|
203
211
|
|
|
204
212
|
Read commands support `--json`. Errors are also JSON in that mode:
|
|
@@ -219,19 +227,15 @@ Read commands support `--json`. Errors are also JSON in that mode:
|
|
|
219
227
|
|
|
220
228
|
**`The development database is not ready yet.`**: A credentials or reset call arrived before provisioning finished (HTTP 409). `meridian dev` polls for you, so this normally only appears when a command runs against a database that is still being created.
|
|
221
229
|
|
|
222
|
-
**`Could not reach 127.0.0.1:<port>/<db> (ECONNREFUSED).`**: Nothing is listening. `meridian dev` and `meridian migrate`
|
|
230
|
+
**`Could not reach 127.0.0.1:<port>/<db> (ECONNREFUSED).`**: Nothing is listening. `meridian dev` and `meridian migrate` open the connection themselves; if you're running Prisma directly, keep `meridian dev` running in another terminal.
|
|
223
231
|
|
|
224
|
-
**`Timed out waiting for MySQL …`**: The
|
|
232
|
+
**`Timed out waiting for MySQL …`**: The local forwarder is up but can't reach the Meridian database gateway (`db.the-meridian.app:3306`). Check whether a VPN, firewall, or corporate proxy blocks outbound connections on port 3306, then retry with `--verbose`.
|
|
225
233
|
|
|
226
234
|
**`Another process is already listening on that port.`**: Pass `--port` to choose a different one.
|
|
227
235
|
|
|
228
|
-
**Proxy download fails** (air-gapped network, blocked storage.googleapis.com): Install the [Cloud SQL Auth Proxy](https://github.com/GoogleCloudPlatform/cloud-sql-proxy) yourself and set `MERIDIAN_PROXY_PATH` to it.
|
|
229
|
-
|
|
230
|
-
**Checksum verification failed**: A cached binary that no longer matches its published SHA-256 is deleted and downloaded again automatically. If a fresh download also fails verification the CLI refuses to install it, which usually means something on the network is rewriting the response. Don't reach for `MERIDIAN_PROXY_SKIP_CHECKSUM` in that situation.
|
|
231
|
-
|
|
232
236
|
**A migration failed and left the schema half-applied**: `meridian migrate` restores the pre-migration snapshot automatically. To redo it by hand, use the newest file in `.meridian/snapshots/`, or run `meridian db reset` for a clean slate.
|
|
233
237
|
|
|
234
|
-
**The rollback itself failed**: Treat the database as unsafe: the reset succeeded but the replay didn't finish, so the schema is partial.
|
|
238
|
+
**The rollback itself failed**: Treat the database as unsafe: the reset succeeded but the replay didn't finish, so the schema is partial. Open the connection with `meridian dev` in another terminal and replay the snapshot by hand (`mysql … < .meridian/snapshots/<timestamp>.sql`, or `meridian db shell` and paste it), or take the clean slate with `meridian db reset --migrate`. The failing statement's index is in the error message.
|
|
235
239
|
|
|
236
240
|
**`meridian dev` says it would call itself**: Your `npm run dev` script invokes `meridian dev`. Point `dev_command` in `.meridian/project.json` at the real dev server (for example `next dev`), or run `meridian dev -- next dev`.
|
|
237
241
|
|