@capgo/cli 8.9.2 → 8.11.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/README.md +2 -0
- package/dist/index.js +975 -694
- package/dist/package.json +11 -3
- package/dist/src/analytics/opt-out.d.ts +2 -0
- package/dist/src/app/debug.d.ts +1 -1
- package/dist/src/auth/session.d.ts +71 -0
- package/dist/src/build/onboarding/android/ui/app.d.ts +3 -0
- package/dist/src/build/onboarding/command.d.ts +1 -0
- package/dist/src/build/onboarding/mcp/onboarding-tools.d.ts +2 -2
- package/dist/src/build/onboarding/telemetry.d.ts +3 -0
- package/dist/src/build/onboarding/ui/app.d.ts +3 -0
- package/dist/src/build/onboarding/ui/exit.d.ts +2 -0
- package/dist/src/build/onboarding/ui/shell.d.ts +5 -0
- package/dist/src/init/command.d.ts +12 -1
- package/dist/src/init/replay.d.ts +91 -0
- package/dist/src/init/ui.d.ts +1 -1
- package/dist/src/posthog.d.ts +1 -0
- package/dist/src/schemas/auth.d.ts +14 -0
- package/dist/src/schemas/common.d.ts +5 -0
- package/dist/src/schemas/index.d.ts +1 -0
- package/dist/src/sdk.js +242 -242
- package/dist/src/utils.d.ts +10 -1
- package/package.json +11 -3
- package/skills/native-builds/SKILL.md +1 -0
- package/skills/usage/SKILL.md +1 -0
package/dist/src/utils.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ export declare function getBundleVersion(f?: string, file?: string | undefined):
|
|
|
116
116
|
*/
|
|
117
117
|
export declare function getInstalledVersion(packageName: string, rootDir?: string, packageJsonPath?: string): Promise<string | null>;
|
|
118
118
|
export declare function getAllPackagesDependencies(f?: string, file?: string | undefined): Promise<Map<string, string>>;
|
|
119
|
+
export declare function getDeclaredPackageVersionMap(f?: string, file?: string | undefined): Promise<Map<string, string>>;
|
|
119
120
|
export declare function getConfig(silent?: boolean): Promise<{
|
|
120
121
|
config: {
|
|
121
122
|
[x: string]: unknown;
|
|
@@ -149,7 +150,7 @@ interface CapgoFilesConfig {
|
|
|
149
150
|
alertUploadSize: number;
|
|
150
151
|
}
|
|
151
152
|
export declare function getRemoteFileConfig(): Promise<CapgoFilesConfig>;
|
|
152
|
-
export declare function createSupabaseClient(apikey: string, supaHost?: string, supaKey?: string, silent?: boolean, instrument?: boolean): Promise<SupabaseClient<Database, "public", "public", {
|
|
153
|
+
export declare function createSupabaseClient(apikey: string, supaHost?: string, supaKey?: string, silent?: boolean, instrument?: boolean, signal?: AbortSignal): Promise<SupabaseClient<Database, "public", "public", {
|
|
153
154
|
Tables: {
|
|
154
155
|
apikey_global_permissions: {
|
|
155
156
|
Row: {
|
|
@@ -5907,6 +5908,7 @@ export declare function getNativeProjectResetAdvice(platformRunner: string, nati
|
|
|
5907
5908
|
export declare function getLocalDependencies(packageJsonPath: string | undefined, nodeModulesString: string | undefined): Promise<{
|
|
5908
5909
|
name: string;
|
|
5909
5910
|
version: string;
|
|
5911
|
+
requested_version?: string;
|
|
5910
5912
|
native: boolean;
|
|
5911
5913
|
ios_checksum?: string;
|
|
5912
5914
|
android_checksum?: string;
|
|
@@ -5917,6 +5919,7 @@ export declare function convertNativePackages(nativePackages: NativePackage[]):
|
|
|
5917
5919
|
export declare function getRemoteDependencies(supabase: SupabaseClient<Database>, appId: string, channel: string): Promise<Map<string, {
|
|
5918
5920
|
name: string;
|
|
5919
5921
|
version: string;
|
|
5922
|
+
requested_version?: string | undefined;
|
|
5920
5923
|
ios_checksum?: string | undefined;
|
|
5921
5924
|
android_checksum?: string | undefined;
|
|
5922
5925
|
}>>;
|
|
@@ -5935,6 +5938,8 @@ export declare function checkCompatibilityCloud(supabase: SupabaseClient<Databas
|
|
|
5935
5938
|
name: string;
|
|
5936
5939
|
localVersion?: string | undefined;
|
|
5937
5940
|
remoteVersion?: string | undefined;
|
|
5941
|
+
localRequestedVersion?: string | undefined;
|
|
5942
|
+
remoteRequestedVersion?: string | undefined;
|
|
5938
5943
|
localIosChecksum?: string | undefined;
|
|
5939
5944
|
remoteIosChecksum?: string | undefined;
|
|
5940
5945
|
localAndroidChecksum?: string | undefined;
|
|
@@ -5943,6 +5948,7 @@ export declare function checkCompatibilityCloud(supabase: SupabaseClient<Databas
|
|
|
5943
5948
|
localDependencies: {
|
|
5944
5949
|
name: string;
|
|
5945
5950
|
version: string;
|
|
5951
|
+
requested_version?: string;
|
|
5946
5952
|
native: boolean;
|
|
5947
5953
|
ios_checksum?: string;
|
|
5948
5954
|
android_checksum?: string;
|
|
@@ -5953,6 +5959,8 @@ export declare function checkCompatibilityNativePackages(supabase: SupabaseClien
|
|
|
5953
5959
|
name: string;
|
|
5954
5960
|
localVersion?: string | undefined;
|
|
5955
5961
|
remoteVersion?: string | undefined;
|
|
5962
|
+
localRequestedVersion?: string | undefined;
|
|
5963
|
+
remoteRequestedVersion?: string | undefined;
|
|
5956
5964
|
localIosChecksum?: string | undefined;
|
|
5957
5965
|
remoteIosChecksum?: string | undefined;
|
|
5958
5966
|
localAndroidChecksum?: string | undefined;
|
|
@@ -5961,6 +5969,7 @@ export declare function checkCompatibilityNativePackages(supabase: SupabaseClien
|
|
|
5961
5969
|
localDependencies: {
|
|
5962
5970
|
name: string;
|
|
5963
5971
|
version: string;
|
|
5972
|
+
requested_version?: string | undefined;
|
|
5964
5973
|
ios_checksum?: string | undefined;
|
|
5965
5974
|
android_checksum?: string | undefined;
|
|
5966
5975
|
}[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.11.0",
|
|
5
5
|
"description": "A CLI to upload to capgo servers",
|
|
6
6
|
"author": "Martin martin@capgo.app",
|
|
7
7
|
"license": "Apache 2.0",
|
|
@@ -109,8 +109,10 @@
|
|
|
109
109
|
"test:run-device-command": "bun test/test-run-device-command.mjs",
|
|
110
110
|
"test:init-app-conflict": "bun test/test-init-app-conflict.mjs",
|
|
111
111
|
"test:init-guardrails": "bun test/test-init-guardrails.mjs",
|
|
112
|
+
"test:init-replay": "bun test/test-init-replay.mjs",
|
|
112
113
|
"test:prompt-preferences": "bun test/test-prompt-preferences.mjs",
|
|
113
114
|
"test:esm-sdk": "node test/test-sdk-esm.mjs",
|
|
115
|
+
"test:auth-session": "bun test/test-auth-session.mjs",
|
|
114
116
|
"test:mcp": "node test/test-mcp.mjs",
|
|
115
117
|
"test:version-detection": "node test/test-get-installed-version.mjs",
|
|
116
118
|
"test:version-detection:setup": "./test/fixtures/setup-test-projects.sh",
|
|
@@ -151,7 +153,7 @@
|
|
|
151
153
|
"test:ios-verify-app": "bun test/test-ios-verify-app.mjs",
|
|
152
154
|
"test:platform-flow-contract": "bun test/test-platform-flow-contract.mjs",
|
|
153
155
|
"test:tail-engine-shared": "bun test/test-tail-engine-shared.mjs",
|
|
154
|
-
"test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:platform-flow-contract && bun run test:tail-engine-shared",
|
|
156
|
+
"test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:init-replay && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:platform-flow-contract && bun run test:tail-engine-shared",
|
|
155
157
|
"test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
|
|
156
158
|
"test:ai-log-capture": "bun test/test-ai-log-capture.mjs",
|
|
157
159
|
"test:ai-analyze-flow": "bun test/test-ai-analyze-flow.mjs",
|
|
@@ -179,17 +181,23 @@
|
|
|
179
181
|
},
|
|
180
182
|
"dependencies": {
|
|
181
183
|
"@inkjs/ui": "^2.0.0",
|
|
184
|
+
"@rrweb/types": "^2.0.1",
|
|
185
|
+
"@xterm/addon-serialize": "^0.14.0",
|
|
186
|
+
"@xterm/headless": "^6.0.0",
|
|
187
|
+
"happy-dom": "^20.10.4",
|
|
182
188
|
"ink": "^7.0.4",
|
|
183
189
|
"ink-spinner": "^5.0.0",
|
|
184
190
|
"jsonwebtoken": "^9.0.3",
|
|
185
191
|
"node-forge": "^1.4.0",
|
|
186
192
|
"qrcode": "^1.5.4",
|
|
187
193
|
"react": "^19.2.6",
|
|
194
|
+
"rrweb-snapshot": "^2.0.1",
|
|
188
195
|
"string-width": "^8.2.1"
|
|
189
196
|
},
|
|
190
197
|
"optionalDependencies": {
|
|
191
198
|
"@capgo/cli-helper-darwin-arm64": "^1.1.1",
|
|
192
|
-
"@capgo/cli-helper-darwin-x64": "^1.1.1"
|
|
199
|
+
"@capgo/cli-helper-darwin-x64": "^1.1.1",
|
|
200
|
+
"node-pty": "^1.1.0"
|
|
193
201
|
},
|
|
194
202
|
"devDependencies": {
|
|
195
203
|
"@antfu/eslint-config": "^9.0.0",
|
|
@@ -17,6 +17,7 @@ Use this skill for Capgo Cloud native iOS and Android build workflows.
|
|
|
17
17
|
- Backward compatibility: `npx @capgo/cli@latest build onboarding` still works.
|
|
18
18
|
- Options:
|
|
19
19
|
- `-a, --apikey <apikey>` — Capgo API key to authenticate with (alternative to the `CAPGO_TOKEN` env var or `~/.capgo` / local `.capgo` file). Takes precedence over a saved key when both are present. Lets the SaaS onboarding wizard render a single copy-pasteable command across bash, zsh, fish, PowerShell, and cmd.exe.
|
|
20
|
+
- `--no-analytics` — Disable build onboarding analytics and terminal replay for this run.
|
|
20
21
|
- Example: `npx @capgo/cli@latest build init -a cap_xxx`
|
|
21
22
|
- Notes:
|
|
22
23
|
- Uses Ink (React for terminal) for the interactive UI, alongside the main `init` onboarding flow.
|
package/skills/usage/SKILL.md
CHANGED
|
@@ -25,6 +25,7 @@ TanStack Intent skills should stay focused and under the validator line limit, s
|
|
|
25
25
|
### Project setup and diagnostics
|
|
26
26
|
|
|
27
27
|
- `init [apikey] [appId]`: guided first-time setup for Capgo in a Capacitor app. The interactive flow now runs as a real Ink-based fullscreen onboarding so it uses the same UI stack as `build init` (alias: `build onboarding`), with a persistent dashboard, phase roadmap, progress cards, shared log area, and resume support. At startup, onboarding still recommends a clean git worktree before file edits; dirty repos show `Check again` first and also offer a non-recommended `Continue anyway` override. When dependency auto-detection fails on macOS, the flow opens a native file picker for `package.json` before falling back to manual path entry. If the local bundle ID already exists in the selected Capgo account, onboarding offers to reuse that app, then offers to delete and recreate it, then falls back to alternate bundle ID suggestions. If the user reuses a pending app that was already created in the web onboarding flow, the CLI syncs that selected dashboard app ID back into `capacitor.config.*` before the remaining steps continue. Outside that reused pending-app path, the CLI keeps using the local Capacitor app ID. It writes the new `autoUpdate` policy modes into config: `"atBackground"` for the default flow and `"always"` for instant updates. It can also offer a final `npx skills add https://github.com/Cap-go/capgo-skills -g -y` install step before the GitHub support prompt; if accepted, the support menu includes `Cap-go/capgo-skills` alongside the updater-only and all-Capgo choices. If native platforms are missing, the onboarding can offer to run `cap add` for you. The updater step now verifies that `@capgo/capacitor-updater` is both declared in the selected `package.json` and resolvable from `node_modules`; if automatic install or later build/sync fails, onboarding prints the manual command, waits for the user to type `ready`, re-checks, and only then continues. During the iOS run-on-device step, onboarding asks whether to use a physical iPhone/iPad or a simulator; for physical devices, it asks the user to connect and unlock the device, then offers a check-again loop before launching with the detected target. If iOS sync validation fails during onboarding, the CLI can offer to run a one-line native reset command, wait for you to type `ready` after a manual fix, surface `doctor`, and save a support bundle before you leave the flow.
|
|
28
|
+
- `init --no-analytics`: disables init onboarding analytics and terminal replay for that run.
|
|
28
29
|
- `run device [platform]`: run a Capacitor app on a connected device or simulator. In an interactive terminal, omitting `[platform]` asks whether to start on iOS or Android. The command lists available devices and simulators, includes a reload option, and resolves the `cap run` command. Use `npx @capgo/cli@latest run device ios --no-launch` to exercise iOS physical/simulator target selection and print the resolved command without launching the app.
|
|
29
30
|
- `login [apikey]`: store an API key locally.
|
|
30
31
|
- `doctor`: inspect installation health and gather troubleshooting details.
|