CLI command reference
The exhaustive reference entry for every sek command. For the narrative
walkthrough see The sek CLI; this page is the
flag-by-flag lookup. Re-verified against cli/commands/ and cli/sek-cli.js:
there are exactly three commands.
sek <command>
Section titled “sek <command>”Usage: sek <command>
Commands: add-section Scaffold a new section add-type Scaffold a new post type config edit-type Edit an existing post type config
Options: --help Show this help message--help on sek itself, or on any individual command, prints usage and
exits without writing anything.
sek add-section <handle>
Section titled “sek add-section <handle>”| Arguments | <handle>: required. Validated before anything is written. |
| Flags | --help |
| Writes | <sectionsPath>/<handle>.yaml and <sectionsPath>/<handle>.blade.php, under the theme’s .sek.yml sections directory. |
| Refuses to run when | Either output file already exists. |
Scaffolds a minimal section config:
label: <Title Case of handle>handle: <handle>templatePath: <computed>category: contenticon: layoutfields: []label is derived from handle (kebab-case → Title Case). templatePath
is computed relative to {themeRoot}/resources/views/: the Sage/Blade
view-finder convention. On a classic (non-Blade) theme whose sections key
points directly at a theme-root directory, the computed templatePath
won’t match the actual template location; correct it by hand after
scaffolding.
The assembled config is validated against section.schema.json before
either file is written.
sek add-type <name> [--sections a,b,c]
Section titled “sek add-type <name> [--sections a,b,c]”| Arguments | <name>: required. Validated before anything is written. |
| Flags | --sections <comma-separated handles> (optional: launches an interactive checkbox prompt over every section type discovered under the theme’s sections directory when omitted); --help |
| Writes | <postTypesPath>/<name>.yaml: { sections: [<selected handles>] }. |
| Refuses to run when | The post-type config already exists (use edit-type instead), or no section types were found to choose from. |
The assembled { sections: [...] } config is validated against
post-type.schema.json before writing.
sek edit-type <name> [--sections a,b,c]
Section titled “sek edit-type <name> [--sections a,b,c]”| Arguments | <name>: required. Must match an existing post-type config. |
| Flags | --sections <comma-separated handles> (optional: the interactive checkbox prompt pre-checks whichever sections are already selected when omitted); --help |
| Writes | <postTypesPath>/<name>.yaml, replacing only the sections: key. Every other existing key (preview, previewDebounce, and so on) is preserved untouched. |
| Refuses to run when | The post-type config does not already exist, or no section types were found to choose from. |
Same schema validation as add-type, against the merged config.
Common behaviour across all three commands
Section titled “Common behaviour across all three commands”- Handle/name arguments are validated before any file touches disk: an invalid value (wrong case, disallowed characters) fails fast.
- Schema validation runs before every write; a failure prints every schema error via the CLI’s Ajv validator and exits non-zero with nothing partial written.
- All three commands locate the active theme by searching upward for
.sek.ymlfrom the current working directory. See the.sek.ymlreference. The CLI has no global binary; run it vianode cli/sek-cli.js <command>from inside your theme, ornpm run sek -- <command>from the repo root (npm runpins its working directory to the root, so that form only finds a.sek.ymlat or above it). See the narrative walkthrough for the full invocation forms and worked examples.
Where to go next
Section titled “Where to go next”- The
sekCLI: the narrative walkthrough, with worked examples and the classic-themetemplatePathcaveat in full. .sek.ymlreference: the file every command resolves its paths against.- Config & YAML reference: the shape of the files these commands scaffold.