bitrise-api-cli 0.0.10 → 0.0.11
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 +18 -6
- package/dist/cli.js +18 -4
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -18,13 +18,25 @@ npx bitrise-api-cli@latest download --token <BITRISE_TOKEN> --workflow <WORKFLOW
|
|
|
18
18
|
|
|
19
19
|
## 🔐 Configuration
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
You can combine command-line flags, environment variables, and file-based configuration.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
### Environment Variables
|
|
24
|
+
|
|
25
|
+
- `BITRISE_API_CLI_TOKEN`
|
|
26
|
+
- `BITRISE_API_CLI_WORKFLOW`
|
|
27
|
+
- `BITRISE_APP_SLUG` App Slug (auto-set in Bitrise CI)
|
|
28
|
+
|
|
29
|
+
### File-Based Configuration
|
|
30
|
+
|
|
31
|
+
The `.bitrise.json` file can be placed in your project root or home directory.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"token": "your-bitrise-token",
|
|
36
|
+
"slug": "your-app-slug",
|
|
37
|
+
"workflow": "your-workflow-name"
|
|
38
|
+
}
|
|
39
|
+
```
|
|
28
40
|
|
|
29
41
|
## 💡 Examples
|
|
30
42
|
|
package/dist/cli.js
CHANGED
|
@@ -6,6 +6,20 @@ import {
|
|
|
6
6
|
// src/cli/bin/cli.ts
|
|
7
7
|
import { run } from "@stricli/core";
|
|
8
8
|
|
|
9
|
+
// src/config/readConfig.ts
|
|
10
|
+
import { cosmiconfigSync } from "cosmiconfig";
|
|
11
|
+
var explorer = cosmiconfigSync("bitrise", {
|
|
12
|
+
searchPlaces: [".bitrise.json"]
|
|
13
|
+
});
|
|
14
|
+
var readConfig = () => {
|
|
15
|
+
const data = explorer.search()?.config ?? {};
|
|
16
|
+
return {
|
|
17
|
+
token: data.token,
|
|
18
|
+
slug: data.slug,
|
|
19
|
+
workflow: data.workflow
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
9
23
|
// src/cli/commands/download/command.ts
|
|
10
24
|
import { buildCommand } from "@stricli/core";
|
|
11
25
|
var downloadCommand = buildCommand({
|
|
@@ -26,21 +40,21 @@ var downloadCommand = buildCommand({
|
|
|
26
40
|
slug: {
|
|
27
41
|
kind: "parsed",
|
|
28
42
|
brief: "bitrise app slug (or $BITRISE_APP_SLUG) see bitrise project url to get slug",
|
|
29
|
-
default: process.env["BITRISE_APP_SLUG"],
|
|
43
|
+
default: process.env["BITRISE_APP_SLUG"] ?? readConfig().slug,
|
|
30
44
|
parse: String,
|
|
31
45
|
placeholder: "APP_SLUG"
|
|
32
46
|
},
|
|
33
47
|
token: {
|
|
34
48
|
kind: "parsed",
|
|
35
49
|
brief: "bitrise api token (or $BITRISE_API_CLI_TOKEN)",
|
|
36
|
-
default: process.env["BITRISE_API_CLI_TOKEN"],
|
|
50
|
+
default: process.env["BITRISE_API_CLI_TOKEN"] ?? readConfig().token,
|
|
37
51
|
parse: String,
|
|
38
52
|
placeholder: "API_TOKEN"
|
|
39
53
|
},
|
|
40
54
|
workflow: {
|
|
41
55
|
kind: "parsed",
|
|
42
56
|
brief: "workflow to get apk from (or $BITRISE_API_CLI_WORKFLOW)",
|
|
43
|
-
default: process.env["BITRISE_API_CLI_WORKFLOW"],
|
|
57
|
+
default: process.env["BITRISE_API_CLI_WORKFLOW"] ?? readConfig().workflow,
|
|
44
58
|
parse: String,
|
|
45
59
|
placeholder: "WORKFLOW_NAME"
|
|
46
60
|
},
|
|
@@ -69,7 +83,7 @@ import { buildApplication, buildRouteMap } from "@stricli/core";
|
|
|
69
83
|
|
|
70
84
|
// package.json
|
|
71
85
|
var name = "bitrise-api-cli";
|
|
72
|
-
var version = "0.0.
|
|
86
|
+
var version = "0.0.11";
|
|
73
87
|
var description = "bitrise api CLI wrapper";
|
|
74
88
|
|
|
75
89
|
// src/cli/app.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitrise-api-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "bitrise api CLI wrapper",
|
|
5
5
|
"module": "index",
|
|
6
6
|
"type": "module",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@stricli/core": "1.1.2",
|
|
26
|
+
"cosmiconfig": "9.0.0",
|
|
26
27
|
"ora": "8.2.0",
|
|
27
28
|
"zx": "8.5.3"
|
|
28
29
|
},
|