Create element
Create an element with a new random UUID. Only title, text and required properties are needed; empty required properties give a hint (SR-064). New elements always get the initial status of the metamodel (D-030); when their type lacks it or it is marked invalid, the first status of the type in metamodel order that is not marked invalid, and no status for a type without status or with only invalid statuses (#306, #344).
Command element.create. Writes files in the working tree, never to Git. It is refused while the workspace is read-only. Writes an element file, and no change can be checked against a missing or faulty metamodel.
| Field | Type | Required | Description |
|---|---|---|---|
type |
key |
yes | Fixed metamodel key of a type, property, relation kind or status value. Readable English, lower case, dashes (D-043, SR-010 AK2). |
title |
string |
yes | |
text |
string |
no | Markdown text of the element, written below the frontmatter after one blank line; that blank line after the closing --- is not part of the text. A final line break is added (ADR-0004). Another element is named by a Markdown link, [Title](reqseq:N-6010df) with its UUID, short ID or identifier, which is written as UUID and version; reqseq:N-6010df alone is no link and counts for nothing. |
properties |
object |
no | |
relations |
relationRefs |
no | Relations of the new element by kind, written in the same file (#175), e.g. {“derives-from”: [“N-073”, “N-030”], “based-on”: “D-062”}; on the CLI –relations derives-from=‘[“N-073”,“N-030”]’ –relations based-on=D-062. |
repository |
string |
no | |
folder |
string |
no | Folder relative to the repository; default from the type. |
Output
Section titled “Output”| Field | Type | Required | Description |
|---|---|---|---|
element |
element |
yes | An element as the commands give it: the fields of $defs/elementFields, and no others. |
files |
array of string |
yes | |
problems |
array of problem |
no |
In the command prompt (Ctrl+Shift+P, macOS ⌘⇧P): the command Create element. Key: Ctrl+K E (macOS ⌘K E).
reqseq element create, with --json for the output as JSON. Its help:
Usage: reqseq element create <type> <title> [options]
Create an element with a new random UUID. Only title, text and requiredproperties are needed; empty required properties give a hint (SR-064). Newelements always get the initial status of the metamodel (D-030); when their typelacks it or it is marked invalid, the first status of the type in metamodelorder that is not marked invalid, and no status for a type without status orwith only invalid statuses (#306, #344).
Options: --type <value> instead of the argument <type> --title <value> instead of the argument <title> --text <text|@file|-> Markdown text of the element, written below the frontmatter after one blank line; that blank line after the closing `---` is not part of the text. A final line break is added (ADR-0004). Another element is named by a Markdown link, `[Title](reqseq:N-6010df)` with its UUID, short ID or identifier, which is written as UUID and version; `reqseq:N-6010df` alone is no link and counts for nothing. @file or - reads it from a file or standard input, as --input does; a text that is - or starts with @ only via --input --set <key=value> repeatable; the value as JSON when it parses (a list, number, true, null), else as text: version=1.10 is the number 1.1, give 'version="1.10"' for text; the last value of a key counts; keys add to --input --relations <key=value> Relations of the new element by kind, written in the same file (#175), e.g. {"derives-from": ["N-073", "N-030"], "based-on": "D-062"}; on the CLI --relations derives-from='["N-073","N-030"]' --relations based-on=D-062. repeatable; the value as JSON when it parses (a list, number, true, null), else as text: version=1.10 is the number 1.1, give 'version="1.10"' for text; the last value of a key counts; keys add to --input --repository <value> --folder <value> Folder relative to the repository; default from the type. --input <json|@file|-> command input as JSON: inline, from a file, or from standard input --workspace <path> workspace root (default: nearest folder upwards with reqseq-workspace.yaml) --json print exactly the command output as JSON --yaml print the whole command output as YAML, problems one per line -h, --help show helpPOST /v1/commands/element.create on the local API (reqseq serve api), with the input as the JSON body; the answer is the output.
Tool element_create of the MCP server (reqseq mcp), with the input as its arguments.