Skip to content

witnyx init

witnyx init sets up a repository for the release security check. It creates three files in --repo-dir, the current folder by default:

File What it is
.witnyx.yml Witnyx settings: when to fail the build, and the vulnerabilities assessed as not affecting the product. The configuration file page describes every field.
SECURITY.md A security policy template. It names no contact until you add one: an email address or a web address where people can report a vulnerability privately.
.github/workflows/release-security-check.yml A GitHub workflow that runs the release security check on every push and pull request.

Run it once, when you start using Witnyx in a repository. It never changes a file that exists: a path that exists in any form, a symbolic link included, is kept, and so is a path below a folder that is a symbolic link. Running it again creates only the files that are missing.

The workflow runs the Witnyx GitHub Action, witnyx/check@v1.

In a folder without these files:

Terminal window
$ witnyx init
created .witnyx.yml
created SECURITY.md
created .github/workflows/release-security-check.yml
next: Add a security contact (email address or URL) to SECURITY.md

In agent mode, init prints its plan as one JSON document, described by the init plan schema, and writes nothing. --write then creates the planned files. A person who runs init gets the files at once, without --write, so an agent always passes --agent:

Terminal window
$ witnyx init --agent
{
"schema" : "https://witnyx.dev/schemas/init/v1.json",
"files" : [ {
"path" : ".witnyx.yml",
"purpose" : "Witnyx settings: when to fail the build, and vulnerabilities assessed as not affected",
"status" : "planned"
}, {
"path" : "SECURITY.md",
"purpose" : "Security policy template; it names no contact until the owner adds one",
"status" : "planned"
}, {
"path" : ".github/workflows/release-security-check.yml",
"purpose" : "GitHub workflow that runs the release security check on every push and pull request",
"status" : "planned"
} ],
"nextActions" : [ "Run witnyx init again with --write to create the planned files", "Add a security contact (email address or URL) to SECURITY.md" ]
}

See also: Configure .witnyx.yml and GitHub Actions.

Usage

witnyx init [-hV] [--[no-]agent] [--write] [--format=FORMAT] [--repo-dir=DIR]

Options

Option Value Default Description
--repo-dir DIR . The repository root (default: the current directory).
--write In agent mode, create the files; without it init only prints its plan. When a person runs init, it creates the files without this flag.
--agent, --no-agent Agent mode: print the plan as one JSON document and write only with --write (default: detected from the environment).
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
--format FORMAT With --help: text (the default) or json, a machine-readable reference.

Exit codes

Code Meaning
0 Done.
2 Could not run: a usage error, an input error or a failed download.

Witnyx is a record-keeping and workflow tool. It does not certify compliance. Nothing on this site is legal advice.