@getjack/jack 0.1.15 → 0.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getjack/jack",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Ship before you forget why you started. The vibecoder's deployment CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -41,6 +41,7 @@
41
41
  "bun-types": "latest"
42
42
  },
43
43
  "dependencies": {
44
+ "@clack/prompts": "^0.11.0",
44
45
  "@modelcontextprotocol/sdk": "^1.25.1",
45
46
  "archiver": "^7.0.1",
46
47
  "fflate": "^0.8.2",
@@ -72,7 +72,8 @@ export default async function clone(projectName?: string, flags: CloneFlags = {}
72
72
 
73
73
  if (!result.success) {
74
74
  downloadSpin.error("Clone failed");
75
- error(result.error || "Unknown error");
75
+ error(result.error || "Could not download project files");
76
+ info("Check your network connection and try again");
76
77
  process.exit(1);
77
78
  }
78
79
 
@@ -100,27 +100,10 @@ export default async function down(projectName?: string, flags: DownFlags = {}):
100
100
  }
101
101
  }
102
102
 
103
+ // Track auth state for final messaging
104
+ let authState: Awaited<ReturnType<typeof getAuthState>> | null = null;
103
105
  if (!resolved && !link) {
104
- // Project not found - provide auth-aware messaging
105
- const authState = await getAuthState();
106
-
107
- if (authState === "logged-in") {
108
- // We're logged in and control plane didn't find it - definitely not a managed project
109
- warn(`Project '${name}' not tracked by jack`);
110
- info("Checking your Cloudflare account...");
111
- } else if (authState === "session-expired") {
112
- // Session expired - can't verify if this is a managed project
113
- warn(`Project '${name}' not found locally`);
114
- info("Session expired - can't check jack cloud");
115
- info("If this was deployed via jack, run: jack login");
116
- info("Checking your Cloudflare account...");
117
- } else {
118
- // Not logged in - can't verify if this is a managed project
119
- warn(`Project '${name}' not found locally`);
120
- info("Not logged in - can't check jack cloud");
121
- info("If this was deployed via jack, run: jack login");
122
- info("Checking your Cloudflare account...");
123
- }
106
+ authState = await getAuthState();
124
107
  }
125
108
 
126
109
  // Check if this is a managed project (from link or resolved data)
@@ -153,8 +136,14 @@ export default async function down(projectName?: string, flags: DownFlags = {}):
153
136
 
154
137
  if (!workerExists) {
155
138
  console.error("");
156
- warn(`'${name}' is not deployed`);
157
- info("Nothing to undeploy");
139
+ error(`Project '${name}' not found`);
140
+ if (authState === "session-expired") {
141
+ info("Session expired. Run: jack login");
142
+ } else if (authState === "not-logged-in") {
143
+ info("Not logged in. Run: jack login");
144
+ } else {
145
+ info("Run jack projects to see your projects");
146
+ }
158
147
  return;
159
148
  }
160
149
 
@@ -46,11 +46,11 @@ export default async function link(projectName?: string, flags: LinkFlags = {}):
46
46
  // BYO mode - generate local ID
47
47
  if (flags.byo) {
48
48
  const projectId = generateByoProjectId();
49
- output.start("Creating BYO link...");
49
+ output.start("Linking to your Cloudflare account...");
50
50
  await linkProject(process.cwd(), projectId, "byo");
51
51
  await registerPath(projectId, process.cwd());
52
52
  output.stop();
53
- success("Linked as BYO project");
53
+ success("Linked to your Cloudflare account");
54
54
  info(`Project ID: ${projectId}`);
55
55
  return;
56
56
  }
@@ -62,7 +62,7 @@ export default async function link(projectName?: string, flags: LinkFlags = {}):
62
62
  // Not logged in and no project name - suggest options
63
63
  error("Not logged in to jack cloud");
64
64
  info("Login with: jack login");
65
- info("Or create a BYO link: jack link --byo");
65
+ info("Or link to your Cloudflare account: jack link --byo");
66
66
  process.exit(1);
67
67
  }
68
68
 
@@ -118,9 +118,9 @@ export default async function link(projectName?: string, flags: LinkFlags = {}):
118
118
  output.stop();
119
119
 
120
120
  if (projects.length === 0) {
121
- error("No managed projects found");
121
+ error("No projects found");
122
122
  info("Create one with: jack new");
123
- info("Or link as BYO: jack link --byo");
123
+ info("Or link to your Cloudflare account: jack link --byo");
124
124
  process.exit(1);
125
125
  }
126
126
 
@@ -448,7 +448,7 @@ async function removeProjectEntry(args: string[]): Promise<void> {
448
448
  // Warn if still deployed
449
449
  if (project.status === "live") {
450
450
  console.error("");
451
- warn("Project is still deployed; removal does not undeploy the worker");
451
+ warn("Project is still live; this only removes it from jack, not from Cloudflare");
452
452
  }
453
453
 
454
454
  console.error("");
@@ -496,7 +496,7 @@ async function removeProjectEntry(args: string[]): Promise<void> {
496
496
  // Hint about undeploying
497
497
  if (project.status === "live") {
498
498
  console.error("");
499
- info(`To undeploy the worker, run: jack down ${name}`);
499
+ info(`To take it offline: jack down ${name}`);
500
500
  }
501
501
  }
502
502
 
@@ -12,8 +12,8 @@ export default async function publish(): Promise<void> {
12
12
  }
13
13
 
14
14
  if (link.deploy_mode !== "managed") {
15
- output.error("Only managed projects can be published");
16
- output.info("Projects deployed with BYOC (bring your own cloud) cannot be published");
15
+ output.error("Only jack cloud projects can be published");
16
+ output.info("Projects on your own Cloudflare account cannot be published");
17
17
  process.exit(1);
18
18
  }
19
19
 
@@ -186,9 +186,8 @@ async function dbInfo(options: ServiceOptions): Promise<void> {
186
186
 
187
187
  if (!dbInfo) {
188
188
  console.error("");
189
- error("No database found for this project.");
190
- info("For managed projects, create a database with: jack services db create");
191
- info("For BYO projects, add d1_databases to your wrangler.jsonc");
189
+ error("No database found for this project");
190
+ info("Create one with: jack services db create");
192
191
  console.error("");
193
192
  return;
194
193
  }
@@ -228,9 +227,8 @@ async function dbExport(options: ServiceOptions): Promise<void> {
228
227
 
229
228
  if (!dbInfo) {
230
229
  console.error("");
231
- error("No database found for this project.");
232
- info("For managed projects, create a database with: jack services db create");
233
- info("For BYO projects, add d1_databases to your wrangler.jsonc");
230
+ error("No database found for this project");
231
+ info("Create one with: jack services db create");
234
232
  console.error("");
235
233
  return;
236
234
  }
@@ -267,9 +265,8 @@ async function dbDelete(options: ServiceOptions): Promise<void> {
267
265
 
268
266
  if (!dbInfo) {
269
267
  console.error("");
270
- error("No database found for this project.");
271
- info("For managed projects, create a database with: jack services db create");
272
- info("For BYO projects, add d1_databases to your wrangler.jsonc");
268
+ error("No database found for this project");
269
+ info("Create one with: jack services db create");
273
270
  console.error("");
274
271
  return;
275
272
  }
@@ -20,8 +20,8 @@ export default async function sync(flags: SyncFlags = {}): Promise<void> {
20
20
 
21
21
  // Check for wrangler config
22
22
  if (!hasWranglerConfig()) {
23
- error("No wrangler config found in current directory");
24
- error("Run: jack new <project-name>");
23
+ error("Not in a project directory");
24
+ info("Run jack new <name> to create a project");
25
25
  process.exit(1);
26
26
  }
27
27
 
@@ -39,10 +39,12 @@ export default async function sync(flags: SyncFlags = {}): Promise<void> {
39
39
  const result = await syncToCloud(projectDir, { force, dryRun, verbose });
40
40
 
41
41
  if (!result.success) {
42
- syncSpin.error("Sync failed");
42
+ syncSpin.stop();
43
+ error("Sync failed");
43
44
  if (result.error) {
44
- error(result.error);
45
+ info(result.error);
45
46
  }
47
+ info("Check your network connection and try again");
46
48
  process.exit(1);
47
49
  }
48
50
 
@@ -217,11 +217,11 @@ export async function buildProject(options: BuildOptions): Promise<BuildOutput>
217
217
 
218
218
  if (dryRunResult.exitCode !== 0) {
219
219
  reporter?.stop();
220
- reporter?.error("Worker build failed");
220
+ reporter?.error("Build failed");
221
221
  throw new JackError(
222
222
  JackErrorCode.BUILD_FAILED,
223
- "Worker build failed",
224
- "Check your wrangler.jsonc and worker code for errors",
223
+ "Build failed",
224
+ "Check your code for syntax errors",
225
225
  {
226
226
  exitCode: dryRunResult.exitCode,
227
227
  stderr: dryRunResult.stderr.toString(),
@@ -32,6 +32,7 @@ export async function ensureWrangler(): Promise<void> {
32
32
 
33
33
  if (install.exitCode !== 0) {
34
34
  spin.error("Failed to install wrangler");
35
+ error("Try manually: bun add -g wrangler");
35
36
  process.exit(1);
36
37
  }
37
38
  spin.success("Installed wrangler");
@@ -53,6 +54,7 @@ export async function ensureAuth(): Promise<void> {
53
54
 
54
55
  if (login.exitCode !== 0) {
55
56
  error("Failed to authenticate with Cloudflare");
57
+ error("Try manually: wrangler login");
56
58
  process.exit(1);
57
59
  }
58
60
  }
package/src/mcp/utils.ts CHANGED
@@ -142,6 +142,6 @@ export function getSuggestionForError(code: McpErrorCode): string {
142
142
  return "Review the error message and ensure all required fields are provided correctly.";
143
143
 
144
144
  default:
145
- return "An unexpected error occurred. Check the error message for details.";
145
+ return "Check the error message above for details. If the problem persists, try running the equivalent CLI command directly.";
146
146
  }
147
147
  }