Skip to content
API reference

API reference

The API reference documents both functions.

Kind Export Description
function reportedVersion() Read an installed CLI’s complete version line for update and rollback checks.
function expectReportedVersion() Check that a newly installed CLI reports the current label and exact version.

reportedVersion()function

Section titled “reportedVersion()”
Signature
function reportedVersion(stdout):
| {
label: "fungi" | "Spore";
version: string;
}
| undefined;

Read an installed CLI’s complete version line for update and rollback checks.

Parameter Type Description
stdout string Captured command output, trimmed before validation.

The fungi or previous Spore label and valid semver token, or undefined when the complete output does not match the bounded contract.

Signature
{
label: "fungi" | "Spore";
version: string;
}
Name Type Description
label "fungi" | "Spore" Installed command label, including the previous label used for rollback.
version string Complete version token accepted by semver validation.

undefined


expectReportedVersion()function

Section titled “expectReportedVersion()”
Signature
function expectReportedVersion(stdout, expected): boolean;

Check that a newly installed CLI reports the current label and exact version.

Parameter Type Description
stdout string Captured command output.
expected string Exact version expected by the updater or launch proof.

boolean

Whether the output reports fungi with exactly the expected version.