new

Last updated on

Create new Asterdoc artifacts

Creates new Asterdoc artifacts with interactive prompts or command-line options.

Usage

asterdoc new <type> <name> [options]

Subcommands

CommandDescription
formCreate a new form artifact
documentCreate a new document artifact
checklistCreate a new checklist artifact
bundleCreate a new bundle artifact

new form

Create a new form artifact.

asterdoc new form <name> [options]

Options

OptionDescription
-y, --yesNon-interactive mode (skip prompts)
--slug <slug>Override auto-generated slug
--title <title>Human-readable title
--description <desc>Description
--code <code>Form number as printed by its issuer
--artifact-version <version>Version (default: 1.0.0)
--dir <path>Custom output directory
--field <name:type>Add field (can be used multiple times)
--dry-runPreview without creating files
--format <format>Output format: json or yaml (default: json)

type must be one of the field types the schema accepts (text, boolean, number, coordinate, bbox, money, address, phone, duration, email, uuid, uri, enum, date, datetime, time, person, organization, identification, multiselect, percentage, rating, fieldset, list). An unknown type exits non-zero and lists the valid types. Every type scaffolds with the keys it requires, so the result passes asterdoc validate: enum and multiselect get sample enum options, fieldset gets an empty fields map, and list gets a text item.

Examples

Interactive form creation:

asterdoc new form my-form

Non-interactive with options:

asterdoc new form lease-agreement \
  --yes \
  --title "Lease Agreement" \
  --field "address:address" \
  --field "rent:money" \
  --format yaml

new document

Create a new document artifact.

asterdoc new document <name> [options]

Options

OptionDescription
-y, --yesNon-interactive mode (skip prompts)
--slug <slug>Override auto-generated slug
--title <title>Human-readable title
--description <desc>Description
--code <code>Form number as printed by its issuer
--artifact-version <version>Version (default: 1.0.0)
--dir <path>Custom output directory
--dry-runPreview without creating files
--format <format>Output format: json or yaml (default: json)

new checklist

Create a new checklist artifact.

asterdoc new checklist <name> [options]

Options

OptionDescription
-y, --yesNon-interactive mode (skip prompts)
--slug <slug>Override auto-generated slug
--title <title>Human-readable title
--description <desc>Description
--code <code>Form number as printed by its issuer
--artifact-version <version>Version (default: 1.0.0)
--dir <path>Custom output directory
--item <text>Add item (can be used multiple times)
--dry-runPreview without creating files
--format <format>Output format: json or yaml (default: json)

Example

asterdoc new checklist move-in \
  --yes \
  --title "Move-in Checklist" \
  --item "Collect keys" \
  --item "Record meter readings"

new bundle

Create a new bundle artifact.

asterdoc new bundle <name> [options]

Options

OptionDescription
-y, --yesNon-interactive mode (skip prompts)
--slug <slug>Override auto-generated slug
--title <title>Human-readable title
--description <desc>Description
--code <code>Form number as printed by its issuer
--artifact-version <version>Version (default: 1.0.0)
--dir <path>Custom output directory
--dry-runPreview without creating files
--format <format>Output format: json or yaml (default: json)

See also

  • validate - Validate created artifacts
  • fix - Fix artifact issues

Every new subcommand accepts --force to overwrite an existing file. --yes skips prompts but does not permit overwriting without --force.

On this page