vulnlog init

vulnlog init creates a Vulnlog file with the required sections only: the schema header, schemaVersion, project, an empty releases list, and an empty vulnerabilities list. It writes to stdout unless you name an output file.

Synopsis

vulnlog init --organization <text> --name <text> --author <text> [-o <path>] [--force]

Options

Name Value Default Description

--organization

Text

required

Organisation that owns the project. Written to project.organization.

--name

Text

required

Project name. Written to project.name.

--author

Text

required

Author of the Vulnlog file, for example a team. Written to project.author.

-o, --output

A file path, or -

stdout

File to write. - writes to stdout. The directory must exist.

--force

none

off

Replace the output file if it exists. Without it, init doesn’t overwrite a file.

For the fields of the project block, see Project and releases. For global options and standard input and output, see Global options and Standard input and output.

Exit codes

Code When

0

The file was written, or the content went to stdout.

1

A general error, the output file exists and --force isn’t set, the output path is a directory, or its directory doesn’t exist. For the general errors, see Exit codes.

Examples

Print a new file to stdout:

$ vulnlog init --organization "Acme Corp" --name "Acme Shop" --author "Acme Product Security Team"
# $schema: https://vulnlog.dev/schema/vulnlog-v1.json
---
schemaVersion: "1"

project:
  organization: Acme Corp
  name: Acme Shop
  author: Acme Product Security Team

releases: []

vulnerabilities: []

Write it to vulnlog.yaml:

$ vulnlog init --organization "Acme Corp" --name "Acme Shop" --author "Acme Product Security Team" -o vulnlog.yaml
Created: vulnlog.yaml

Run the same command again, and init refuses to replace the file:

$ vulnlog init --organization "Acme Corp" --name "Acme Shop" --author "Acme Product Security Team" -o vulnlog.yaml
error: the file vulnlog.yaml already exists
  hint: pass --force to replace it

The file init creates passes vulnlog validate and vulnlog fmt --check as it is.