@specific.dev/cli 0.1.109 → 0.1.111
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/admin/404/index.html +1 -1
- package/dist/admin/404.html +1 -1
- package/dist/admin/__next.!KGRlZmF1bHQp.__PAGE__.txt +1 -1
- package/dist/admin/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/__next._full.txt +1 -1
- package/dist/admin/__next._head.txt +1 -1
- package/dist/admin/__next._index.txt +1 -1
- package/dist/admin/__next._tree.txt +1 -1
- package/dist/admin/_not-found/__next._full.txt +1 -1
- package/dist/admin/_not-found/__next._head.txt +1 -1
- package/dist/admin/_not-found/__next._index.txt +1 -1
- package/dist/admin/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/admin/_not-found/__next._not-found.txt +1 -1
- package/dist/admin/_not-found/__next._tree.txt +1 -1
- package/dist/admin/_not-found/index.html +1 -1
- package/dist/admin/_not-found/index.txt +1 -1
- package/dist/admin/databases/__next.!KGRlZmF1bHQp.databases.__PAGE__.txt +1 -1
- package/dist/admin/databases/__next.!KGRlZmF1bHQp.databases.txt +1 -1
- package/dist/admin/databases/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/databases/__next._full.txt +1 -1
- package/dist/admin/databases/__next._head.txt +1 -1
- package/dist/admin/databases/__next._index.txt +1 -1
- package/dist/admin/databases/__next._tree.txt +1 -1
- package/dist/admin/databases/index.html +1 -1
- package/dist/admin/databases/index.txt +1 -1
- package/dist/admin/fullscreen/__next._full.txt +1 -1
- package/dist/admin/fullscreen/__next._head.txt +1 -1
- package/dist/admin/fullscreen/__next._index.txt +1 -1
- package/dist/admin/fullscreen/__next._tree.txt +1 -1
- package/dist/admin/fullscreen/__next.fullscreen.__PAGE__.txt +1 -1
- package/dist/admin/fullscreen/__next.fullscreen.txt +1 -1
- package/dist/admin/fullscreen/databases/__next._full.txt +1 -1
- package/dist/admin/fullscreen/databases/__next._head.txt +1 -1
- package/dist/admin/fullscreen/databases/__next._index.txt +1 -1
- package/dist/admin/fullscreen/databases/__next._tree.txt +1 -1
- package/dist/admin/fullscreen/databases/__next.fullscreen.databases.__PAGE__.txt +1 -1
- package/dist/admin/fullscreen/databases/__next.fullscreen.databases.txt +1 -1
- package/dist/admin/fullscreen/databases/__next.fullscreen.txt +1 -1
- package/dist/admin/fullscreen/databases/index.html +1 -1
- package/dist/admin/fullscreen/databases/index.txt +1 -1
- package/dist/admin/fullscreen/index.html +1 -1
- package/dist/admin/fullscreen/index.txt +1 -1
- package/dist/admin/index.html +1 -1
- package/dist/admin/index.txt +1 -1
- package/dist/admin/mail/__next.!KGRlZmF1bHQp.mail.__PAGE__.txt +1 -1
- package/dist/admin/mail/__next.!KGRlZmF1bHQp.mail.txt +1 -1
- package/dist/admin/mail/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/mail/__next._full.txt +1 -1
- package/dist/admin/mail/__next._head.txt +1 -1
- package/dist/admin/mail/__next._index.txt +1 -1
- package/dist/admin/mail/__next._tree.txt +1 -1
- package/dist/admin/mail/index.html +1 -1
- package/dist/admin/mail/index.txt +1 -1
- package/dist/admin/workflows/__next.!KGRlZmF1bHQp.txt +1 -1
- package/dist/admin/workflows/__next.!KGRlZmF1bHQp.workflows.__PAGE__.txt +1 -1
- package/dist/admin/workflows/__next.!KGRlZmF1bHQp.workflows.txt +1 -1
- package/dist/admin/workflows/__next._full.txt +1 -1
- package/dist/admin/workflows/__next._head.txt +1 -1
- package/dist/admin/workflows/__next._index.txt +1 -1
- package/dist/admin/workflows/__next._tree.txt +1 -1
- package/dist/admin/workflows/index.html +1 -1
- package/dist/admin/workflows/index.txt +1 -1
- package/dist/cli.js +98 -15
- package/dist/docs/postgres/reshape/actions.md +16 -20
- package/package.json +1 -1
- /package/dist/admin/_next/static/{wQVAcL4Ep_DjuTPb20c3O → YgbAKqz1bHvJtF6MpjtFE}/_buildManifest.js +0 -0
- /package/dist/admin/_next/static/{wQVAcL4Ep_DjuTPb20c3O → YgbAKqz1bHvJtF6MpjtFE}/_clientMiddlewareManifest.json +0 -0
- /package/dist/admin/_next/static/{wQVAcL4Ep_DjuTPb20c3O → YgbAKqz1bHvJtF6MpjtFE}/_ssgManifest.js +0 -0
package/dist/cli.js
CHANGED
|
@@ -373041,6 +373041,43 @@ function performLogin(options2 = {}) {
|
|
|
373041
373041
|
});
|
|
373042
373042
|
});
|
|
373043
373043
|
}
|
|
373044
|
+
async function performNonInteractiveLogin() {
|
|
373045
|
+
try {
|
|
373046
|
+
writeLog("auth", "Starting non-interactive login flow");
|
|
373047
|
+
const deviceAuth = await initiateDeviceAuthorization();
|
|
373048
|
+
console.log(`To authenticate, visit: ${deviceAuth.verification_uri_complete}`);
|
|
373049
|
+
console.log(`Your code: ${deviceAuth.user_code}`);
|
|
373050
|
+
console.log("");
|
|
373051
|
+
console.log("To complete login after approving, run:");
|
|
373052
|
+
console.log(` specific login --device-code ${deviceAuth.device_code}`);
|
|
373053
|
+
return { success: true };
|
|
373054
|
+
} catch (err) {
|
|
373055
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
373056
|
+
console.error(`Error: ${message}`);
|
|
373057
|
+
return { success: false, error: new Error(message) };
|
|
373058
|
+
}
|
|
373059
|
+
}
|
|
373060
|
+
async function performDeviceCodeLogin(deviceCode) {
|
|
373061
|
+
try {
|
|
373062
|
+
writeLog("auth", "Completing login with device code");
|
|
373063
|
+
console.log("Waiting for authentication...");
|
|
373064
|
+
const token = await pollUntilToken(
|
|
373065
|
+
{ device_code: deviceCode, interval: 5, expires_in: 600 },
|
|
373066
|
+
() => false
|
|
373067
|
+
);
|
|
373068
|
+
if (!token) {
|
|
373069
|
+
console.error("Error: Authentication timed out. Please try again.");
|
|
373070
|
+
return { success: false, error: new Error("Authentication timed out") };
|
|
373071
|
+
}
|
|
373072
|
+
await saveCredentialsFromToken(token);
|
|
373073
|
+
console.log(`\u2713 Logged in as ${token.user.email}`);
|
|
373074
|
+
return { success: true, userEmail: token.user.email };
|
|
373075
|
+
} catch (err) {
|
|
373076
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
373077
|
+
console.error(`Error: ${message}`);
|
|
373078
|
+
return { success: false, error: new Error(message) };
|
|
373079
|
+
}
|
|
373080
|
+
}
|
|
373044
373081
|
|
|
373045
373082
|
// src/lib/auth/credentials.ts
|
|
373046
373083
|
function getUserCredentialsDir() {
|
|
@@ -373200,7 +373237,7 @@ function trackEvent(event, properties) {
|
|
|
373200
373237
|
event,
|
|
373201
373238
|
properties: {
|
|
373202
373239
|
...properties,
|
|
373203
|
-
cli_version: "0.1.
|
|
373240
|
+
cli_version: "0.1.111",
|
|
373204
373241
|
platform: process.platform,
|
|
373205
373242
|
node_version: process.version,
|
|
373206
373243
|
project_id: getProjectId()
|
|
@@ -373519,6 +373556,7 @@ Valid agents: ${VALID_AGENT_IDS.join(", ")}`
|
|
|
373519
373556
|
|
|
373520
373557
|
// src/commands/docs.tsx
|
|
373521
373558
|
import { readFileSync as readFileSync9, existsSync as existsSync17 } from "fs";
|
|
373559
|
+
import { spawn as spawn6 } from "child_process";
|
|
373522
373560
|
import { join as join19, dirname as dirname8 } from "path";
|
|
373523
373561
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
373524
373562
|
|
|
@@ -373578,8 +373616,12 @@ function saveBetas(enabled, projectDir) {
|
|
|
373578
373616
|
var __dirname3 = dirname8(fileURLToPath3(import.meta.url));
|
|
373579
373617
|
var docsDir = join19(__dirname3, "docs");
|
|
373580
373618
|
var _embeddedDocs = null;
|
|
373581
|
-
|
|
373582
|
-
|
|
373619
|
+
var RESHAPE_DOCS_PREFIX = "postgres/reshape/";
|
|
373620
|
+
async function docsCommand(path27) {
|
|
373621
|
+
let content = resolveDocContent(path27);
|
|
373622
|
+
if (!content && path27) {
|
|
373623
|
+
content = await resolveReshapeDoc(path27);
|
|
373624
|
+
}
|
|
373583
373625
|
if (!content) {
|
|
373584
373626
|
console.error(
|
|
373585
373627
|
`Documentation not found: ${path27 || "index"}
|
|
@@ -373592,6 +373634,33 @@ Run 'specific docs' to see available topics.`
|
|
|
373592
373634
|
const filtered = filterBetaTags(content, enabledBetas);
|
|
373593
373635
|
console.log(filtered);
|
|
373594
373636
|
}
|
|
373637
|
+
async function resolveReshapeDoc(path27) {
|
|
373638
|
+
const normalized = path27.replace(/^\/+|\/+$/g, "");
|
|
373639
|
+
if (!normalized.startsWith(RESHAPE_DOCS_PREFIX)) return null;
|
|
373640
|
+
const reshapePath = "/" + normalized.slice(RESHAPE_DOCS_PREFIX.length);
|
|
373641
|
+
try {
|
|
373642
|
+
const binary = await ensureBinary(reshapeBinary);
|
|
373643
|
+
const reshapeExe = binary.executables["reshape"];
|
|
373644
|
+
const output = await new Promise((resolve9) => {
|
|
373645
|
+
const child = spawn6(reshapeExe, ["docs", reshapePath], {
|
|
373646
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
373647
|
+
});
|
|
373648
|
+
const chunks = [];
|
|
373649
|
+
child.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
373650
|
+
child.on("error", () => resolve9(null));
|
|
373651
|
+
child.on("close", (code) => {
|
|
373652
|
+
if (code === 0 && chunks.length > 0) {
|
|
373653
|
+
resolve9(Buffer.concat(chunks).toString("utf-8"));
|
|
373654
|
+
} else {
|
|
373655
|
+
resolve9(null);
|
|
373656
|
+
}
|
|
373657
|
+
});
|
|
373658
|
+
});
|
|
373659
|
+
if (output) return output;
|
|
373660
|
+
} catch {
|
|
373661
|
+
}
|
|
373662
|
+
return null;
|
|
373663
|
+
}
|
|
373595
373664
|
function filterBetaTags(content, enabledBetas) {
|
|
373596
373665
|
return content.replace(
|
|
373597
373666
|
/<!-- beta:(\w[\w-]*) -->\n?([\s\S]*?)<!-- \/beta:\1 -->\n?/g,
|
|
@@ -376047,7 +376116,7 @@ async function deployCommand(options2) {
|
|
|
376047
376116
|
}
|
|
376048
376117
|
|
|
376049
376118
|
// src/commands/exec.tsx
|
|
376050
|
-
import { spawn as
|
|
376119
|
+
import { spawn as spawn7 } from "child_process";
|
|
376051
376120
|
import * as fs23 from "fs";
|
|
376052
376121
|
import * as path21 from "path";
|
|
376053
376122
|
function startSpinner(text) {
|
|
@@ -376242,7 +376311,7 @@ async function execCommand(serviceName, command, instanceKey = "default") {
|
|
|
376242
376311
|
}
|
|
376243
376312
|
}
|
|
376244
376313
|
spinner?.stop();
|
|
376245
|
-
child =
|
|
376314
|
+
child = spawn7(command[0], command.slice(1), {
|
|
376246
376315
|
cwd: effectiveCwd,
|
|
376247
376316
|
env: {
|
|
376248
376317
|
...process.env,
|
|
@@ -376266,7 +376335,7 @@ async function execCommand(serviceName, command, instanceKey = "default") {
|
|
|
376266
376335
|
}
|
|
376267
376336
|
|
|
376268
376337
|
// src/commands/psql.tsx
|
|
376269
|
-
import { spawn as
|
|
376338
|
+
import { spawn as spawn8 } from "child_process";
|
|
376270
376339
|
import * as fs24 from "fs";
|
|
376271
376340
|
import * as path22 from "path";
|
|
376272
376341
|
async function psqlCommand(databaseName, instanceKey = "default", extraArgs = []) {
|
|
@@ -376390,7 +376459,7 @@ async function psqlCommand(databaseName, instanceKey = "default", extraArgs = []
|
|
|
376390
376459
|
};
|
|
376391
376460
|
process.on("SIGINT", () => handleSignal("SIGINT"));
|
|
376392
376461
|
process.on("SIGTERM", () => handleSignal("SIGTERM"));
|
|
376393
|
-
child =
|
|
376462
|
+
child = spawn8(psqlPath, ["-h", dbState.host, "-p", String(dbState.port), "-U", dbState.user, "-d", dbState.dbName, ...extraArgs], {
|
|
376394
376463
|
cwd: process.cwd(),
|
|
376395
376464
|
env: {
|
|
376396
376465
|
...process.env,
|
|
@@ -376415,7 +376484,7 @@ async function psqlCommand(databaseName, instanceKey = "default", extraArgs = []
|
|
|
376415
376484
|
}
|
|
376416
376485
|
|
|
376417
376486
|
// src/commands/reshape.tsx
|
|
376418
|
-
import { spawn as
|
|
376487
|
+
import { spawn as spawn9 } from "child_process";
|
|
376419
376488
|
import * as fs25 from "fs";
|
|
376420
376489
|
import * as path23 from "path";
|
|
376421
376490
|
var VALID_ACTIONS = ["start", "complete", "status", "abort", "check"];
|
|
@@ -376602,7 +376671,7 @@ async function reshapeCommand(action, databaseName, instanceKey = "default") {
|
|
|
376602
376671
|
};
|
|
376603
376672
|
process.on("SIGINT", () => handleSignal("SIGINT"));
|
|
376604
376673
|
process.on("SIGTERM", () => handleSignal("SIGTERM"));
|
|
376605
|
-
child =
|
|
376674
|
+
child = spawn9(reshapePath, reshapeArgs, {
|
|
376606
376675
|
cwd: process.cwd(),
|
|
376607
376676
|
env: {
|
|
376608
376677
|
...process.env,
|
|
@@ -376736,11 +376805,25 @@ function cleanCommand(instanceKey) {
|
|
|
376736
376805
|
}
|
|
376737
376806
|
|
|
376738
376807
|
// src/commands/login.tsx
|
|
376739
|
-
async function loginCommand() {
|
|
376808
|
+
async function loginCommand(options2 = {}) {
|
|
376740
376809
|
if (isLoggedIn()) {
|
|
376741
376810
|
console.log("Already logged in.");
|
|
376742
376811
|
return;
|
|
376743
376812
|
}
|
|
376813
|
+
if (options2.deviceCode) {
|
|
376814
|
+
const result2 = await performDeviceCodeLogin(options2.deviceCode);
|
|
376815
|
+
if (!result2.success) {
|
|
376816
|
+
process.exitCode = 1;
|
|
376817
|
+
}
|
|
376818
|
+
return;
|
|
376819
|
+
}
|
|
376820
|
+
if (!isInteractive()) {
|
|
376821
|
+
const result2 = await performNonInteractiveLogin();
|
|
376822
|
+
if (!result2.success) {
|
|
376823
|
+
process.exitCode = 1;
|
|
376824
|
+
}
|
|
376825
|
+
return;
|
|
376826
|
+
}
|
|
376744
376827
|
const result = await performLogin();
|
|
376745
376828
|
if (!result.success) {
|
|
376746
376829
|
process.exitCode = 1;
|
|
@@ -376879,7 +376962,7 @@ function compareVersions(a, b) {
|
|
|
376879
376962
|
return 0;
|
|
376880
376963
|
}
|
|
376881
376964
|
async function checkForUpdate() {
|
|
376882
|
-
const currentVersion = "0.1.
|
|
376965
|
+
const currentVersion = "0.1.111";
|
|
376883
376966
|
const response = await fetch(`${BINARIES_BASE_URL}/latest?t=${Date.now()}`);
|
|
376884
376967
|
if (!response.ok) {
|
|
376885
376968
|
throw new Error(`Failed to check for updates: HTTP ${response.status}`);
|
|
@@ -376929,7 +377012,7 @@ async function performUpdate(version, onProgress) {
|
|
|
376929
377012
|
}
|
|
376930
377013
|
|
|
376931
377014
|
// src/lib/background-update.ts
|
|
376932
|
-
import { spawn as
|
|
377015
|
+
import { spawn as spawn10 } from "child_process";
|
|
376933
377016
|
import * as fs28 from "fs";
|
|
376934
377017
|
import * as path26 from "path";
|
|
376935
377018
|
import * as os6 from "os";
|
|
@@ -376958,7 +377041,7 @@ function maybeStartBackgroundUpdate() {
|
|
|
376958
377041
|
if (process.env.SPECIFIC_BACKGROUND_UPDATE === "1") return;
|
|
376959
377042
|
if (isRateLimited()) return;
|
|
376960
377043
|
if (!isBinaryWritable()) return;
|
|
376961
|
-
const child =
|
|
377044
|
+
const child = spawn10(process.execPath, [], {
|
|
376962
377045
|
detached: true,
|
|
376963
377046
|
stdio: "ignore",
|
|
376964
377047
|
env: {
|
|
@@ -377147,7 +377230,7 @@ async function projectListCommand() {
|
|
|
377147
377230
|
var program = new Command();
|
|
377148
377231
|
var env = "production";
|
|
377149
377232
|
var envLabel = env !== "production" ? `[${env.toUpperCase()}] ` : "";
|
|
377150
|
-
program.name("specific").description(`${envLabel}Infrastructure-as-code for coding agents`).version("0.1.
|
|
377233
|
+
program.name("specific").description(`${envLabel}Infrastructure-as-code for coding agents`).version("0.1.111").enablePositionalOptions();
|
|
377151
377234
|
program.command("init").description("Initialize project for use with a coding agent").option("--agent <name...>", "Agents to configure (cursor, claude, codex, other)").addHelpText("after", `
|
|
377152
377235
|
Examples:
|
|
377153
377236
|
$ specific init
|
|
@@ -377220,7 +377303,7 @@ Examples:
|
|
|
377220
377303
|
});
|
|
377221
377304
|
program.command("beta").description("Manage beta feature flags").action(betaCommand);
|
|
377222
377305
|
program.command("update").description("Update Specific CLI to the latest version").action(updateCommand);
|
|
377223
|
-
program.command("login").description("Log in to Specific").action(loginCommand);
|
|
377306
|
+
program.command("login").description("Log in to Specific").option("--device-code <code>", "Complete login using a device code from a previous non-interactive login").action((options2) => loginCommand(options2));
|
|
377224
377307
|
program.command("logout").description("Log out of Specific").action(logoutCommand);
|
|
377225
377308
|
var commandName = process.argv[2] || "help";
|
|
377226
377309
|
trackEvent("cli_command_invoked", { command: commandName });
|
|
@@ -23,27 +23,23 @@ Reshape supports many different actions for modifying your database schema:
|
|
|
23
23
|
|
|
24
24
|
## Action Documentation
|
|
25
25
|
|
|
26
|
-
For detailed documentation on each action including all available options and examples
|
|
26
|
+
For detailed documentation on each action including all available options and examples:
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
reshape docs /actions/remove-foreign-key
|
|
44
|
-
reshape docs /actions/rename-table
|
|
45
|
-
reshape docs /actions/remove-table
|
|
46
|
-
reshape docs /actions/custom
|
|
29
|
+
specific docs /postgres/reshape/actions/create-table
|
|
30
|
+
specific docs /postgres/reshape/actions/add-column
|
|
31
|
+
specific docs /postgres/reshape/actions/alter-column
|
|
32
|
+
specific docs /postgres/reshape/actions/remove-column
|
|
33
|
+
specific docs /postgres/reshape/actions/create-enum
|
|
34
|
+
specific docs /postgres/reshape/actions/alter-enum
|
|
35
|
+
specific docs /postgres/reshape/actions/remove-enum
|
|
36
|
+
specific docs /postgres/reshape/actions/add-index
|
|
37
|
+
specific docs /postgres/reshape/actions/remove-index
|
|
38
|
+
specific docs /postgres/reshape/actions/add-foreign-key
|
|
39
|
+
specific docs /postgres/reshape/actions/remove-foreign-key
|
|
40
|
+
specific docs /postgres/reshape/actions/rename-table
|
|
41
|
+
specific docs /postgres/reshape/actions/remove-table
|
|
42
|
+
specific docs /postgres/reshape/actions/custom
|
|
47
43
|
```
|
|
48
44
|
|
|
49
45
|
## Example Migration
|
|
@@ -85,4 +81,4 @@ unique = true
|
|
|
85
81
|
|
|
86
82
|
Related topics:
|
|
87
83
|
- Run `specific docs /postgres/reshape` for general Reshape documentation
|
|
88
|
-
- Run `
|
|
84
|
+
- Run `specific docs /postgres/reshape/actions/{ACTION}` for detailed action documentation
|
package/package.json
CHANGED
/package/dist/admin/_next/static/{wQVAcL4Ep_DjuTPb20c3O → YgbAKqz1bHvJtF6MpjtFE}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/admin/_next/static/{wQVAcL4Ep_DjuTPb20c3O → YgbAKqz1bHvJtF6MpjtFE}/_ssgManifest.js
RENAMED
|
File without changes
|