bitrise-api-cli 0.0.1 → 0.0.3

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 (3) hide show
  1. package/README.md +108 -10
  2. package/dist/bin.js +5 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,21 +1,119 @@
1
- # bitrise_api_cli
1
+ # Bitrise API CLI [![npm version](https://badge.fury.io/js/bitrise-api-cli.svg)](https://www.npmjs.com/package/bitrise-api-cli)
2
2
 
3
- Unofficial CLI to download artifacts from bitrise.
4
- This is used to download apk instead of building from source each time.
3
+ <div align="center">
4
+ 🚀 An unofficial CLI tool to interact with Bitrise API, making artifact downloads a breeze.
5
+ </div>
5
6
 
6
- ## Usage
7
+ ## 🎯 Features
8
+
9
+ - Download artifacts from your latest successful builds
10
+ - Simple workflow-based artifact retrieval
11
+ - Easy integration with CI/CD pipelines
12
+ - Supports both CLI arguments and environment variables
13
+
14
+ ## 🚀 Quick Start
15
+
16
+ ### Download Artifacts
7
17
 
8
18
  ```bash
19
+ # Using npx (recommended)
9
20
  npx bitrise-api-cli@latest download --token <BITRISE_TOKEN> --workflow <WORKFLOW_NAME>
10
21
 
11
- Usage: bitrise-api-cli download [options]
22
+ # If running locally, you'll need to specify the app slug
23
+ npx bitrise-api-cli@latest download \
24
+ --token <BITRISE_TOKEN> \
25
+ --workflow <WORKFLOW_NAME> \
26
+ --app-slug <APP_SLUG>
27
+ ```
28
+
29
+ ## 🔐 Configuration
12
30
 
13
- Download bitrise artifacts
31
+ ### Environment Variables
14
32
 
33
+ | Variable | Description | Required |
34
+ | -------------------------- | ---------------------------------------- |--------------|
35
+ | `BITRISE_API_CLI_TOKEN` | Your Bitrise API token | Yes |
36
+ | `BITRISE_API_CLI_WORKFLOW` | Workflow name to download artifacts from | Yes |
37
+ | `BITRISE_APP_SLUG` | App Slug (auto-set in Bitrise CI) | only locally |
38
+
39
+ ### CLI Options
40
+
41
+ ```bash
15
42
  Options:
16
- -t, --token <TOKEN> bitrise api token (or $BITRISE_API_CLI_TOKEN)
17
- -w, --workflow <WORKFLOW_NAME> workflow to get apk from (or $BITRISE_API_CLI_WORKFLOW)
18
- -d, --debug output extra debugging (default: false)
19
- -h, --help display help for command
43
+ -t, --token <TOKEN> Bitrise API token
44
+ -w, --workflow <NAME> Workflow name
45
+ -s, --app-slug <SLUG> Bitrise app slug
46
+ -d, --debug Enable debug logging
47
+ -h, --help Display help information
48
+ ```
49
+
50
+ ## 💡 Examples
51
+
52
+ ### Using Command Line Arguments
53
+
54
+ ```bash
55
+ # Download artifacts from a specific workflow
56
+ npx bitrise-api-cli@latest download \
57
+ --token abc123 \
58
+ --workflow android-release \
59
+ --app-slug a1b2c3d4e5f6
60
+
61
+ # Enable debug logging
62
+ npx bitrise-api-cli@latest download --debug \
63
+ --token abc123 \
64
+ --workflow android-release
65
+ ```
66
+
67
+ ### Using Environment Variables
68
+
69
+ ```bash
70
+ # Set environment variables
71
+ export BITRISE_API_CLI_TOKEN=abc123
72
+ export BITRISE_API_CLI_WORKFLOW=android-release
73
+ export BITRISE_APP_SLUG=a1b2c3d4e5f6
20
74
 
75
+ # Run the command
76
+ npx bitrise-api-cli@latest download
21
77
  ```
78
+
79
+ ## 🔍 Common Use Cases
80
+
81
+ ### CI/CD Integration
82
+
83
+ Perfect for downloading artifacts from previous builds instead of rebuilding from source:
84
+
85
+ ```yaml
86
+ steps:
87
+ - script:
88
+ inputs:
89
+ content: |
90
+ npx bitrise-api-cli download \
91
+ --workflow android-release \
92
+ --token $BITRISE_API_TOKEN
93
+ ```
94
+
95
+ ### Local Development
96
+
97
+ Download the latest artifacts to test without building:
98
+
99
+ ```bash
100
+ npx bitrise-api-cli@latest download \
101
+ --token $BITRISE_API_TOKEN \
102
+ --workflow android-release \
103
+ --app-slug $BITRISE_APP_SLUG
104
+ ```
105
+
106
+ ## 📝 License
107
+
108
+ This project is [MIT](LICENSE) licensed.
109
+
110
+ ## 🙏 Acknowledgments
111
+
112
+ - Thanks to [Bitrise](https://www.bitrise.io/) for their excellent API
113
+ - Built with ❤️ for the mobile CI/CD community
114
+
115
+ ---
116
+
117
+ <div align="center">
118
+ <p>Found this project useful? Give it a ⭐️!</p>
119
+ </div>
package/dist/bin.js CHANGED
@@ -5,17 +5,18 @@ import { Command } from "commander";
5
5
 
6
6
  // src/bitrise/env.ts
7
7
  var ENV = {
8
- appSlug: process.env.BITRISE_APP_SLUG ?? "",
8
+ appSlug: "",
9
9
  token: "",
10
10
  workflow: ""
11
11
  };
12
12
  var saveOptions = (options) => {
13
+ ENV.appSlug = options?.app ?? process.env.BITRISE_APP_SLUG ?? "";
13
14
  ENV.token = options?.token ?? process.env.BITRISE_API_CLI_TOKEN ?? "";
14
15
  ENV.workflow = options?.workflow ?? process.env.BITRISE_API_CLI_WORKFLOW ?? "";
15
16
  };
16
17
  var isEnvValid = () => {
17
18
  if (ENV.appSlug.length < 1) {
18
- console.log("No AppSlug provided! (use $BITRISE_APP_SLUG env variable)");
19
+ console.log("No app slug provided! (see --help for more information)");
19
20
  return false;
20
21
  }
21
22
  if (ENV.token?.length < 1) {
@@ -1528,5 +1529,6 @@ var downloadLatestArtifacts = async (options) => {
1528
1529
 
1529
1530
  // src/bin.ts
1530
1531
  var program = new Command();
1531
- program.command("download").option("-t, --token <TOKEN>", "bitrise api token (or use env variable BITRISE_API_CLI_TOKEN)", void 0).option("-w, --workflow <WORKFLOW_NAME>", "workflow to get apk from (or use env variable BITRISE_API_CLI_WORKFLOW)").option("-d, --debug", "output extra debugging", false).description("Download bitrise artifacts").action((options) => downloadLatestArtifacts(options).catch(() => process.exit(1)));
1532
+ program.version("0.0.3");
1533
+ program.command("download").option("-t, --token <TOKEN>", "bitrise api token (or $BITRISE_API_CLI_TOKEN)").option("-w, --workflow <WORKFLOW_NAME>", "workflow to get apk from (or $BITRISE_API_CLI_WORKFLOW)").option("-a, --app <APP_SLUG>", "bitrise app slug (or $BITRISE_APP_SLUG) see bitrise project url to get slug").option("-d, --debug", "output extra debugging", false).description("Download bitrise artifacts").action((options) => downloadLatestArtifacts(options).catch(() => process.exit(1)));
1532
1534
  program.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitrise-api-cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "bitrise api CLI wrapper",
5
5
  "module": "index",
6
6
  "type": "module",