@capgo/cli 7.17.6 → 7.17.8
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 +53 -0
- package/dist/index.js +124 -124
- package/dist/package.json +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -886,3 +886,56 @@ npx @capgo/cli@latest organisation delete ORG_ID
|
|
|
886
886
|
|
|
887
887
|
|
|
888
888
|
<!-- AUTO-GENERATED-DOCS-END -->
|
|
889
|
+
|
|
890
|
+
## Programmatic Usage (SDK)
|
|
891
|
+
|
|
892
|
+
You can use the Capgo CLI programmatically in your Node.js/TypeScript projects for automation and CI/CD pipelines.
|
|
893
|
+
|
|
894
|
+
### Installation
|
|
895
|
+
|
|
896
|
+
```bash
|
|
897
|
+
npm install @capgo/cli
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
### Example: Upload a Bundle
|
|
901
|
+
|
|
902
|
+
```typescript
|
|
903
|
+
import { CapgoSDK } from '@capgo/cli/sdk'
|
|
904
|
+
|
|
905
|
+
const sdk = new CapgoSDK({
|
|
906
|
+
apikey: 'your-api-key'
|
|
907
|
+
})
|
|
908
|
+
|
|
909
|
+
await sdk.uploadBundle({
|
|
910
|
+
appId: 'com.example.app',
|
|
911
|
+
bundle: '1.0.0',
|
|
912
|
+
path: './dist',
|
|
913
|
+
channel: 'production'
|
|
914
|
+
})
|
|
915
|
+
```
|
|
916
|
+
|
|
917
|
+
### Example: CI/CD Automation
|
|
918
|
+
|
|
919
|
+
```typescript
|
|
920
|
+
import { CapgoSDK } from '@capgo/cli/sdk'
|
|
921
|
+
|
|
922
|
+
const sdk = new CapgoSDK({
|
|
923
|
+
apikey: process.env.CAPGO_API_KEY
|
|
924
|
+
})
|
|
925
|
+
|
|
926
|
+
// Upload new version
|
|
927
|
+
await sdk.uploadBundle({
|
|
928
|
+
appId: 'com.example.app',
|
|
929
|
+
bundle: process.env.VERSION,
|
|
930
|
+
path: './dist',
|
|
931
|
+
channel: 'production'
|
|
932
|
+
})
|
|
933
|
+
|
|
934
|
+
// Cleanup old bundles
|
|
935
|
+
await sdk.cleanupBundles({
|
|
936
|
+
appId: 'com.example.app',
|
|
937
|
+
keep: 10
|
|
938
|
+
})
|
|
939
|
+
```
|
|
940
|
+
|
|
941
|
+
All CLI features are available as SDK methods. See the [TypeScript types](./src/sdk.ts) for the complete API reference.
|