@argos-ci/cli 6.0.0 → 6.1.1
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 +26 -3
- package/dist/index.mjs +19 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -7,16 +7,39 @@
|
|
|
7
7
|
</a>
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
<p align="center"><strong>The open source visual testing
|
|
10
|
+
<p align="center"><strong>The open source visual testing platform for AI-native engineering teams.</strong></p>
|
|
11
11
|
|
|
12
12
|
# Argos Command Line Interface
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Interact with and upload screenshots to [argos-ci.com](https://argos-ci.com) from the command line.
|
|
15
15
|
|
|
16
16
|
[](https://www.npmjs.com/package/@argos-ci/cli)
|
|
17
17
|
[](https://www.npmjs.com/package/@argos-ci/cli)
|
|
18
18
|
[](https://www.npmjs.com/package/@argos-ci/cli)
|
|
19
19
|
|
|
20
|
+
Visit the [Argos CLI documentation](https://argos-ci.com/docs/sdks-reference/argos-command-line-interface-cli) for the full command reference and more.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install --save-dev @argos-ci/cli
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
Upload a directory of screenshots to Argos. Authenticate with your project token via the `ARGOS_TOKEN` environment variable:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
ARGOS_TOKEN="<your-argos-token>" npx @argos-ci/cli upload ./screenshots
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The CLI also exposes commands to `deploy` a static build, inspect and `review` builds, post a `comment`, and more. List them all with:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npx @argos-ci/cli --help
|
|
40
|
+
```
|
|
41
|
+
|
|
20
42
|
## Links
|
|
21
43
|
|
|
22
|
-
- [Official CLI Docs](https://argos-ci.com/docs)
|
|
44
|
+
- [Official CLI Docs](https://argos-ci.com/docs/sdks-reference/argos-command-line-interface-cli)
|
|
45
|
+
- [Discord](https://argos-ci.com/discord)
|
package/dist/index.mjs
CHANGED
|
@@ -132,6 +132,13 @@ function formatUser(user) {
|
|
|
132
132
|
if (!user) return "-";
|
|
133
133
|
return user.name ? `${user.name} (@${user.slug})` : `@${user.slug}`;
|
|
134
134
|
}
|
|
135
|
+
function formatMe(user) {
|
|
136
|
+
return [
|
|
137
|
+
`Logged in to Argos as ${formatUser(user)}.`,
|
|
138
|
+
`Slug: ${user.slug}`,
|
|
139
|
+
`Name: ${formatValue(user.name)}`
|
|
140
|
+
].join("\n");
|
|
141
|
+
}
|
|
135
142
|
function formatStats(stats) {
|
|
136
143
|
if (!stats) return "-";
|
|
137
144
|
return [
|
|
@@ -1074,6 +1081,17 @@ function deployCommand(program) {
|
|
|
1074
1081
|
});
|
|
1075
1082
|
}
|
|
1076
1083
|
//#endregion
|
|
1084
|
+
//#region src/commands/whoami.ts
|
|
1085
|
+
function whoamiCommand(program) {
|
|
1086
|
+
program.command("whoami").description("Display the user authenticated with the current Argos token").addOption(tokenOption).addOption(jsonOption).action(async (options) => {
|
|
1087
|
+
try {
|
|
1088
|
+
output(unwrap(await createApiClient(await resolveToken(options)).GET("/me")), options, formatMe);
|
|
1089
|
+
} catch (error) {
|
|
1090
|
+
handleCliError(error, "user");
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
//#endregion
|
|
1077
1095
|
//#region src/index.ts
|
|
1078
1096
|
const rawPkg = await readFile(resolve(fileURLToPath(new URL(".", import.meta.url)), "..", "package.json"), "utf8");
|
|
1079
1097
|
const pkg = JSON.parse(rawPkg);
|
|
@@ -1087,6 +1105,7 @@ commentCommand(program);
|
|
|
1087
1105
|
loginCommand(program);
|
|
1088
1106
|
logoutCommand(program);
|
|
1089
1107
|
deployCommand(program);
|
|
1108
|
+
whoamiCommand(program);
|
|
1090
1109
|
if (!process.argv.slice(2).length) program.outputHelp();
|
|
1091
1110
|
else program.parse(process.argv);
|
|
1092
1111
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/cli",
|
|
3
3
|
"description": "Command-line (CLI) for visual testing with Argos.",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.1.1",
|
|
5
5
|
"bin": {
|
|
6
6
|
"argos": "./bin/argos-cli.js"
|
|
7
7
|
},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/argos-ci/argos-javascript.git",
|
|
15
15
|
"directory": "packages/core"
|
|
16
16
|
},
|
|
17
|
-
"homepage": "https://argos-ci.com/docs/argos-cli",
|
|
17
|
+
"homepage": "https://argos-ci.com/docs/sdks-reference/argos-command-line-interface-cli",
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/argos-ci/argos-javascript/issues"
|
|
20
20
|
},
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@argos-ci/api-client": "0.
|
|
38
|
-
"@argos-ci/core": "6.
|
|
37
|
+
"@argos-ci/api-client": "0.24.1",
|
|
38
|
+
"@argos-ci/core": "6.5.0",
|
|
39
39
|
"commander": "^15.0.0",
|
|
40
40
|
"open": "^11.0.0",
|
|
41
41
|
"ora": "^9.4.0",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"check-format": "prettier --check --ignore-unknown --ignore-path=../../.gitignore --ignore-path=../../.prettierignore .",
|
|
55
55
|
"lint": "eslint ."
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "7fddaad1a6bb251a1f2eecbf8f4ecfa3e84e9b97"
|
|
58
58
|
}
|