@sidekickdb/cli 2.0.1 → 3.0.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.
Files changed (265) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/README.md +4 -4
  3. package/__tests__/appCommands.test.ts +8 -8
  4. package/__tests__/auth.test.ts +11 -65
  5. package/__tests__/authClientAddApple.test.ts +3 -3
  6. package/__tests__/authClientAddClerk.test.ts +8 -13
  7. package/__tests__/authClientAddGithub.test.ts +5 -5
  8. package/__tests__/authClientAddGoogle.test.ts +3 -3
  9. package/__tests__/authClientAddLinkedin.test.ts +3 -3
  10. package/__tests__/authClientList.test.ts +4 -3
  11. package/__tests__/authClientUpdate.test.ts +6 -8
  12. package/__tests__/authOriginManagement.test.ts +11 -11
  13. package/__tests__/backups.test.ts +2 -2
  14. package/__tests__/config.test.ts +34 -34
  15. package/__tests__/configAliases.test.ts +27 -215
  16. package/__tests__/configFileNames.test.ts +118 -0
  17. package/__tests__/e2e/cli.e2e.test.ts +102 -102
  18. package/__tests__/e2e/helpers.ts +5 -5
  19. package/__tests__/effectHelpers.ts +3 -3
  20. package/__tests__/emailVerification.test.ts +31 -0
  21. package/__tests__/oldConfigFiles.test.ts +254 -0
  22. package/__tests__/webhooks.test.ts +2 -2
  23. package/dist/auth/index.d.ts.map +1 -1
  24. package/dist/auth/index.js +6 -43
  25. package/dist/auth/index.js.map +1 -1
  26. package/dist/commands/app/delete.d.ts +2 -2
  27. package/dist/commands/app/delete.d.ts.map +1 -1
  28. package/dist/commands/app/delete.js +2 -2
  29. package/dist/commands/app/delete.js.map +1 -1
  30. package/dist/commands/app/list.d.ts +2 -2
  31. package/dist/commands/app/list.d.ts.map +1 -1
  32. package/dist/commands/app/list.js +2 -2
  33. package/dist/commands/app/list.js.map +1 -1
  34. package/dist/commands/auth/client/add.d.ts +1 -1
  35. package/dist/commands/auth/client/add.d.ts.map +1 -1
  36. package/dist/commands/auth/client/delete.d.ts +2 -2
  37. package/dist/commands/auth/client/delete.d.ts.map +1 -1
  38. package/dist/commands/auth/client/delete.js +2 -2
  39. package/dist/commands/auth/client/delete.js.map +1 -1
  40. package/dist/commands/auth/client/list.d.ts +1 -1
  41. package/dist/commands/auth/client/list.d.ts.map +1 -1
  42. package/dist/commands/auth/client/update.d.ts +1 -1
  43. package/dist/commands/auth/client/update.d.ts.map +1 -1
  44. package/dist/commands/auth/email/pull.d.ts +4 -4
  45. package/dist/commands/auth/email/pull.d.ts.map +1 -1
  46. package/dist/commands/auth/email/pull.js +5 -2
  47. package/dist/commands/auth/email/pull.js.map +1 -1
  48. package/dist/commands/auth/email/push.d.ts +2 -2
  49. package/dist/commands/auth/email/push.d.ts.map +1 -1
  50. package/dist/commands/auth/email/push.js +3 -3
  51. package/dist/commands/auth/email/push.js.map +1 -1
  52. package/dist/commands/auth/email/resend.d.ts +1 -1
  53. package/dist/commands/auth/email/resend.d.ts.map +1 -1
  54. package/dist/commands/auth/email/reset.d.ts +2 -2
  55. package/dist/commands/auth/email/reset.d.ts.map +1 -1
  56. package/dist/commands/auth/email/reset.js +3 -3
  57. package/dist/commands/auth/email/reset.js.map +1 -1
  58. package/dist/commands/auth/email/status.d.ts +4 -4
  59. package/dist/commands/auth/email/status.d.ts.map +1 -1
  60. package/dist/commands/auth/email/status.js +4 -4
  61. package/dist/commands/auth/email/status.js.map +1 -1
  62. package/dist/commands/auth/email/verify.d.ts +1 -1
  63. package/dist/commands/auth/email/verify.d.ts.map +1 -1
  64. package/dist/commands/auth/email/verify.js +1 -1
  65. package/dist/commands/auth/email/verify.js.map +1 -1
  66. package/dist/commands/auth/origin/add.d.ts +1 -1
  67. package/dist/commands/auth/origin/add.d.ts.map +1 -1
  68. package/dist/commands/auth/origin/delete.d.ts +1 -1
  69. package/dist/commands/auth/origin/delete.d.ts.map +1 -1
  70. package/dist/commands/auth/origin/list.d.ts +1 -1
  71. package/dist/commands/auth/origin/list.d.ts.map +1 -1
  72. package/dist/commands/claim.d.ts +2 -2
  73. package/dist/commands/claim.d.ts.map +1 -1
  74. package/dist/commands/claim.js +2 -2
  75. package/dist/commands/claim.js.map +1 -1
  76. package/dist/commands/info.js +2 -2
  77. package/dist/commands/info.js.map +1 -1
  78. package/dist/commands/init.d.ts +1 -1
  79. package/dist/commands/init.d.ts.map +1 -1
  80. package/dist/commands/init.js +3 -0
  81. package/dist/commands/init.js.map +1 -1
  82. package/dist/commands/initWithoutFiles.d.ts.map +1 -1
  83. package/dist/commands/initWithoutFiles.js +7 -3
  84. package/dist/commands/initWithoutFiles.js.map +1 -1
  85. package/dist/commands/login.d.ts +1 -1
  86. package/dist/commands/login.d.ts.map +1 -1
  87. package/dist/commands/pull.d.ts +1 -1
  88. package/dist/commands/pull.d.ts.map +1 -1
  89. package/dist/commands/pull.js +4 -0
  90. package/dist/commands/pull.js.map +1 -1
  91. package/dist/commands/push.d.ts +1 -1
  92. package/dist/commands/push.d.ts.map +1 -1
  93. package/dist/commands/push.js +4 -0
  94. package/dist/commands/push.js.map +1 -1
  95. package/dist/commands/query.d.ts +1 -1
  96. package/dist/commands/query.d.ts.map +1 -1
  97. package/dist/commands/query.js +2 -2
  98. package/dist/commands/query.js.map +1 -1
  99. package/dist/context/authToken.d.ts +2 -2
  100. package/dist/context/authToken.d.ts.map +1 -1
  101. package/dist/context/authToken.js +6 -4
  102. package/dist/context/authToken.js.map +1 -1
  103. package/dist/context/currentApp.d.ts +3 -3
  104. package/dist/context/currentApp.d.ts.map +1 -1
  105. package/dist/context/currentApp.js +20 -20
  106. package/dist/context/currentApp.js.map +1 -1
  107. package/dist/context/globalOpts.d.ts +1 -1
  108. package/dist/context/globalOpts.js +1 -1
  109. package/dist/context/globalOpts.js.map +1 -1
  110. package/dist/context/platformApi.d.ts +3 -3
  111. package/dist/context/platformApi.d.ts.map +1 -1
  112. package/dist/context/platformApi.js +3 -3
  113. package/dist/context/platformApi.js.map +1 -1
  114. package/dist/context/projectInfo.d.ts +4 -4
  115. package/dist/context/projectInfo.d.ts.map +1 -1
  116. package/dist/context/projectInfo.js +12 -18
  117. package/dist/context/projectInfo.js.map +1 -1
  118. package/dist/index.d.ts.map +1 -1
  119. package/dist/index.js +42 -49
  120. package/dist/index.js.map +1 -1
  121. package/dist/layer.d.ts +4 -4
  122. package/dist/layer.d.ts.map +1 -1
  123. package/dist/layer.js +7 -7
  124. package/dist/layer.js.map +1 -1
  125. package/dist/lib/backupDownload.js +1 -1
  126. package/dist/lib/backupDownload.js.map +1 -1
  127. package/dist/lib/config.d.ts +2 -2
  128. package/dist/lib/config.d.ts.map +1 -1
  129. package/dist/lib/config.js +21 -23
  130. package/dist/lib/config.js.map +1 -1
  131. package/dist/lib/createApp.d.ts +2 -2
  132. package/dist/lib/createApp.d.ts.map +1 -1
  133. package/dist/lib/createApp.js +2 -2
  134. package/dist/lib/createApp.js.map +1 -1
  135. package/dist/lib/email.d.ts +38 -6
  136. package/dist/lib/email.d.ts.map +1 -1
  137. package/dist/lib/email.js +22 -13
  138. package/dist/lib/email.js.map +1 -1
  139. package/dist/lib/handleEnv.js +4 -4
  140. package/dist/lib/handleEnv.js.map +1 -1
  141. package/dist/lib/http.d.ts +13 -13
  142. package/dist/lib/http.d.ts.map +1 -1
  143. package/dist/lib/http.js +12 -12
  144. package/dist/lib/http.js.map +1 -1
  145. package/dist/lib/login.d.ts +4 -4
  146. package/dist/lib/login.d.ts.map +1 -1
  147. package/dist/lib/login.js +4 -4
  148. package/dist/lib/login.js.map +1 -1
  149. package/dist/lib/oauth.d.ts +10 -10
  150. package/dist/lib/oauth.d.ts.map +1 -1
  151. package/dist/lib/oauth.js +7 -7
  152. package/dist/lib/oauth.js.map +1 -1
  153. package/dist/lib/platformApi.d.ts +2 -2
  154. package/dist/lib/platformApi.d.ts.map +1 -1
  155. package/dist/lib/platformApi.js +2 -2
  156. package/dist/lib/platformApi.js.map +1 -1
  157. package/dist/lib/pullPerms.d.ts +2 -2
  158. package/dist/lib/pullPerms.d.ts.map +1 -1
  159. package/dist/lib/pullPerms.js +7 -4
  160. package/dist/lib/pullPerms.js.map +1 -1
  161. package/dist/lib/pullSchema.d.ts +2 -2
  162. package/dist/lib/pullSchema.d.ts.map +1 -1
  163. package/dist/lib/pullSchema.js +8 -5
  164. package/dist/lib/pullSchema.js.map +1 -1
  165. package/dist/lib/pushPerms.d.ts +2 -2
  166. package/dist/lib/pushPerms.d.ts.map +1 -1
  167. package/dist/lib/pushPerms.js +6 -3
  168. package/dist/lib/pushPerms.js.map +1 -1
  169. package/dist/lib/pushSchema.d.ts +2 -2
  170. package/dist/lib/pushSchema.d.ts.map +1 -1
  171. package/dist/lib/pushSchema.js +18 -7
  172. package/dist/lib/pushSchema.js.map +1 -1
  173. package/dist/lib/webhooks.d.ts +1 -1
  174. package/dist/lib/webhooks.d.ts.map +1 -1
  175. package/dist/old.js +9 -9
  176. package/dist/old.js.map +1 -1
  177. package/dist/renderSchemaPlan.d.ts +2 -2
  178. package/dist/renderSchemaPlan.d.ts.map +1 -1
  179. package/dist/renderSchemaPlan.js.map +1 -1
  180. package/dist/util/findConfigCandidates.d.ts +0 -20
  181. package/dist/util/findConfigCandidates.d.ts.map +1 -1
  182. package/dist/util/findConfigCandidates.js +44 -63
  183. package/dist/util/findConfigCandidates.js.map +1 -1
  184. package/dist/util/getAppName.d.ts +2 -2
  185. package/dist/util/getAppName.d.ts.map +1 -1
  186. package/dist/util/getAppName.js +2 -2
  187. package/dist/util/getAppName.js.map +1 -1
  188. package/dist/util/isHeadlessEnvironment.js +1 -1
  189. package/dist/util/isHeadlessEnvironment.js.map +1 -1
  190. package/dist/util/loadConfig.d.ts.map +1 -1
  191. package/dist/util/loadConfig.js +4 -11
  192. package/dist/util/loadConfig.js.map +1 -1
  193. package/dist/util/loadEnv.d.ts.map +1 -1
  194. package/dist/util/loadEnv.js +0 -6
  195. package/dist/util/loadEnv.js.map +1 -1
  196. package/dist/util/oldConfigFiles.d.ts +30 -0
  197. package/dist/util/oldConfigFiles.d.ts.map +1 -0
  198. package/dist/util/oldConfigFiles.js +104 -0
  199. package/dist/util/oldConfigFiles.js.map +1 -0
  200. package/dist/util/projectDir.d.ts +1 -1
  201. package/dist/util/projectDir.d.ts.map +1 -1
  202. package/dist/util/projectDir.js +6 -9
  203. package/dist/util/projectDir.js.map +1 -1
  204. package/dist/util/sidekickConfig.d.ts +9 -0
  205. package/dist/util/sidekickConfig.d.ts.map +1 -0
  206. package/dist/util/sidekickConfig.js +18 -0
  207. package/dist/util/sidekickConfig.js.map +1 -0
  208. package/package.json +5 -6
  209. package/src/auth/index.ts +6 -54
  210. package/src/commands/app/delete.ts +2 -2
  211. package/src/commands/app/list.ts +2 -2
  212. package/src/commands/auth/client/delete.ts +2 -2
  213. package/src/commands/auth/email/pull.ts +5 -2
  214. package/src/commands/auth/email/push.ts +3 -3
  215. package/src/commands/auth/email/reset.ts +5 -3
  216. package/src/commands/auth/email/status.ts +4 -4
  217. package/src/commands/auth/email/verify.ts +1 -1
  218. package/src/commands/claim.ts +2 -2
  219. package/src/commands/info.ts +2 -2
  220. package/src/commands/init.ts +3 -0
  221. package/src/commands/initWithoutFiles.ts +13 -6
  222. package/src/commands/pull.ts +6 -0
  223. package/src/commands/push.ts +6 -0
  224. package/src/commands/query.ts +2 -2
  225. package/src/context/authToken.ts +9 -5
  226. package/src/context/currentApp.ts +20 -20
  227. package/src/context/globalOpts.ts +1 -1
  228. package/src/context/platformApi.ts +3 -3
  229. package/src/context/projectInfo.ts +13 -20
  230. package/src/index.ts +42 -52
  231. package/src/layer.ts +10 -10
  232. package/src/lib/backupDownload.ts +1 -1
  233. package/src/lib/config.ts +21 -23
  234. package/src/lib/createApp.ts +2 -2
  235. package/src/lib/email.ts +30 -15
  236. package/src/lib/handleEnv.ts +4 -4
  237. package/src/lib/http.ts +28 -24
  238. package/src/lib/login.ts +4 -4
  239. package/src/lib/oauth.ts +7 -7
  240. package/src/lib/platformApi.ts +2 -2
  241. package/src/lib/pullPerms.ts +7 -4
  242. package/src/lib/pullSchema.ts +9 -6
  243. package/src/lib/pushPerms.ts +6 -3
  244. package/src/lib/pushSchema.ts +19 -7
  245. package/src/old.js +9 -9
  246. package/src/renderSchemaPlan.ts +3 -3
  247. package/src/util/findConfigCandidates.ts +45 -71
  248. package/src/util/getAppName.ts +2 -2
  249. package/src/util/isHeadlessEnvironment.ts +1 -1
  250. package/src/util/loadConfig.ts +4 -12
  251. package/src/util/loadEnv.ts +0 -8
  252. package/src/util/oldConfigFiles.ts +132 -0
  253. package/src/util/projectDir.ts +7 -9
  254. package/src/util/sidekickConfig.ts +25 -0
  255. package/__tests__/legacyPackageCompat.test.ts +0 -104
  256. package/dist/util/envAliases.d.ts +0 -25
  257. package/dist/util/envAliases.d.ts.map +0 -1
  258. package/dist/util/envAliases.js +0 -47
  259. package/dist/util/envAliases.js.map +0 -1
  260. package/dist/util/instantConfig.d.ts +0 -9
  261. package/dist/util/instantConfig.d.ts.map +0 -1
  262. package/dist/util/instantConfig.js +0 -13
  263. package/dist/util/instantConfig.js.map +0 -1
  264. package/src/util/envAliases.ts +0 -53
  265. package/src/util/instantConfig.ts +0 -21
package/dist/index.js CHANGED
@@ -55,14 +55,7 @@ program
55
55
  process.exit(0);
56
56
  }))
57
57
  .addHelpOption(globalOption('-h --help', 'Print the help text for a command'))
58
- .usage(`<command> ${chalk.dim('[options] [args]')}`)
59
- .addHelpText('after', `
60
- Names:
61
- Every INSTANT_* environment variable can also be set as SIDEKICK_*, for
62
- example SIDEKICK_CLI_API_URI or NEXT_PUBLIC_SIDEKICK_APP_ID, and the
63
- instant.config, instant.schema, instant.perms and instant.email files can be
64
- named sidekick.* instead. The SIDEKICK name wins when both exist.
65
- `);
58
+ .usage(`<command> ${chalk.dim('[options] [args]')}`);
66
59
  // Command List
67
60
  export const initDef = program
68
61
  .command('init')
@@ -101,7 +94,7 @@ export const appListDef = app
101
94
  export const appDeleteDef = app
102
95
  .command('delete')
103
96
  .description('Delete an app from your SidekickDB account')
104
- .option('-a --app <app-id>', 'App ID to delete. Defaults to *_INSTANT_APP_ID in .env')
97
+ .option('-a --app <app-id>', 'App ID to delete. Defaults to *_SIDEKICK_APP_ID in .env')
105
98
  .action(async (opts) => {
106
99
  return runCommandEffect(appDeleteCommand(opts).pipe(Effect.provide(AuthLayerLive({
107
100
  coerce: false,
@@ -115,7 +108,7 @@ export const authClientAddDef = authClient
115
108
  .allowUnknownOption(true)
116
109
  .option('--type <google|github|apple|linkedin>', 'Type of oauth client to add')
117
110
  .option('--name <client name>', 'Custom name to identify the OAuth client (ex: google-web)')
118
- .option('-a --app <app-id>', 'App ID to modify. Defaults to *_INSTANT_APP_ID in .env')
111
+ .option('-a --app <app-id>', 'App ID to modify. Defaults to *_SIDEKICK_APP_ID in .env')
119
112
  .addHelpText('after', `
120
113
  Provider Specific Options:
121
114
  Google:
@@ -157,7 +150,7 @@ Provider Specific Options:
157
150
  });
158
151
  export const authClientListDef = authClient
159
152
  .command('list')
160
- .option('-a --app <app-id>', 'App ID to list clients for. Defaults to *_INSTANT_APP_ID in .env')
153
+ .option('-a --app <app-id>', 'App ID to list clients for. Defaults to *_SIDEKICK_APP_ID in .env')
161
154
  .option('--json', 'Enable JSON output')
162
155
  .allowUnknownOption(true)
163
156
  .action((opts) => {
@@ -166,14 +159,14 @@ export const authClientListDef = authClient
166
159
  coerceAuth: false,
167
160
  appId: opts.app,
168
161
  allowAdminToken: true,
169
- // Silence "searching for instant sdk.. logs for json output"
162
+ // Silence "searching for SidekickDB sdk.. logs for json output"
170
163
  }).pipe(Layer.annotateLogs('silent', !!opts.json)))));
171
164
  });
172
165
  export const authClientDeleteDef = authClient
173
166
  .command('delete')
174
167
  .option('--id <client-id>', 'Client ID to delete')
175
168
  .option('--name <client-name>', 'Client name to delete')
176
- .option('-a --app <app-id>', 'App ID to delete a client from. Defaults to *_INSTANT_APP_ID in .env')
169
+ .option('-a --app <app-id>', 'App ID to delete a client from. Defaults to *_SIDEKICK_APP_ID in .env')
177
170
  .action((opts) => {
178
171
  return runCommandEffect(authClientDeleteCmd(opts).pipe(Effect.provide(WithAppLayer({
179
172
  coerce: false,
@@ -188,7 +181,7 @@ export const authClientUpdateDef = authClient
188
181
  .allowUnknownOption(true)
189
182
  .option('--id <client-id>', 'Client ID to update')
190
183
  .option('--name <client-name>', 'Client name to update')
191
- .option('-a --app <app-id>', 'App ID to update a client in. Defaults to *_INSTANT_APP_ID in .env')
184
+ .option('-a --app <app-id>', 'App ID to update a client in. Defaults to *_SIDEKICK_APP_ID in .env')
192
185
  .addHelpText('after', `
193
186
  Provider Specific Options:
194
187
  Google:
@@ -229,7 +222,7 @@ Provider Specific Options:
229
222
  const authOrigin = auth.command('origin');
230
223
  export const authOriginListDef = authOrigin
231
224
  .command('list')
232
- .option('-a --app <app-id>', 'App ID to list origins for. Defaults to *_INSTANT_APP_ID in .env')
225
+ .option('-a --app <app-id>', 'App ID to list origins for. Defaults to *_SIDEKICK_APP_ID in .env')
233
226
  .option('--json', 'Enable JSON output')
234
227
  .action((opts) => {
235
228
  return runCommandEffect(authOriginListCmd(opts).pipe(Effect.provide(WithAppLayer({
@@ -246,7 +239,7 @@ export const authOriginAddDef = authOrigin
246
239
  .option('--project <name>', 'Vercel project name (for vercel type, e.g. my-project)')
247
240
  .option('--site <name>', 'Netlify site name (for netlify type, e.g. my-site)')
248
241
  .option('--scheme <scheme>', 'App scheme (for custom-scheme type, e.g. myapp://)')
249
- .option('-a --app <app-id>', 'App ID to add an origin to. Defaults to *_INSTANT_APP_ID in .env')
242
+ .option('-a --app <app-id>', 'App ID to add an origin to. Defaults to *_SIDEKICK_APP_ID in .env')
250
243
  .addHelpText('after', `
251
244
  Origin Types:
252
245
  website A standard website origin (e.g. example.com)
@@ -265,7 +258,7 @@ Origin Types:
265
258
  export const authOriginDeleteDef = authOrigin
266
259
  .command('delete')
267
260
  .option('--id <origin-id>', 'Origin ID to delete')
268
- .option('-a --app <app-id>', 'App ID to delete an origin from. Defaults to *_INSTANT_APP_ID in .env')
261
+ .option('-a --app <app-id>', 'App ID to delete an origin from. Defaults to *_SIDEKICK_APP_ID in .env')
269
262
  .action((opts) => {
270
263
  return runCommandEffect(authOriginDeleteCmd(opts).pipe(Effect.provide(WithAppLayer({
271
264
  coerce: false,
@@ -279,7 +272,7 @@ const webhooks = program
279
272
  export const webhooksListDef = webhooks
280
273
  .command('list')
281
274
  .description('List webhooks for an app')
282
- .option('-a --app <app-id>', 'App ID to list webhooks for. Defaults to *_INSTANT_APP_ID in .env')
275
+ .option('-a --app <app-id>', 'App ID to list webhooks for. Defaults to *_SIDEKICK_APP_ID in .env')
283
276
  .option('--json', 'Enable JSON output')
284
277
  .action((opts) => {
285
278
  return runCommandEffect(webhooksListCmd(opts).pipe(Effect.provide(WithAppLayer({
@@ -295,7 +288,7 @@ export const webhooksAddDef = webhooks
295
288
  .option('--url <url>', 'HTTPS endpoint to deliver events to')
296
289
  .option('--namespaces <e1,e2>', 'Comma-separated list of namespaces to listen on')
297
290
  .option('--actions <a1,a2>', 'Comma-separated list of actions (create, update, delete)')
298
- .option('-a --app <app-id>', 'App ID to add a webhook to. Defaults to *_INSTANT_APP_ID in .env')
291
+ .option('-a --app <app-id>', 'App ID to add a webhook to. Defaults to *_SIDEKICK_APP_ID in .env')
299
292
  .action((opts) => {
300
293
  return runCommandEffect(webhooksAddCmd(opts).pipe(Effect.provide(WithAppLayer({
301
294
  coerce: false,
@@ -311,7 +304,7 @@ export const webhooksUpdateDef = webhooks
311
304
  .option('--url <url>', 'New HTTPS endpoint')
312
305
  .option('--namespaces <e1,e2>', 'New comma-separated namespaces')
313
306
  .option('--actions <a1,a2>', 'New comma-separated actions (create, update, delete)')
314
- .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env')
307
+ .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
315
308
  .action((opts) => {
316
309
  return runCommandEffect(webhooksUpdateCmd(opts).pipe(Effect.provide(WithAppLayer({
317
310
  coerce: false,
@@ -324,7 +317,7 @@ export const webhooksDeleteDef = webhooks
324
317
  .command('delete')
325
318
  .description('Delete a webhook')
326
319
  .option('--id <webhook-id>', 'Webhook ID to delete')
327
- .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env')
320
+ .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
328
321
  .action((opts) => {
329
322
  return runCommandEffect(webhooksDeleteCmd(opts).pipe(Effect.provide(WithAppLayer({
330
323
  coerce: false,
@@ -337,7 +330,7 @@ export const webhooksEnableDef = webhooks
337
330
  .command('enable')
338
331
  .description('Re-enable a disabled webhook')
339
332
  .option('--id <webhook-id>', 'Webhook ID to enable')
340
- .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env')
333
+ .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
341
334
  .action((opts) => {
342
335
  return runCommandEffect(webhooksEnableCmd(opts).pipe(Effect.provide(WithAppLayer({
343
336
  coerce: false,
@@ -351,7 +344,7 @@ export const webhooksDisableDef = webhooks
351
344
  .description('Disable an active webhook')
352
345
  .option('--id <webhook-id>', 'Webhook ID to disable')
353
346
  .option('--reason <reason>', 'Human-readable reason stored on the webhook')
354
- .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env')
347
+ .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
355
348
  .action((opts) => {
356
349
  return runCommandEffect(webhooksDisableCmd(opts).pipe(Effect.provide(WithAppLayer({
357
350
  coerce: false,
@@ -368,7 +361,7 @@ export const webhooksEventsListDef = webhooksEvents
368
361
  .description('List recent events for a webhook (up to 100, newest first)')
369
362
  .option('--webhook-id <webhook-id>', 'Webhook ID to inspect')
370
363
  .option('--json', 'Enable JSON output')
371
- .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env')
364
+ .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
372
365
  .action((opts) => {
373
366
  return runCommandEffect(webhooksEventsListCmd(opts).pipe(Effect.provide(WithAppLayer({
374
367
  coerce: false,
@@ -382,7 +375,7 @@ export const webhooksEventsResendDef = webhooksEvents
382
375
  .description('Re-queue a webhook event for delivery')
383
376
  .option('--webhook-id <webhook-id>', 'Webhook ID the event belongs to')
384
377
  .option('--isn <isn>', 'Event ISN to resend')
385
- .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env')
378
+ .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
386
379
  .action((opts) => {
387
380
  return runCommandEffect(webhooksEventsResendCmd(opts).pipe(Effect.provide(WithAppLayer({
388
381
  coerce: false,
@@ -396,7 +389,7 @@ export const webhooksEventsPayloadDef = webhooksEvents
396
389
  .description('Print the JSON payload for a webhook event')
397
390
  .option('--webhook-id <webhook-id>', 'Webhook ID the event belongs to')
398
391
  .option('--isn <isn>', 'Event ISN to fetch')
399
- .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env')
392
+ .option('-a --app <app-id>', 'App ID the webhook belongs to. Defaults to *_SIDEKICK_APP_ID in .env')
400
393
  .action((opts) => {
401
394
  return runCommandEffect(webhooksEventsPayloadCmd(opts).pipe(Effect.provide(WithAppLayer({
402
395
  coerce: false,
@@ -411,7 +404,7 @@ const backup = program
411
404
  export const backupListDef = backup
412
405
  .command('list')
413
406
  .description('List downloadable backups for an app')
414
- .option('-a --app <app-id>', 'App ID to list backups for. Defaults to *_INSTANT_APP_ID in .env')
407
+ .option('-a --app <app-id>', 'App ID to list backups for. Defaults to *_SIDEKICK_APP_ID in .env')
415
408
  .option('--json', 'Output backups as JSON')
416
409
  .action((opts) => {
417
410
  return runCommandEffect(backupListCmd(opts).pipe(Effect.provide(WithAppLayer({
@@ -425,9 +418,9 @@ export const backupDownloadDef = backup
425
418
  .command('download')
426
419
  .description('Download a backup as a zip file')
427
420
  .argument('[backup-id]', 'Backup ID to download. Defaults to an interactive picker')
428
- .option('-a --app <app-id>', 'App ID to download a backup of. Defaults to *_INSTANT_APP_ID in .env')
421
+ .option('-a --app <app-id>', 'App ID to download a backup of. Defaults to *_SIDEKICK_APP_ID in .env')
429
422
  .option('--latest', 'Download the most recent backup')
430
- .option('-o --out <path>', 'Output zip path. Defaults to instant-backup-<timestamp>.zip')
423
+ .option('-o --out <path>', 'Output zip path. Defaults to sidekick-backup-<timestamp>.zip')
431
424
  .action((backupId, opts) => {
432
425
  return runCommandEffect(backupDownloadCmd(backupId, opts).pipe(Effect.provide(WithAppLayer({
433
426
  coerce: false,
@@ -442,7 +435,7 @@ const authEmail = auth
442
435
  export const authEmailStatusDef = authEmail
443
436
  .command('status')
444
437
  .description('Get status for the custom magic code email template')
445
- .option('-a --app <app-id>', 'App ID to push email settings to. Defaults to *_INSTANT_APP_ID in .env')
438
+ .option('-a --app <app-id>', 'App ID to push email settings to. Defaults to *_SIDEKICK_APP_ID in .env')
446
439
  .option('--json', 'Output email status as JSON')
447
440
  .action((opts) => {
448
441
  runCommandEffect(emailStatusCmd(opts).pipe(Effect.provide(WithAppLayer({
@@ -454,8 +447,8 @@ export const authEmailStatusDef = authEmail
454
447
  export const authEmailPushDef = authEmail
455
448
  .command('push')
456
449
  .description('Push the custom magic code email template.')
457
- .option('-a --app <app-id>', 'App ID to push email settings to. Defaults to *_INSTANT_APP_ID in .env')
458
- .option('-f --file <path>', 'Path to instant.email.ts. Defaults to INSTANT_EMAIL_FILE_PATH or auto-discovery.')
450
+ .option('-a --app <app-id>', 'App ID to push email settings to. Defaults to *_SIDEKICK_APP_ID in .env')
451
+ .option('-f --file <path>', 'Path to sidekick.email.ts. Defaults to SIDEKICK_EMAIL_FILE_PATH or auto-discovery.')
459
452
  .action((opts) => runCommandEffect(authEmailPushCmd({ file: opts.file }).pipe(Effect.provide(WithAppLayer({
460
453
  coerce: false,
461
454
  coerceAuth: false,
@@ -465,8 +458,8 @@ export const authEmailPushDef = authEmail
465
458
  export const authEmailPullDef = authEmail
466
459
  .command('pull')
467
460
  .description('Pull the custom magic code email template.')
468
- .option('-a --app <app-id>', 'App ID to pull email settings from. Defaults to *_INSTANT_APP_ID in .env')
469
- .option('-f --file <path>', 'Path to instant.email.ts. Defaults to INSTANT_EMAIL_FILE_PATH or auto-discovery.')
461
+ .option('-a --app <app-id>', 'App ID to pull email settings from. Defaults to *_SIDEKICK_APP_ID in .env')
462
+ .option('-f --file <path>', 'Path to sidekick.email.ts. Defaults to SIDEKICK_EMAIL_FILE_PATH or auto-discovery.')
470
463
  .action((opts) => runCommandEffect(authEmailPullCmd({ file: opts.file }).pipe(Effect.provide(WithAppLayer({
471
464
  coerce: false,
472
465
  coerceAuth: false,
@@ -476,7 +469,7 @@ export const authEmailPullDef = authEmail
476
469
  export const authEmailResetDef = authEmail
477
470
  .command('reset')
478
471
  .description('Delete the custom magic code email template.')
479
- .option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *_INSTANT_APP_ID in .env')
472
+ .option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *_SIDEKICK_APP_ID in .env')
480
473
  .action((opts) => runCommandEffect(authEmailResetCmd().pipe(Effect.provide(WithAppLayer({
481
474
  coerce: false,
482
475
  coerceAuth: false,
@@ -486,7 +479,7 @@ export const authEmailResetDef = authEmail
486
479
  export const authEmailResendDef = authEmail
487
480
  .command('resend')
488
481
  .description('Resend the verification email')
489
- .option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *_INSTANT_APP_ID in .env')
482
+ .option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *_SIDEKICK_APP_ID in .env')
490
483
  .action(() => {
491
484
  runCommandEffect(resendEmailCmd.pipe(Effect.provide(WithAppLayer({
492
485
  coerce: false,
@@ -498,7 +491,7 @@ export const authEmailVerifyDef = authEmail
498
491
  .command('verify')
499
492
  .description('Verify a custom email sender with a magic code')
500
493
  .argument('<code>', 'The magic code to verify')
501
- .option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *_INSTANT_APP_ID in .env')
494
+ .option('-a --app <app-id>', 'App ID to reset email settings for. Defaults to *_SIDEKICK_APP_ID in .env')
502
495
  .action((code, opts) => {
503
496
  runCommandEffect(verifyCmd(code, opts).pipe(Effect.provide(WithAppLayer({
504
497
  coerce: false,
@@ -543,7 +536,7 @@ export const infoDef = program
543
536
  export const explorerDef = program
544
537
  .command('explorer')
545
538
  .description('Opens the Explorer in your browser')
546
- .option('-a --app <app-id>', 'App ID to open the explorer to. Defaults to *_INSTANT_APP_ID in .env')
539
+ .option('-a --app <app-id>', 'App ID to open the explorer to. Defaults to *_SIDEKICK_APP_ID in .env')
547
540
  .action(async (opts) => {
548
541
  return runCommandEffect(explorerCmd(opts).pipe(Effect.provide(WithAppLayer({
549
542
  coerce: true,
@@ -553,27 +546,27 @@ export const explorerDef = program
553
546
  });
554
547
  export const queryDef = program
555
548
  .command('query')
556
- .argument('<query>', 'InstaQL query as JSON/JSON5')
557
- .option('-a --app <app-id>', 'App ID to query. Defaults to *_INSTANT_APP_ID in .env')
549
+ .argument('<query>', 'SideQL query as JSON/JSON5')
550
+ .option('-a --app <app-id>', 'App ID to query. Defaults to *_SIDEKICK_APP_ID in .env')
558
551
  .option('--admin', 'Run the query as admin (bypasses permissions)')
559
552
  .option('--as-email <email>', 'Run the query as a specific user by email')
560
553
  .option('--as-guest', 'Run the query as an unauthenticated guest')
561
554
  .option('--as-token <refresh-token>', 'Run the query as a user identified by refresh token')
562
- .description('Run an InstaQL query against your app.')
555
+ .description('Run a SideQL query against your app.')
563
556
  .action(async function (queryArg, opts) {
564
557
  return runCommandEffect(queryCmd(queryArg, opts));
565
558
  });
566
559
  export const pullDef = program
567
560
  .command('pull')
568
561
  .argument('[schema|perms|all]', 'Which configuration to pull. Defaults to `all`')
569
- .option('-a --app <app-id>', 'App ID to pull to. Defaults to *_INSTANT_APP_ID in .env')
562
+ .option('-a --app <app-id>', 'App ID to pull to. Defaults to *_SIDEKICK_APP_ID in .env')
570
563
  .option('-p --package <react|react-native|core|admin|solid|svelte>', 'Which package to automatically install if there is not one installed already.')
571
564
  .option('--experimental-type-preservation', "[Experimental] Preserve manual type changes like `status: i.json<'online' | 'offline'>()` when doing `sidekick-cli pull schema`")
572
565
  .description('Pull schema and perm files from production.')
573
566
  .addHelpText('after', `
574
567
  Environment Variables:
575
- INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)
576
- INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)
568
+ SIDEKICK_SCHEMA_FILE_PATH Override schema file location (default: sidekick.schema.ts)
569
+ SIDEKICK_PERMS_FILE_PATH Override perms file location (default: sidekick.perms.ts)
577
570
  `)
578
571
  .action(async function (arg, inputOpts) {
579
572
  return runCommandEffect(pullCommand(arg, inputOpts).pipe(Effect.provide(WithAppLayer({
@@ -585,15 +578,15 @@ Environment Variables:
585
578
  export const pushDef = program
586
579
  .command('push')
587
580
  .argument('[schema|perms|all]', 'Which configuration to push. Defaults to `all`')
588
- .option('-a --app <app-id>', 'App ID to push to. Defaults to *_INSTANT_APP_ID in .env')
581
+ .option('-a --app <app-id>', 'App ID to push to. Defaults to *_SIDEKICK_APP_ID in .env')
589
582
  .option('--skip-check-types', "Don't check types on the server when pushing schema")
590
583
  .option('--rename [renames...]', 'List of full attribute names separated by a ":"\n Example:`push --rename posts.author:posts.creator stores.owner:stores.manager`')
591
584
  .option('-p --package <react|react-native|core|admin|solid|svelte>', 'Which package to automatically install if there is not one installed already.')
592
585
  .description('Push schema and perm files to production.')
593
586
  .addHelpText('after', `
594
587
  Environment Variables:
595
- INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)
596
- INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)
588
+ SIDEKICK_SCHEMA_FILE_PATH Override schema file location (default: sidekick.schema.ts)
589
+ SIDEKICK_PERMS_FILE_PATH Override perms file location (default: sidekick.perms.ts)
597
590
  `)
598
591
  .action(async function (arg, inputOpts) {
599
592
  return runCommandEffect(pushCommand(arg, inputOpts).pipe(Effect.provide(WithAppLayer({
@@ -609,7 +602,7 @@ Environment Variables:
609
602
  export const claimDef = program
610
603
  .command('claim')
611
604
  .description('Transfer a temporary app into your SidekickDB account')
612
- .option('-a --app <app-id>', 'App to claim. Defaults to *_INSTANT_APP_ID in .env')
605
+ .option('-a --app <app-id>', 'App to claim. Defaults to *_SIDEKICK_APP_ID in .env')
613
606
  .action(async function (opts) {
614
607
  return runCommandEffect(claimCommand.pipe(Effect.provide(WithAppLayer({
615
608
  coerce: false,
@@ -629,7 +622,7 @@ function globalOption(flags, description, argParser) {
629
622
  // but we use it in `getLocalAndGlobalOptions`, to produce
630
623
  // our own custom list of local and global options.
631
624
  // For more info, see the original PR:
632
- // https://github.com/instantdb/instant/pull/505
625
+ // upstream pull request #505
633
626
  opt.__global = true;
634
627
  return opt;
635
628
  }