...
1# Cosign CLI Conventions
2
3* The *primary* output of any command should be to STDOUT. The format should be
4 described in the documentation of each command.
5* Output to STDERR is informational only.
6
7# Expected `cosign version` Behaviour
8From version 2.1.0 (as part of a [dependency update](https://github.com/sigstore/cosign/commit/40dbbd8b09bd5c30191d6e7e7ced3bbd7f6ea559)), the version metadata is [printed to standard output](https://github.com/kubernetes-sigs/release-utils/pull/76). By default it includes the package version, commit hash, git tree state, build date, Go version, compiler toolchain and current platform.
9
10## ASCII Output
11The output of `cosign version` is expected to resemble this format, with the specific values being appropriate for each build of the `cosign` package.
12
13```
14$ cosign version
15 ______ ______ _______. __ _______ .__ __.
16 / | / __ \ / || | / _____|| \ | |
17| ,----'| | | | | (----`| | | | __ | \| |
18| | | | | | \ \ | | | | |_ | | . ` |
19| `----.| `--' | .----) | | | | |__| | | |\ |
20 \______| \______/ |_______/ |__| \______| |__| \__|
21cosign: A tool for Container Signing, Verification and Storage in an OCI registry.
22
23GitVersion: [vX.Y.Z or devel]
24GitCommit: [hash or unknown]
25GitTreeState: [clean or dirty]
26BuildDate: [yyyy-MM-ddThh:mm:ss or unknown]
27GoVersion: go1.A.B
28Compiler: gc
29Platform: os/arch
30```
31
32## JSON Output
33The output of `cosign version --json` is expected to resemble this format, with the specific values being appropriate for each build of the `cosign` package.
34
35```
36$ cosign version --json
37{
38 "gitVersion": "[vX.Y.Z or devel]",
39 "gitCommit": "[hash or unknown]",
40 "gitTreeState": "[clean or dirty]",
41 "buildDate": "[yyyy-MM-ddThh:mm:ss or unknown]",
42 "goVersion": "go1.A.B",
43 "compiler": "gc",
44 "platform": "os/arch"
45}
46```
View as plain text