@schemic/cli 0.1.0-alpha.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vertio Solutions
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 ADDED
@@ -0,0 +1,67 @@
1
+ # @schemic/cli
2
+
3
+ The command-line interface for [Schemic](https://github.com/schemichq/schemic) —
4
+ `schemic` (with the short alias `sc`) generates and runs schema migrations against
5
+ any database. It's **dialect-agnostic**: the CLI loads your database driver from
6
+ `schemic.config.ts`, so the same commands work whatever you're targeting.
7
+
8
+ ## Install
9
+
10
+ Install the CLI alongside a driver:
11
+
12
+ ```bash
13
+ bun add @schemic/cli @schemic/surrealdb # or @schemic/postgres, …
14
+ ```
15
+
16
+ The CLI is dialect-neutral; the driver provides the authoring types and the DDL.
17
+ See each driver's README for its exact peer deps and quickstart —
18
+ [`@schemic/surrealdb`](../surrealdb#readme), [`@schemic/postgres`](../postgres#readme).
19
+
20
+ ## Quick start
21
+
22
+ ```bash
23
+ sc init # scaffold a project (default driver: surrealdb)
24
+ sc init --driver postgres # …or scaffold for a specific driver
25
+ ```
26
+
27
+ `init` writes a `schemic.config.ts`, a sample schema, a seed stub, and
28
+ `.env.example`. From there:
29
+
30
+ ```bash
31
+ sc gen add_users # write a migration from your schema changes
32
+ sc migrate # apply pending migrations
33
+ sc status # show applied vs pending
34
+ ```
35
+
36
+ ## Commands
37
+
38
+ | Command | What it does |
39
+ | --- | --- |
40
+ | `init [--driver <name>]` | Scaffold a project — config, schema, seed, `.env.example` (default driver: `surrealdb`). |
41
+ | `gen [name]` | Write a migration from the schema diff. |
42
+ | `migrate [count]` | Apply pending migrations — all, the next N, or `--to <tag>` (alias: `up`). |
43
+ | `rollback [count]` | Revert applied migrations, newest first (alias: `down`). |
44
+ | `status` | Show applied vs pending migrations (`--json` for machine output). |
45
+ | `diff` | Preview pending changes without writing a migration (`--live` to compare against the database). |
46
+ | `push` | Apply the schema directly — no migration files (alias: `sync`). |
47
+ | `pull` | Introspect a live database back into your schema files. |
48
+ | `new <kind> <name>` | Scaffold a blank, hand-written migration. |
49
+ | `check` | Replay migrations in a throwaway engine to confirm they reproduce the schema. |
50
+ | `seed` | Run the project's seed script against a connection. |
51
+ | `doctor` | Print the resolved config and test the connection. |
52
+ | `snapshot reset` | Clear the migration snapshot. |
53
+ | `unlock` | Release a stale migration lock. |
54
+
55
+ Run `sc <command> --help` for flags. Support for some commands varies by driver
56
+ (e.g. `pull` and `diff --ts` are SurrealDB today) — see your driver's
57
+ `docs/COVERAGE.md`.
58
+
59
+ ## Docs
60
+
61
+ Full guides, concepts, and reference live at
62
+ [schemic.dev](https://schemic.dev). This package is part of the
63
+ [Schemic](https://github.com/schemichq/schemic) toolkit.
64
+
65
+ ## License
66
+
67
+ [MIT](./LICENSE) © Vertio Solutions