Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5d21d5e
feat(cli): prompt for missing arguments in interactive terminals
Aug 30, 2026
58733c7
feat(system): add a system create command
Aug 30, 2026
8430746
refactor(system): delegate custom system scaffolding to system create
Aug 30, 2026
5346792
feat(system): guide system installation with a review step
Aug 30, 2026
eeaa5b8
docs: align the CLI description across the package, readme, and help
Aug 30, 2026
fc4b104
feat(cli): group root help output by task
Aug 30, 2026
ff0f143
feat(system): add a command to detach the configured system
Aug 30, 2026
0bee17d
feat(component): add component types for twig, react, and web components
Aug 30, 2026
3fc3bbb
docs(component): document component types and template overrides
Aug 30, 2026
fafbf87
refactor(component): make derived template values token-expressible
Aug 30, 2026
1f30766
feat(component): add a command to eject built-in component templates
Aug 30, 2026
010546a
test(ci): fix cross-platform release checks
Aug 30, 2026
914cd3d
fix(component): prevent template tokens from rewriting user twig vari…
Aug 30, 2026
be0f488
fix(cli): align component overwrite flags
Aug 30, 2026
6ce2182
feat(component): add all template ejection option
Aug 30, 2026
02dce91
fix(system): use explicit scaffold URL placeholders
Aug 30, 2026
b517868
fix(fs): write project config atomically
Aug 30, 2026
a7ba189
fix(component): report or roll back partial template ejects
Aug 30, 2026
9b38b79
feat(system): add dry-run and exclusive-create guard to system create
Aug 30, 2026
9711c5f
fix(system): bound the remote tag lookup
Aug 30, 2026
9eb9c78
feat(component): allow an explicit custom element tag name
Aug 30, 2026
936d087
test(ci): make coverage patterns and fixtures platform-independent
Aug 30, 2026
8bf5072
test(system): assert dry run output without regex path interpolation
Aug 30, 2026
219f985
test(fs): use platform-shaped paths in temp file assertions
Aug 30, 2026
49da06e
fix(component): fall back when the filesystem does not support hard l…
Aug 30, 2026
2b034fe
test(ci): make transform patterns platform-independent and recalibrat…
Aug 30, 2026
4a6efed
fix(component): never roll back a destination the eject did not create
Aug 30, 2026
7ebf507
test(component): cover hard-link fallback error paths
Aug 30, 2026
92e0306
test(ci): exclude test helpers from coverage and guard packaging
Aug 30, 2026
2107fef
Merge pull request #363 from emulsify-ds/release/v2.4.0
callinmullaney Aug 30, 2026
ba9be58
chore(release): bump version to 2.4.0
github-actions[bot] Aug 30, 2026
899c72f
Merge pull request #365 from emulsify-ds/chore/develop-version-bump
callinmullaney Aug 30, 2026
7559fe9
test(ci): map coverage to TypeScript sources
Aug 31, 2026
6afa667
test(system): use a platform-shaped file URL fixture
Aug 31, 2026
68a334c
test(system): assert file URL formatting portably
Aug 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/e2e/root-help.txt text eol=lf
112 changes: 96 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Emulsify CLI

Command line interface for creating Emulsify projects, installing component systems, installing system components, generating local components, and routing project audits to Emulsify Core.
Build and use component systems in Drupal, WordPress, or standalone front ends.

## Requirements

Expand Down Expand Up @@ -34,7 +34,7 @@ cd ./web/themes/custom/my_theme
emulsify system install
emulsify component list
emulsify component install card
emulsify component create promo-card --directory molecules --format default
emulsify component create promo-card --directory molecules --type twig
```

Built-in platforms are `drupal`, `wordpress`, and `none`. For WordPress child themes, use the WordPress platform and starter:
Expand All @@ -45,14 +45,91 @@ emulsify init "My Theme" ./wp-content/themes --platform wordpress

When WordPress is auto-detected, Emulsify initializes child themes into the detected themes directory, such as `wp-content/themes/my-theme` or `web/app/themes/my-theme` for Bedrock.

For non-interactive environments, pass the flags that normally prompt for input:
To author a standalone, distributable component system, run `system create`
outside or inside any project. The target directory is created beneath the
selected parent directory:

```bash
emulsify system create "My System" --directory ./systems --platform "drupal || wordpress" --git
```

This creates `./systems/my-system` with valid system and variant configuration,
an installable `example-card` component, repository documentation, a
`.gitignore`, and a license placeholder to replace before distribution.
Unless overridden, its required URL metadata uses obvious, schema-valid
`https://TODO.invalid/...` placeholders that must also be replaced before
publishing.

Add `--dry-run` to preview the normalized target, every generated file, and
whether Git would be initialized without changing the filesystem.

When components installed from another system have evolved into the basis of
your own, detach the configured system before authoring a replacement:

```bash
emulsify system detach
```

Detaching removes only the `system` and `variant` entries from
`project.emulsify.json`. Components, project assets, and the cached system
repository stay in place. Run `system create` to scaffold a new system
repository, then move or copy the preserved components into that scaffold and
update `system.emulsify.json`; `system create` does not import them
automatically.

Interactive terminals can run `emulsify component create` with no arguments to
walk through the component name, type, and directory prompts. The type picker
always offers Twig, offers Twig SDC in Drupal projects, and offers React and Web
Component scaffolds when the project's `package.json` declares
`@emulsify/core`. When a choice is unavailable, the wizard explains why; when
Twig is the only suitable choice, it skips the one-item prompt. Likewise,
`emulsify component install` with no name presents the components available in
the installed system variant plus an explicit choice to install all components.

To customize component scaffolds, copy the CLI's built-in templates into the
project, then edit the resulting files under `.cli/templates/`:

```bash
emulsify component eject-templates twig
```

Run the command without a type in an interactive terminal to select one or more
component types. Use `--all` to eject every type non-interactively. Existing
overrides are protected unless `--force` is passed.

Prompts only run when standard input is a TTY. In CI, scripts, and commands with
piped or redirected input, provide every required positional argument and flag;
the CLI exits with an actionable error instead of waiting for input:

```bash
emulsify init "My Theme" ./web/themes/custom --platform drupal --yes
emulsify system create my-system --directory ./systems --platform none --git
emulsify system create my-system --directory ./systems --platform none --git --dry-run
emulsify system install compound
emulsify component create promo-card --directory molecules --format default --yes
emulsify component install card --force
# Or install every available component:
emulsify component install --all
emulsify component create promo-card --directory molecules --type twig --force
emulsify component create card --directory molecules --type web-component --tag-name acme-card
emulsify component eject-templates --all
emulsify system detach --yes
```

For component installation, provide either a component name or `--all`, and use
`--force` when an existing destination should be replaced. For component
creation, provide the positional name plus `--type` and `--directory`, and use
`--force` when an existing generated component should be replaced. The existing
`-y, --yes` form remains available as a compatibility alias. Explicit
`--type` values are honored even when project detection would hide that choice
from the wizard. The deprecated `--format default` and `--format sdc` forms
remain available as aliases for `--type twig` and `--type twig-sdc`,
respectively, and print a deprecation warning. Web Components derive their tag
name from the component and project names; pass `--tag-name` to override it,
including when the derived value would be invalid in a non-interactive run.
For template ejection, provide the component type or `--all` outside a TTY; use
`--dry-run` to preview paths and `--force` only when existing customizations
should be replaced.

## Documentation

Detailed documentation lives in [docs](./docs/README.md).
Expand All @@ -61,26 +138,29 @@ Detailed documentation lives in [docs](./docs/README.md).
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| [CLI Reference](./docs/cli-reference.md) | Looking up commands, aliases, options, and examples. |
| [Project Initialization](./docs/project-initialization.md) | Creating a new Emulsify project from a starter. |
| [Systems](./docs/systems.md) | Listing, installing, or authoring component systems. |
| [Systems](./docs/systems.md) | Listing, installing, detaching, or authoring component systems. |
| [Components](./docs/components.md) | Listing, installing, dry-running, or creating components. |
| [Project Configuration](./docs/configuration.md) | Understanding `project.emulsify.json`, variants, and structure mappings. |
| [Component Template Overrides](./docs/component-template-overrides.md) | Customizing files generated by `emulsify component create`. |
| [Component Template Overrides](./docs/component-template-overrides.md) | Ejecting and customizing files used by `emulsify component create`. |
| [Hooks And Cache](./docs/hooks-and-cache.md) | Understanding starter hooks, system hooks, and local repository cache behavior. |
| [Development](./docs/development.md) | Setting up this repository and running local checks. |
| [Release](./docs/release.md) | Understanding CI, semantic-release, and npm publishing. |

## Command Overview

| Command | Alias | Description |
| ----------------------------------- | ----------------------------- | ----------------------------------------------------------------- |
| `emulsify init [name] [path]` | | Initializes an Emulsify project from a starter. |
| `emulsify audit [...args]` | | Runs the project-installed Emulsify Core audit. |
| `emulsify system list` | `emulsify system ls` | Lists built-in systems available for installation. |
| `emulsify system install [name]` | | Installs or scaffolds a system in the current Emulsify project. |
| `emulsify component list` | `emulsify component ls` | Lists components available from the installed system and variant. |
| `emulsify component install [name]` | `emulsify component i [name]` | Installs one component from the installed system and variant. |
| `emulsify component create [name]` | `emulsify component c [name]` | Creates a local component in the current Emulsify project. |
| `emulsify cache clear` | | Clears locally cached system repositories. |
| Command | Alias | Description |
| ------------------------------------------- | ----------------------------- | ----------------------------------------------------------------- |
| `emulsify init [name] [path]` | | Initializes an Emulsify project from a starter. |
| `emulsify audit [...args]` | | Runs the project-installed Emulsify Core audit. |
| `emulsify system list` | `emulsify system ls` | Lists built-in systems available for installation. |
| `emulsify system create [name]` | | Creates a standalone component-system repository. |
| `emulsify system install [name]` | | Installs a system in the current Emulsify project. |
| `emulsify system detach` | | Detaches the system and keeps project components. |
| `emulsify component list` | `emulsify component ls` | Lists components available from the installed system and variant. |
| `emulsify component install [name]` | `emulsify component i [name]` | Installs one component from the installed system and variant. |
| `emulsify component create [name]` | `emulsify component c [name]` | Creates a local component in the current Emulsify project. |
| `emulsify component eject-templates [type]` | | Writes editable built-in templates into the current project. |
| `emulsify cache clear` | | Clears locally cached system repositories. |

`emulsify audit` is a convenience façade. The project-installed
`@emulsify/core` package remains the owner of the canonical `emulsify-audit`
Expand Down
28 changes: 15 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Emulsify CLI Documentation

Build and use component systems in Drupal, WordPress, or standalone front ends.

These docs expand on the short project README and are organized by the task a project user or maintainer is usually trying to complete.

| Topic | Use This When |
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| [CLI Reference](./cli-reference.md) | Looking up commands, aliases, options, and examples. |
| [Project Initialization](./project-initialization.md) | Creating a new Emulsify project from a starter, including Drupal, WordPress, and non-interactive examples. |
| [Systems](./systems.md) | Listing built-in systems, installing systems, understanding variant compatibility, or using custom system repositories. |
| [Components](./components.md) | Listing installable components, installing components and dependencies, using dry runs, and creating local components. |
| [Project Configuration](./configuration.md) | Understanding `project.emulsify.json`, system and variant references, structure mappings, and validation. |
| [Component Template Overrides](./component-template-overrides.md) | Replacing the built-in `component create` templates with project-level templates. |
| [Hooks And Cache](./hooks-and-cache.md) | Understanding starter hooks, system install hooks, script execution, and the `~/.emulsify/cache` repository cache. |
| [Development](./development.md) | Setting up this repository, understanding source layout, and running checks. |
| [Release](./release.md) | Understanding CI, develop version bumps, semantic-release, and npm publishing. |
| [Contributors](./contributors.md) | Viewing project contributors moved out of the root README. |
| [Website Usage Copy](./emulsify-info-cli-updates.md) | Copy-ready usage content for the `emulsify.info` CLI page. |
| Topic | Use This When |
| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| [CLI Reference](./cli-reference.md) | Looking up commands, aliases, options, and examples. |
| [Project Initialization](./project-initialization.md) | Creating a new Emulsify project from a starter, including Drupal, WordPress, and non-interactive examples. |
| [Systems](./systems.md) | Listing, installing, detaching, or authoring systems, including custom repositories and variant compatibility. |
| [Components](./components.md) | Listing installable components, installing components and dependencies, using dry runs, and creating local components. |
| [Project Configuration](./configuration.md) | Understanding `project.emulsify.json`, system and variant references, structure mappings, and validation. |
| [Component Template Overrides](./component-template-overrides.md) | Ejecting built-in `component create` templates and customizing them at the project level. |
| [Hooks And Cache](./hooks-and-cache.md) | Understanding starter hooks, system install hooks, script execution, and the `~/.emulsify/cache` repository cache. |
| [Development](./development.md) | Setting up this repository, understanding source layout, and running checks. |
| [Release](./release.md) | Understanding CI, develop version bumps, semantic-release, and npm publishing. |
| [Contributors](./contributors.md) | Viewing project contributors moved out of the root README. |
| [Website Usage Copy](./emulsify-info-cli-updates.md) | Copy-ready usage content for the `emulsify.info` CLI page. |
Loading
Loading