@capgo/cli 7.86.1 → 7.88.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.
@@ -233,15 +233,19 @@ export type Database = {
233
233
  };
234
234
  apps: {
235
235
  Row: {
236
+ android_store_url: string | null;
236
237
  app_id: string;
237
238
  channel_device_count: number;
238
239
  created_at: string | null;
239
240
  default_upload_channel: string;
241
+ existing_app: boolean;
240
242
  expose_metadata: boolean;
241
243
  icon_url: string;
242
244
  id: string | null;
245
+ ios_store_url: string | null;
243
246
  last_version: string | null;
244
247
  manifest_bundle_count: number;
248
+ need_onboarding: boolean;
245
249
  name: string | null;
246
250
  owner_org: string;
247
251
  retention: number;
@@ -250,15 +254,19 @@ export type Database = {
250
254
  user_id: string | null;
251
255
  };
252
256
  Insert: {
257
+ android_store_url?: string | null;
253
258
  app_id: string;
254
259
  channel_device_count?: number;
255
260
  created_at?: string | null;
256
261
  default_upload_channel?: string;
262
+ existing_app?: boolean;
257
263
  expose_metadata?: boolean;
258
264
  icon_url: string;
259
265
  id?: string | null;
266
+ ios_store_url?: string | null;
260
267
  last_version?: string | null;
261
268
  manifest_bundle_count?: number;
269
+ need_onboarding?: boolean;
262
270
  name?: string | null;
263
271
  owner_org: string;
264
272
  retention?: number;
@@ -267,15 +275,19 @@ export type Database = {
267
275
  user_id?: string | null;
268
276
  };
269
277
  Update: {
278
+ android_store_url?: string | null;
270
279
  app_id?: string;
271
280
  channel_device_count?: number;
272
281
  created_at?: string | null;
273
282
  default_upload_channel?: string;
283
+ existing_app?: boolean;
274
284
  expose_metadata?: boolean;
275
285
  icon_url?: string;
276
286
  id?: string | null;
287
+ ios_store_url?: string | null;
277
288
  last_version?: string | null;
278
289
  manifest_bundle_count?: number;
290
+ need_onboarding?: boolean;
279
291
  name?: string | null;
280
292
  owner_org?: string;
281
293
  retention?: number;
@@ -350,15 +350,19 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
350
350
  };
351
351
  apps: {
352
352
  Row: {
353
+ android_store_url: string | null;
353
354
  app_id: string;
354
355
  channel_device_count: number;
355
356
  created_at: string | null;
356
357
  default_upload_channel: string;
358
+ existing_app: boolean;
357
359
  expose_metadata: boolean;
358
360
  icon_url: string;
359
361
  id: string | null;
362
+ ios_store_url: string | null;
360
363
  last_version: string | null;
361
364
  manifest_bundle_count: number;
365
+ need_onboarding: boolean;
362
366
  name: string | null;
363
367
  owner_org: string;
364
368
  retention: number;
@@ -367,15 +371,19 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
367
371
  user_id: string | null;
368
372
  };
369
373
  Insert: {
374
+ android_store_url?: string | null;
370
375
  app_id: string;
371
376
  channel_device_count?: number;
372
377
  created_at?: string | null;
373
378
  default_upload_channel?: string;
379
+ existing_app?: boolean;
374
380
  expose_metadata?: boolean;
375
381
  icon_url: string;
376
382
  id?: string | null;
383
+ ios_store_url?: string | null;
377
384
  last_version?: string | null;
378
385
  manifest_bundle_count?: number;
386
+ need_onboarding?: boolean;
379
387
  name?: string | null;
380
388
  owner_org: string;
381
389
  retention?: number;
@@ -384,15 +392,19 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
384
392
  user_id?: string | null;
385
393
  };
386
394
  Update: {
395
+ android_store_url?: string | null;
387
396
  app_id?: string;
388
397
  channel_device_count?: number;
389
398
  created_at?: string | null;
390
399
  default_upload_channel?: string;
400
+ existing_app?: boolean;
391
401
  expose_metadata?: boolean;
392
402
  icon_url?: string;
393
403
  id?: string | null;
404
+ ios_store_url?: string | null;
394
405
  last_version?: string | null;
395
406
  manifest_bundle_count?: number;
407
+ need_onboarding?: boolean;
396
408
  name?: string | null;
397
409
  owner_org?: string;
398
410
  retention?: number;
@@ -1889,9 +1901,7 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
1889
1901
  credits_estimated: number;
1890
1902
  details?: import("./types/supabase.types").Json | null;
1891
1903
  id?: string;
1892
- metric: Database["public"]["Enums"] /**
1893
- * Read directory recursively and return full paths for all files
1894
- */["credit_metric_type"];
1904
+ metric: Database["public"]["Enums"]["credit_metric_type"];
1895
1905
  org_id: string;
1896
1906
  overage_amount: number;
1897
1907
  };
@@ -1942,7 +1952,13 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
1942
1952
  validated_at?: string;
1943
1953
  };
1944
1954
  Update: {
1945
- created_at?: string;
1955
+ created_at
1956
+ /**
1957
+ * Calculate checksums for iOS and Android native code in a dependency folder.
1958
+ * Includes both native source files and platform configuration files
1959
+ * (podspec, Package.swift, build.gradle) that define platform dependencies.
1960
+ */
1961
+ ?: string;
1946
1962
  id?: number;
1947
1963
  org_id?: string;
1948
1964
  policy_hash?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "7.86.1",
4
+ "version": "7.88.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -91,8 +91,11 @@
91
91
  "@supabase/supabase-js": "^2.79.0",
92
92
  "@tanstack/intent": "^0.0.23",
93
93
  "@types/adm-zip": "^0.5.7",
94
+ "@types/jsonwebtoken": "^9.0.10",
94
95
  "@types/node": "^25.0.0",
96
+ "@types/node-forge": "^1.3.14",
95
97
  "@types/prettyjson": "^0.0.33",
98
+ "@types/react": "^18.3.28",
96
99
  "@types/tmp": "^0.2.6",
97
100
  "@vercel/ncc": "^0.38.4",
98
101
  "adm-zip": "^0.5.16",
@@ -111,5 +114,13 @@
111
114
  "typescript": "^5.9.3",
112
115
  "ws": "^8.18.3",
113
116
  "zod": "^4.3.6"
117
+ },
118
+ "dependencies": {
119
+ "@inkjs/ui": "^2.0.0",
120
+ "ink": "^5.2.1",
121
+ "ink-spinner": "^5.0.0",
122
+ "jsonwebtoken": "^9.0.3",
123
+ "node-forge": "^1.3.3",
124
+ "react": "^18.3.1"
114
125
  }
115
126
  }
@@ -1,12 +1,71 @@
1
1
  ---
2
2
  name: native-builds
3
- description: Use when working with Capgo Cloud native iOS and Android build requests, credential storage, credential updates, and build output upload settings.
3
+ description: Use when working with Capgo Cloud native iOS and Android build requests, onboarding, credential storage, credential updates, and build output upload settings.
4
4
  ---
5
5
 
6
6
  # Capgo CLI Native Builds
7
7
 
8
8
  Use this skill for Capgo Cloud native iOS and Android build workflows.
9
9
 
10
+ ## Onboarding (automated iOS setup)
11
+
12
+ ### `build onboarding`
13
+
14
+ - Interactive command that automates iOS certificate and provisioning profile creation.
15
+ - Reduces iOS setup from ~10 manual steps to 1 manual step (creating an API key) + 1 command.
16
+ - Example: `npx @capgo/cli@latest build onboarding`
17
+ - Notes:
18
+ - Uses Ink (React for terminal) for the interactive UI — only command that uses Ink; all other commands use `@clack/prompts`.
19
+ - Requires running inside a Capacitor project directory with an `ios/` folder.
20
+ - The user creates ONE App Store Connect API key (.p8 file), then the CLI handles everything else.
21
+ - On macOS, offers a native file picker dialog for .p8 selection.
22
+ - Auto-detects Key ID from .p8 filename (e.g. `AuthKey_XXXX.p8`).
23
+ - Progress persists in `~/.capgo-credentials/onboarding/<appId>.json` — safe to interrupt and resume.
24
+ - Saves credentials to the same `~/.capgo-credentials/credentials.json` used by `build request`.
25
+ - Optionally kicks off the first build at the end.
26
+
27
+ #### What it automates (iOS)
28
+
29
+ 1. Verifies the API key with Apple
30
+ 2. Generates CSR + creates an `IOS_DISTRIBUTION` certificate via the App Store Connect API
31
+ 3. Registers or reuses the bundle ID
32
+ 4. Creates an `IOS_APP_STORE` provisioning profile
33
+ 5. Saves all credentials (certificate as .p12, profile, API key, team ID)
34
+ 6. Requests the first cloud build
35
+
36
+ #### Conflict resolution
37
+
38
+ - **Certificate limit reached**: lists existing certs, tags ones created by Capgo onboarding, lets the user pick one to revoke, then retries.
39
+ - **Duplicate provisioning profiles**: detects profiles matching the `Capgo <appId> AppStore` naming pattern, deletes them, and retries.
40
+ - **Existing credentials**: offers to backup existing credentials before proceeding, or exit onboarding.
41
+
42
+ #### Architecture
43
+
44
+ - `src/build/onboarding/command.ts` — entry point, launches Ink
45
+ - `src/build/onboarding/apple-api.ts` — JWT auth + App Store Connect API (verify, create cert, create profile, revoke, delete)
46
+ - `src/build/onboarding/csr.ts` — CSR generation + P12 creation via `node-forge`
47
+ - `src/build/onboarding/progress.ts` — per-app progress persistence
48
+ - `src/build/onboarding/file-picker.ts` — macOS native file picker via `osascript`
49
+ - `src/build/onboarding/ui/app.tsx` — Ink app (state machine)
50
+ - `src/build/onboarding/ui/components.tsx` — reusable UI components
51
+
52
+ #### BuildLogger callback interface
53
+
54
+ `requestBuildInternal` accepts an optional `BuildLogger` to receive log output via callbacks instead of writing directly to stdout. This enables clean integration with the Ink UI:
55
+
56
+ ```typescript
57
+ interface BuildLogger {
58
+ info: (msg: string) => void
59
+ error: (msg: string) => void
60
+ warn: (msg: string) => void
61
+ success: (msg: string) => void
62
+ buildLog: (msg: string) => void
63
+ uploadProgress: (percent: number) => void
64
+ }
65
+ ```
66
+
67
+ ---
68
+
10
69
  ## Core build request
11
70
 
12
71
  ### `build request [appId]`