@capgo/cli 7.93.3 → 7.94.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 +286 -77
- package/dist/index.js +479 -475
- package/dist/package.json +11 -7
- package/dist/src/api/channels.d.ts +2 -0
- package/dist/src/bundle/upload.d.ts +1 -1
- package/dist/src/init/command.d.ts +23 -0
- package/dist/src/init/runtime.d.ts +1 -0
- package/dist/src/init/ui/components.d.ts +3 -1
- package/dist/src/run/device.d.ts +5 -0
- package/dist/src/sdk.js +315 -324
- package/dist/src/utils.d.ts +20 -3
- package/package.json +11 -7
- package/skills/usage/SKILL.md +3 -1
- package/skills/_artifacts/domain_map.yaml +0 -32
- package/skills/_artifacts/skill_spec.md +0 -30
- package/skills/_artifacts/skill_tree.yaml +0 -17
package/dist/src/utils.d.ts
CHANGED
|
@@ -3594,7 +3594,6 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
|
|
|
3594
3594
|
}, {
|
|
3595
3595
|
PostgrestVersion: "14.1";
|
|
3596
3596
|
}>>;
|
|
3597
|
-
export declare function checkKey(supabase: SupabaseClient<Database>, apikey: string, keymode: Database['public']['Enums']['key_mode'][]): Promise<void>;
|
|
3598
3597
|
export declare function isPayingOrg(supabase: SupabaseClient<Database>, orgId: string): Promise<boolean>;
|
|
3599
3598
|
export declare function isTrialOrg(supabase: SupabaseClient<Database>, orgId: string): Promise<number>;
|
|
3600
3599
|
export declare function isAllowedActionOrg(supabase: SupabaseClient<Database>, orgId: string): Promise<boolean>;
|
|
@@ -3641,7 +3640,7 @@ export declare function generateManifest(path: string): Promise<{
|
|
|
3641
3640
|
export type manifestType = Awaited<ReturnType<typeof generateManifest>>;
|
|
3642
3641
|
export type { uploadUrlsType } from './schemas/common';
|
|
3643
3642
|
export declare function zipFile(filePath: string): Promise<Buffer>;
|
|
3644
|
-
export declare function zipFileUnix(filePath: string): Buffer<
|
|
3643
|
+
export declare function zipFileUnix(filePath: string): Buffer<ArrayBuffer>;
|
|
3645
3644
|
export declare function zipFileWindows(filePath: string): Promise<Buffer>;
|
|
3646
3645
|
export declare function uploadTUS(apikey: string, data: Buffer, orgId: string, appId: string, name: string, spinner: ReturnType<typeof spinnerC>, localConfig: CapgoConfig, chunkSize: number): Promise<boolean>;
|
|
3647
3646
|
export declare function deletedFailedVersion(supabase: SupabaseClient<Database>, appId: string, name: string): Promise<void>;
|
|
@@ -3670,7 +3669,25 @@ export declare function sendEvent(capgkey: string, payload: TrackOptions & {
|
|
|
3670
3669
|
}, verbose?: boolean): Promise<void>;
|
|
3671
3670
|
export declare function show2FADeniedError(organizationName?: string): never;
|
|
3672
3671
|
export declare function getOrganization(supabase: SupabaseClient<Database>, roles: string[]): Promise<Organization>;
|
|
3673
|
-
export declare function
|
|
3672
|
+
export declare function filterOrgsByPermission(supabase: SupabaseClient<Database>, apikey: string, orgs: Organization[], permissionKey: string): Promise<Organization[]>;
|
|
3673
|
+
export declare function getOrganizationListWithPermission(supabase: SupabaseClient<Database>, apikey: string, permissionKey: string): Promise<{
|
|
3674
|
+
allOrganizations: Organization[];
|
|
3675
|
+
allowedOrganizations: Organization[];
|
|
3676
|
+
}>;
|
|
3677
|
+
export declare function getOrganizationWithPermission(supabase: SupabaseClient<Database>, apikey: string, permissionKey: string): Promise<Organization>;
|
|
3678
|
+
export declare function resolveUserIdFromApiKey(supabase: SupabaseClient<Database>, apikey: string, silent?: boolean): Promise<string>;
|
|
3679
|
+
interface CliPermissionScope {
|
|
3680
|
+
orgId?: string | null;
|
|
3681
|
+
appId?: string | null;
|
|
3682
|
+
channelId?: number | null;
|
|
3683
|
+
}
|
|
3684
|
+
export declare function hasCliPermission(supabase: SupabaseClient<Database>, apikey: string, permissionKey: string, scope?: CliPermissionScope): Promise<boolean>;
|
|
3685
|
+
export declare function assertCliPermission(supabase: SupabaseClient<Database>, apikey: string, permissionKey: string, scope?: CliPermissionScope, options?: {
|
|
3686
|
+
message?: string;
|
|
3687
|
+
silent?: boolean;
|
|
3688
|
+
}): Promise<void>;
|
|
3689
|
+
export declare function assertOrgPermission(supabase: SupabaseClient<Database>, apikey: string, permissionKey: string, orgId: string, message: string, silent: boolean): Promise<void>;
|
|
3690
|
+
export declare function getAccessibleAppsForApiKey(supabase: SupabaseClient<Database>, apikey: string): Promise<Database['public']['Tables']['apps']['Row'][]>;
|
|
3674
3691
|
export declare function getOrganizationId(supabase: SupabaseClient<Database>, appId: string): Promise<string>;
|
|
3675
3692
|
export declare function requireUpdateMetadata(supabase: SupabaseClient<Database>, channel: string, appId: string): Promise<boolean>;
|
|
3676
3693
|
export declare function getHumanDate(createdA: string | null): string;
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.94.0",
|
|
5
5
|
"description": "A CLI to upload to capgo servers",
|
|
6
6
|
"author": "Martin martin@capgo.app",
|
|
7
7
|
"license": "Apache 2.0",
|
|
8
|
-
"homepage": "https://github.com/Cap-go/
|
|
8
|
+
"homepage": "https://github.com/Cap-go/capgo/tree/main/cli#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/Cap-go/
|
|
11
|
+
"url": "git+https://github.com/Cap-go/capgo.git",
|
|
12
|
+
"directory": "cli"
|
|
12
13
|
},
|
|
13
14
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/Cap-go/
|
|
15
|
+
"url": "https://github.com/Cap-go/capgo/issues"
|
|
15
16
|
},
|
|
16
17
|
"keywords": [
|
|
17
18
|
"appflow alternative",
|
|
@@ -56,9 +57,10 @@
|
|
|
56
57
|
"no-debug": "node dist/index.js",
|
|
57
58
|
"dev-build": "SUPA_DB=development ncc build",
|
|
58
59
|
"pack": "pkg",
|
|
59
|
-
"types": "
|
|
60
|
+
"types": "bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",
|
|
60
61
|
"typecheck": "tsc --noEmit",
|
|
61
|
-
"lint": "eslint \"src/**/*.ts\"
|
|
62
|
+
"lint": "eslint \"src/**/*.ts\"",
|
|
63
|
+
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
62
64
|
"check-posix-paths": "node test/check-posix-paths.js",
|
|
63
65
|
"generate-docs": "node dist/index.js generate-docs README.md",
|
|
64
66
|
"test:bundle": "bun test/test-bundle.mjs",
|
|
@@ -73,6 +75,8 @@
|
|
|
73
75
|
"test:checksum": "bun test/test-checksum-algorithm.mjs",
|
|
74
76
|
"test:ci-prompts": "bun test/test-ci-prompts.mjs",
|
|
75
77
|
"test:onboarding-recovery": "bun test/test-onboarding-recovery.mjs",
|
|
78
|
+
"test:onboarding-run-targets": "bun test/test-onboarding-run-targets.mjs",
|
|
79
|
+
"test:run-device-command": "bun test/test-run-device-command.mjs",
|
|
76
80
|
"test:init-app-conflict": "bun test/test-init-app-conflict.mjs",
|
|
77
81
|
"test:prompt-preferences": "bun test/test-prompt-preferences.mjs",
|
|
78
82
|
"test:esm-sdk": "node test/test-sdk-esm.mjs",
|
|
@@ -81,7 +85,7 @@
|
|
|
81
85
|
"test:version-detection:setup": "./test/fixtures/setup-test-projects.sh",
|
|
82
86
|
"test:platform-paths": "bun test/test-platform-paths.mjs",
|
|
83
87
|
"test:payload-split": "bun test/test-payload-split.mjs",
|
|
84
|
-
"test": "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:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:ci-prompts && bun run test:onboarding-recovery && bun run test:init-app-conflict && 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:payload-split"
|
|
88
|
+
"test": "bun run build && 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:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:ci-prompts && bun run test:onboarding-recovery && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && 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:payload-split"
|
|
85
89
|
},
|
|
86
90
|
"devDependencies": {
|
|
87
91
|
"@antfu/eslint-config": "^7.0.0",
|
package/skills/usage/SKILL.md
CHANGED
|
@@ -24,7 +24,8 @@ TanStack Intent skills should stay focused and under the validator line limit, s
|
|
|
24
24
|
|
|
25
25
|
### Project setup and diagnostics
|
|
26
26
|
|
|
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. 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 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. 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.
|
|
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. 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 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
|
+
- `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.
|
|
28
29
|
- `login [apikey]`: store an API key locally.
|
|
29
30
|
- `doctor`: inspect installation health and gather troubleshooting details.
|
|
30
31
|
- `probe`: test whether the update endpoint would deliver an update.
|
|
@@ -81,6 +82,7 @@ Load `skills/organization-management/SKILL.md` when working with:
|
|
|
81
82
|
|
|
82
83
|
```bash
|
|
83
84
|
npx @capgo/cli@latest init YOUR_API_KEY com.example.app
|
|
85
|
+
npx @capgo/cli@latest run device ios --no-launch
|
|
84
86
|
npx @capgo/cli@latest login YOUR_API_KEY
|
|
85
87
|
npx @capgo/cli@latest doctor
|
|
86
88
|
npx @capgo/cli@latest probe --platform ios
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
domains:
|
|
2
|
-
- name: cli-usage
|
|
3
|
-
summary: High-level command routing, setup, diagnostics, app management, docs generation, MCP, and GitHub support commands.
|
|
4
|
-
primary_sources:
|
|
5
|
-
- webdocs/init.mdx
|
|
6
|
-
- webdocs/doctor.mdx
|
|
7
|
-
- webdocs/login.mdx
|
|
8
|
-
- webdocs/app.mdx
|
|
9
|
-
- webdocs/account.mdx
|
|
10
|
-
- webdocs/probe.mdx
|
|
11
|
-
- webdocs/star.mdx
|
|
12
|
-
- webdocs/star-all.mdx
|
|
13
|
-
- src/index.ts
|
|
14
|
-
- name: ota-release-management
|
|
15
|
-
summary: OTA bundle uploads, channel operations, compatibility checks, cleanup, and encryption-key workflows.
|
|
16
|
-
primary_sources:
|
|
17
|
-
- webdocs/bundle.mdx
|
|
18
|
-
- webdocs/channel.mdx
|
|
19
|
-
- webdocs/key.mdx
|
|
20
|
-
- src/index.ts
|
|
21
|
-
- name: native-builds
|
|
22
|
-
summary: Native cloud build requests and local build credential management for iOS and Android.
|
|
23
|
-
primary_sources:
|
|
24
|
-
- webdocs/build.mdx
|
|
25
|
-
- src/index.ts
|
|
26
|
-
- name: organization-management
|
|
27
|
-
summary: Account lookup, organization administration, and deprecated organisation aliases.
|
|
28
|
-
primary_sources:
|
|
29
|
-
- webdocs/account.mdx
|
|
30
|
-
- webdocs/organization.mdx
|
|
31
|
-
- webdocs/organisation.mdx
|
|
32
|
-
- src/index.ts
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Capgo CLI skill spec
|
|
2
|
-
|
|
3
|
-
## Goal
|
|
4
|
-
|
|
5
|
-
Provide a small Capgo CLI skill set that helps an agent choose and invoke the correct CLI commands for app setup, OTA release operations, organization administration, MCP setup, GitHub support commands, and native cloud builds without exceeding TanStack Intent size limits.
|
|
6
|
-
|
|
7
|
-
## Sources
|
|
8
|
-
|
|
9
|
-
- `webdocs/*.mdx` for published command descriptions, examples, and option tables.
|
|
10
|
-
- `src/index.ts` for the currently registered commands, aliases, and flags that may not yet be fully reflected in the web docs.
|
|
11
|
-
- `AGENTS.md` for repository-specific maintenance requirements.
|
|
12
|
-
|
|
13
|
-
## Skill set
|
|
14
|
-
|
|
15
|
-
- `usage`: routing, setup, diagnostics, app commands, docs generation, MCP, and GitHub support commands.
|
|
16
|
-
- `release-management`: bundle, channel, compatibility, cleanup, and encryption-key workflows.
|
|
17
|
-
- `native-builds`: native cloud build requests and build credential storage/update flows.
|
|
18
|
-
- `organization-management`: account ID lookup, organization admin flows, and deprecated `organisation` aliases.
|
|
19
|
-
|
|
20
|
-
## Scope
|
|
21
|
-
|
|
22
|
-
- Include the documented command purpose, invocation patterns, key options, and important caveats.
|
|
23
|
-
- Prefer the public user-facing examples already used by the project.
|
|
24
|
-
- Keep the skills aligned with the published docs and current CLI registration.
|
|
25
|
-
|
|
26
|
-
## Maintenance rules
|
|
27
|
-
|
|
28
|
-
- Any CLI command or option change should update the relevant `skills/*/SKILL.md` file in the same pull request.
|
|
29
|
-
- Use `webdocs/` as the primary wording source and `src/index.ts` as the completeness check.
|
|
30
|
-
- Validate the skills with `bunx @tanstack/intent@latest validate` before release.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
skills:
|
|
2
|
-
- name: usage
|
|
3
|
-
path: skills/usage/SKILL.md
|
|
4
|
-
domain: cli-usage
|
|
5
|
-
focus: High-level routing and shared invocation rules.
|
|
6
|
-
- name: release-management
|
|
7
|
-
path: skills/release-management/SKILL.md
|
|
8
|
-
domain: ota-release-management
|
|
9
|
-
focus: OTA bundle, channel, compatibility, cleanup, and encryption workflows.
|
|
10
|
-
- name: native-builds
|
|
11
|
-
path: skills/native-builds/SKILL.md
|
|
12
|
-
domain: native-builds
|
|
13
|
-
focus: Native build request flows and local build credential management.
|
|
14
|
-
- name: organization-management
|
|
15
|
-
path: skills/organization-management/SKILL.md
|
|
16
|
-
domain: organization-management
|
|
17
|
-
focus: Account and organization administration commands, including deprecated aliases.
|