@akal/supaforge 0.0.32 → 0.0.33

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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +28 -10
  3. package/dist/commands/mcp.d.ts +1 -0
  4. package/dist/commands/mcp.js +11 -1
  5. package/package.json +10 -8
  6. package/bin/dev.js +0 -10
  7. package/dist/base-command.js.map +0 -1
  8. package/dist/chunk-2SELREHW.js.map +0 -1
  9. package/dist/chunk-3HGAV5CC.js.map +0 -1
  10. package/dist/chunk-4IVN7QVY.js.map +0 -1
  11. package/dist/chunk-6LJERPUN.js.map +0 -1
  12. package/dist/chunk-6Q7MHFBM.js.map +0 -1
  13. package/dist/chunk-6WAMNZLO.js.map +0 -1
  14. package/dist/chunk-7NAZGZPV.js.map +0 -1
  15. package/dist/chunk-BLKJWDTL.js.map +0 -1
  16. package/dist/chunk-BUOWHE36.js.map +0 -1
  17. package/dist/chunk-DMIWAJRB.js.map +0 -1
  18. package/dist/chunk-DQQ5E563.js.map +0 -1
  19. package/dist/chunk-G2DIPIYU.js.map +0 -1
  20. package/dist/chunk-GEHPTPNZ.js.map +0 -1
  21. package/dist/chunk-GZREXCQZ.js.map +0 -1
  22. package/dist/chunk-MIRLB5JM.js.map +0 -1
  23. package/dist/chunk-NTUASFQ3.js.map +0 -1
  24. package/dist/chunk-ORQJVE57.js.map +0 -1
  25. package/dist/chunk-SC2XHGIS.js.map +0 -1
  26. package/dist/chunk-SQPCWGQO.js.map +0 -1
  27. package/dist/chunk-UWAVXC57.js.map +0 -1
  28. package/dist/commands/clone.js.map +0 -1
  29. package/dist/commands/diff.js.map +0 -1
  30. package/dist/commands/help.js.map +0 -1
  31. package/dist/commands/hukam.js.map +0 -1
  32. package/dist/commands/init.js.map +0 -1
  33. package/dist/commands/mcp.js.map +0 -1
  34. package/dist/commands/migrate/baseline.js.map +0 -1
  35. package/dist/commands/migrate/create.js.map +0 -1
  36. package/dist/commands/migrate/list.js.map +0 -1
  37. package/dist/commands/migrate/run.js.map +0 -1
  38. package/dist/commands/report.js.map +0 -1
  39. package/dist/commands/restore.js.map +0 -1
  40. package/dist/commands/snapshot.js.map +0 -1
  41. package/dist/commands/sync.js.map +0 -1
  42. package/dist/help.js.map +0 -1
  43. package/dist/index.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Akal Software Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -51,7 +51,7 @@ Everything that writes previews first. Add `--apply` to make it happen.
51
51
  | Vault | Secret names and descriptions (values can't be read) | Command to run |
52
52
  | Extensions | `pg_extension` | SQL |
53
53
  | Migration history | Local migration files against `supabase_migrations` (target only) | SQL, opt-in |
54
- | Roles and grants | Custom roles, and grants including `anon`, `authenticated`, `service_role` | SQL |
54
+ | Roles and grants | Custom roles, and grants on tables, views, sequences and functions, including `anon`, `authenticated`, `service_role` | SQL |
55
55
 
56
56
  The schema check covers tables, columns, keys, indexes, partitions, views,
57
57
  materialized views, functions, triggers, sequences, enums, composite types,
@@ -113,9 +113,10 @@ Useful `diff` flags:
113
113
  a Supabase schema the target lacks, is skipped with the reason, and the rest
114
114
  still applies.
115
115
  - **`--prove`.** The fixes are replayed on a structure-only copy of the target,
116
- made on the target's own server. Nothing is applied unless the result matches
117
- the source. Changes a copy can't hold, such as cron jobs (pg_cron lives in
118
- one database per server), are listed as not proved.
116
+ made on the target's own server, the way the apply will run them. Nothing is
117
+ applied unless the result matches the source, and nothing is applied if the
118
+ proof can't run. Changes a copy can't hold, such as cron jobs (pg_cron lives
119
+ in one database per server), are listed as not proved.
119
120
 
120
121
  ```bash
121
122
  supaforge diff --dry-run # the plan, in order
@@ -239,7 +240,7 @@ supaforge migrate run --env=prod --apply
239
240
  | `SUPAFORGE_DBDIFF_MEMORY` | `1G` | Memory limit for `@dbdiff/cli` (`2G`, `-1` for none) |
240
241
  | `SUPAFORGE_CONNECT_TIMEOUT` | `15` | Seconds to wait for a connection |
241
242
  | `SUPAFORGE_CHECK_CONCURRENCY` | `4` | Checks run at once. Lower it behind a tight pooler |
242
- | `SUPAFORGE_PG_BIN` | — | A directory of PostgreSQL client tools (`pg_dump`, `psql`) to use when the ones on `PATH` are too old for a server |
243
+ | `SUPAFORGE_PG_BIN` | — | A directory of PostgreSQL client tools (`pg_dump`, `psql`), used ahead of `PATH` — for a server newer than the tools on `PATH` |
243
244
 
244
245
  ## Self-hosted Supabase
245
246
 
@@ -288,9 +289,25 @@ would push the clone's shape, absences included, onto the target.
288
289
 
289
290
  ## MCP (AI agents)
290
291
 
291
- ```json
292
- { "mcpServers": { "supaforge": { "command": "supaforge", "args": ["mcp"] } } }
293
- ```
292
+ SupaForge runs as an MCP server, so an AI agent in your editor can scan for
293
+ drift and fix it, asking you before anything is written.
294
+
295
+ [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/install-mcp?name=supaforge&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBha2FsL3N1cGFmb3JnZSIsIm1jcCIsIi0tcHJvamVjdCIsIiR7d29ya3NwYWNlRm9sZGVyfSJdfQ==)
296
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_SupaForge-0098FF?logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=supaforge&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40akal%2Fsupaforge%22%2C%22mcp%22%2C%22--project%22%2C%22%24%7BworkspaceFolder%7D%22%5D%7D)
297
+
298
+ - **Claude Desktop**: download the extension for your platform
299
+ (`supaforge-<version>-<platform>.mcpb`) from the
300
+ [latest release](https://github.com/akalsoftware/supaforge/releases/latest)
301
+ and open it. It asks for your project directory.
302
+ - **Claude Code**: `claude mcp add supaforge -- npx -y @akal/supaforge mcp`
303
+ - **Any other client**:
304
+
305
+ ```json
306
+ { "mcpServers": { "supaforge": { "command": "npx", "args": ["-y", "@akal/supaforge", "mcp", "--project", "/path/to/project"] } } }
307
+ ```
308
+
309
+ It is listed in the [MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.akalsoftware/supaforge)
310
+ as `io.github.akalsoftware/supaforge`.
294
311
 
295
312
  The server exposes these tools:
296
313
 
@@ -302,8 +319,9 @@ The server exposes these tools:
302
319
  | `take_snapshot` | Writes files |
303
320
  | `create_migration` | Writes files |
304
321
 
305
- It reads the config in its own directory, and refuses a `configPath` from a
306
- client unless started with `--allow-config-path`.
322
+ It reads `supaforge.config.json` in the directory given by `--project` (or the
323
+ one it starts in), and refuses a `configPath` from a client unless started
324
+ with `--allow-config-path`.
307
325
 
308
326
  ## Hooks
309
327
 
@@ -5,6 +5,7 @@ declare class Mcp extends Command {
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
+ project: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
8
9
  'allow-config-path': _oclif_core_interfaces.BooleanFlag<boolean>;
9
10
  };
10
11
  run(): Promise<void>;
@@ -12,6 +12,8 @@ import "../chunk-SQPCWGQO.js";
12
12
  import "../chunk-6WAMNZLO.js";
13
13
 
14
14
  // src/commands/mcp.ts
15
+ import { existsSync, statSync } from "fs";
16
+ import { resolve } from "path";
15
17
  import { Command, Flags } from "@oclif/core";
16
18
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
17
19
  var Mcp = class _Mcp extends Command {
@@ -19,9 +21,13 @@ var Mcp = class _Mcp extends Command {
19
21
  static examples = [
20
22
  "<%= config.bin %> mcp",
21
23
  "<%= config.bin %> mcp --allow-config-path",
24
+ "<%= config.bin %> mcp --project ~/code/my-app",
22
25
  '# Claude Desktop / Cursor config:\n# { "mcpServers": { "supaforge": { "command": "supaforge", "args": ["mcp"] } } }'
23
26
  ];
24
27
  static flags = {
28
+ project: Flags.string({
29
+ description: "The project directory, holding supaforge.config.json. Defaults to the directory the server starts in \u2014 which an AI client may not let you choose, so name it here."
30
+ }),
25
31
  "allow-config-path": Flags.boolean({
26
32
  description: "Let a client choose which supaforge.config.json to load. Off by default: a tool call, or a prompt injected into one, could otherwise point the server at any config on disk \u2014 including one holding production credentials \u2014 bypassing the one it was started with.",
27
33
  default: false
@@ -29,7 +35,11 @@ var Mcp = class _Mcp extends Command {
29
35
  };
30
36
  async run() {
31
37
  const { flags } = await this.parse(_Mcp);
32
- const server = createServer(process.cwd(), {
38
+ const project = resolve(flags.project ?? process.cwd());
39
+ if (!existsSync(project) || !statSync(project).isDirectory()) {
40
+ this.error(`--project: ${project} is not a directory`);
41
+ }
42
+ const server = createServer(project, {
33
43
  allowConfigPath: flags["allow-config-path"]
34
44
  });
35
45
  const transport = new StdioServerTransport();
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@akal/supaforge",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
+ "mcpName": "io.github.akalsoftware/supaforge",
4
5
  "description": "Diff and sync your Supabase environments",
5
6
  "author": "Akal Software Ltd",
6
7
  "license": "MIT",
@@ -20,8 +21,9 @@
20
21
  "main": "dist/index.js",
21
22
  "types": "dist/index.d.ts",
22
23
  "files": [
23
- "bin",
24
- "dist"
24
+ "bin/run.js",
25
+ "dist",
26
+ "!dist/**/*.map"
25
27
  ],
26
28
  "publishConfig": {
27
29
  "access": "public"
@@ -53,9 +55,9 @@
53
55
  "topicSeparator": " "
54
56
  },
55
57
  "dependencies": {
56
- "@akal/pg-conformance": "~0.0.15",
57
- "@dbdiff/cli": "3.0.0-rc.25",
58
- "@modelcontextprotocol/sdk": "^1.12.1",
58
+ "@akal/pg-conformance": "~0.0.16",
59
+ "@dbdiff/cli": "3.0.0-rc.27",
60
+ "@modelcontextprotocol/sdk": "^1.32.1",
59
61
  "@oclif/core": "^4",
60
62
  "@supabase/supabase-js": "^2.103.0",
61
63
  "libpg-query": "~18.1.5",
@@ -68,9 +70,9 @@
68
70
  "tsup": "^8.5.1",
69
71
  "tsx": "^4",
70
72
  "typescript": "^5",
71
- "vitest": "^3"
73
+ "vitest": "^4.1.11"
72
74
  },
73
75
  "engines": {
74
- "node": ">=18.0.0"
76
+ "node": ">=20.0.0"
75
77
  }
76
78
  }
package/bin/dev.js DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env tsx
2
- import {execute} from '@oclif/core'
3
-
4
- await execute({development: true, dir: import.meta.url}).catch((err) => {
5
- if (err && typeof err === 'object' && 'oclif' in err) return
6
- process.stderr.write(`\nUnexpected error: ${err?.message ?? err}\n`)
7
- process.stderr.write('If this looks like a bug, please report it:\n')
8
- process.stderr.write(' https://github.com/akalsoftware/supaforge/issues/new\n\n')
9
- process.exitCode = 1
10
- })
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/migrate/run.ts"],"sourcesContent":["import { Flags } from '@oclif/core'\nimport { BaseCommand } from '../../base-command.js'\nimport {\n ensureMigrationsTable,\n getAppliedVersions,\n getPendingMigrations,\n runMigration,\n} from '../../migrate.js'\nimport { ok, warn, dim, bold } from '../../ui.js'\nimport { isDestructiveSql } from '../../dbdiff.js'\nimport { splitSqlStatements } from '../../utils/sql-split.js'\nimport { readFile } from 'node:fs/promises'\nimport { errMsg } from '../../utils/error.js'\n\n/**\n * Execute pending migrations against a Supabase environment.\n *\n * Reads local migration files, executes unapplied ones in order,\n * and records each in supabase_migrations.schema_migrations.\n *\n * Previews unless given `--apply`, like every other command that writes. It\n * used to be the one exception, executing unless given `--dry-run`, so the\n * habit every other command teaches — run it bare to see what it would do —\n * ran migrations against whichever environment was named. `--dry-run` is\n * still accepted, and still previews.\n *\n * Replaces `supabase db push` for self-hosted Supabase instances.\n */\nexport default class MigrateRun extends BaseCommand {\n static override description = 'Execute pending migrations against a Supabase environment'\n\n static override examples = [\n '<%= config.bin %> migrate run --env=prod',\n '<%= config.bin %> migrate run --env=prod --apply',\n '<%= config.bin %> migrate run --env=prod --up-to=003 --apply',\n ]\n\n static override flags = {\n env: Flags.string({\n char: 'e',\n description: 'Target environment to run migrations against',\n }),\n apply: Flags.boolean({\n description: 'Execute the pending migrations (previews without it)',\n default: false,\n exclusive: ['dry-run'],\n }),\n 'dry-run': Flags.boolean({\n description: 'Preview which migrations would run (the default; kept for existing scripts)',\n default: false,\n }),\n 'up-to': Flags.string({\n description: 'Stop after applying this migration version (inclusive)',\n }),\n 'allow-destructive': Flags.boolean({\n description: 'Permit migrations that drop tables or columns, delete rows, or drop policies',\n default: false,\n }),\n }\n\n async run(): Promise<void> {\n const { flags } = await this.parse(MigrateRun)\n\n const config = await this.loadConfigOrFail()\n const { envName, env } = this.resolveEnv(config, flags.env)\n const dir = this.resolveMigrationsDir(config)\n\n // Preflight: verify database is reachable\n const pre = this.createPreflight('Migrate run preflight checks')\n .addDatabase('Target', envName, env.dbUrl)\n await this.runPreflight(pre, 'Migrate run')\n\n this.log(`${bold('migrate run')} → ${dim(envName)} (${dim(this.redactUrl(env.dbUrl))})\\n`)\n\n // The history is created only when migrations are applied: a preview\n // writes nothing, not even the table that records what ran.\n if (flags.apply) await ensureMigrationsTable(env.dbUrl)\n const applied = await getAppliedVersions(env.dbUrl)\n let pending = await getPendingMigrations(dir, applied)\n\n if (pending.length === 0) {\n this.log(`${ok('All migrations are up to date.')} ✓`)\n return\n }\n\n // Apply --up-to filter\n if (flags['up-to']) {\n const cutoff = flags['up-to']\n const idx = pending.findIndex(m => m.version === cutoff)\n if (idx === -1) {\n if (applied.has(cutoff)) {\n this.log(`${ok(`Version \"${cutoff}\" is already applied.`)} ✓`)\n return\n }\n this.error(`Version \"${cutoff}\" not found in pending migrations. Available: ${pending.map(m => m.version).join(', ')}`)\n }\n pending = pending.slice(0, idx + 1)\n }\n\n this.log(`Found ${bold(String(pending.length))} pending migration(s):\\n`)\n for (const m of pending) {\n this.log(` ${dim('○')} ${m.filename}`)\n }\n\n // A DROP TABLE in a migration file used to run with no opt-in at all,\n // while `diff --apply` held the same statement back (issue #88). The gate\n // is the same one, and the same flag opens it. Listed in the preview too,\n // so it is not first heard of when the apply refuses.\n const destructive = flags['allow-destructive'] ? [] : await findDestructiveStatements(pending)\n if (destructive.length > 0) {\n this.log('')\n this.log(warn(`${destructive.length} destructive statement(s) in the pending migrations:`))\n for (const { filename, sql } of destructive) {\n this.log(` ${warn('✗')} ${filename}`)\n this.log(` ${dim(truncateSql(sql))}`)\n }\n }\n\n if (!flags.apply) {\n this.log(`\\n${dim('Preview only — nothing was applied.')} Re-run with ${bold('--apply')} to execute`\n + (destructive.length > 0 ? `, and ${bold('--allow-destructive')} for the statements above.` : '.'))\n return\n }\n\n if (destructive.length > 0) {\n this.log(`\\n${warn('Nothing was applied.')} Re-run with ${bold('--allow-destructive')} to proceed.`)\n this.exit(1)\n }\n\n this.log('')\n\n // Execute migrations in order\n let applied_count = 0\n for (const migration of pending) {\n try {\n const result = await runMigration(env.dbUrl, migration)\n applied_count++\n this.log(` ${ok('✓')} ${result.filename} ${dim(`(${result.durationMs}ms)`)}`)\n } catch (err) {\n this.log(` ${warn('✗')} ${migration.filename}: ${err instanceof Error ? err.message : String(err)}`)\n this.log(`\\n${warn(`Stopped after ${applied_count} migration(s) due to error.`)}`)\n this.exit(1)\n }\n }\n\n this.log(`\\n${ok(`Applied ${applied_count} migration(s) successfully.`)} ✓`)\n }\n}\n\n/**\n * Destructive statements across a set of pending migration files.\n *\n * The SQL lives in the files rather than on the objects — `runMigration` reads\n * each one as it goes — so this reads them too. `readFileFn` is injectable for\n * the same reason `runMigration`'s is: so this can be tested without a\n * filesystem.\n *\n * Flat rather than grouped by file: the caller prints one line per statement,\n * and a migration with several destructive statements is worth seeing in full.\n * A file that cannot be read is not silently treated as safe — it is reported,\n * and `runMigration` will fail on it in a moment anyway.\n */\nexport async function findDestructiveStatements(\n migrations: Array<{ filename: string; path: string }>,\n readFileFn: (path: string) => Promise<string> = (path) => readFile(path, 'utf-8'),\n): Promise<Array<{ filename: string; sql: string }>> {\n const found: Array<{ filename: string; sql: string }> = []\n\n for (const migration of migrations) {\n let sql: string\n try {\n sql = await readFileFn(migration.path)\n } catch (err) {\n found.push({ filename: migration.filename, sql: `<unreadable: ${errMsg(err)}>` })\n continue\n }\n\n for (const statement of splitSqlStatements(sql)) {\n if (isDestructiveSql(statement)) {\n found.push({ filename: migration.filename, sql: statement })\n }\n }\n }\n\n return found\n}\n\n/**\n * One line of SQL for a listing, whatever the statement's shape.\n *\n * Comment lines are dropped first: the first statement of a file carries the\n * file's header, and a generated one its unit marker, which otherwise filled\n * the line before the statement began.\n */\nexport function truncateSql(sql: string): string {\n const oneLine = sql.split('\\n').filter(l => !/^\\s*--/.test(l)).join(' ').replace(/\\s+/g, ' ').trim()\n return oneLine.length > 100 ? `${oneLine.slice(0, 97)}...` : oneLine\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA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