wormaworma

CLI Commands

Detailed parameters for worma init / gen / diff

worma init

Initialize the config file.

# Create worma.config.js in the current directory
worma init

# Specify the config file type
worma init -t typescript
worma init --type commonjs

# Specify a template preset
worma init -T axios
worma init --template ky

# Specify the project directory
worma init -p ./packages/app

Parameters

ParameterDescriptionAllowed values
-t, --type <type>Config file typetypescript / ts / commonjs / module
-T, --template <template>Template preset, defaults to alovaalova / functional / axios / fetch / ky
-p, --project <path>Project directory—

worma gen

Generate API code based on the config. When the cache hits, only changed tags are rendered incrementally; files that are unchanged and still present are not rewritten — if generated files were deleted manually (while the cache survives), the next run re-renders the missing ones automatically.

# Basic usage (workspace mode by default, scans all sub-projects)
worma gen

# Specify a project path (single-project mode)
worma gen -p ./packages/app
worma gen --project ./packages/app

Parameters

ParameterDescription
-d, --debugPrint debug logs
-p, --project <path>Specify the project directory. When provided, only that project is generated; otherwise workspace mode scans all sub-projects

Behavior

worma gen
  → workspace mode by default: scan all sub-projects and generate one by one

worma gen -p ./packages/app
  → single-project mode: read config and generate only for the specified directory

worma diff

Browse the API change records (added / removed / modified) written after a successful generate.

worma diff              # list all change records
worma diff --list       # same as above, explicit list
worma diff latest       # view the latest record's details
worma diff 0007         # view a record by sequence number
worma diff --remove 0007      # delete record 0007
worma diff 0007 --remove      # same, the id may also be the positional argument
worma diff --remove latest    # delete the latest record
worma diff -p ./packages/app  # specify the project directory

Parameters

ParameterDescription
[id]Change record sequence number (e.g. 0007) or the alias latest; omit to list all
-l, --listList all change records
-r, --remove [id]Delete the given change record, e.g. worma diff --remove 0007. The id may also come from the positional argument (worma diff 0007 --remove); with neither, it just asks for one
-p, --project <path>Specify the project directory

--remove only deletes that single record file under changes/ (an unknown id prints a hint and changes nothing). The sequence counter is not rewound, so a deleted sequence number is normally never reused. The VS Code extension's API Changes page offers the same delete action.

On this page