# @eui/cli

Command-line interface for scaffolding and managing eUI applications.

## Installation

```sh
npm install -g @eui/cli
```

## Usage with npx

Run without installing globally:

```sh
npx @eui/cli new
```

## Usage

### Generate a new application

```sh
eui-cli new
```

Or simply:

```sh
eui-cli
```

The CLI will prompt you to configure your application:

1. **Application Type**: Choose between:
   - Desktop (Angular)
   - Mobile Ionic
   - eUI + Spring Boot web module (requires JDK + Maven)
   - eUI + Maven web module (JEE Spring, requires JDK + Maven)

2. **Maven Configuration** (for web-spring-boot type only):
   - groupId (e.g., `ec.europa.digit`)
   - artifactId (e.g., `myapp`)

3. **Additional Options** (not available for Mobile):
   - eUI ECL app-shell template (for ec.europa.eu apps)
     - If selected, choose between EC theme or EU theme

4. **Dependency Installation**: Choose whether to install dependencies automatically
5. **Package Manager**: Select Yarn 1.x or Pnpm (experimental)
6. **eui-skills Setup**: Optionally install [eui-skills](https://sdlc.webcloud.ec.europa.eu/csdr/eui-skills.git) after generation
   - **Install all** (`--all`): install all skills to all agents without prompts
   - Or configure individually:
     - **Agent(s)**: target specific agents (e.g. `cursor`, `claude-code`, or `*` for all)
     - **Skill(s)**: specific skill names to install (or `*` for all)
     - **Global**: install at user-level instead of project-level
     - **Skip confirmations**: auto-confirm all skills prompts

#### CLI Flags

Skip prompts by passing flags directly:

```sh
# Generate with skills setup (interactive sub-prompts)
eui-cli new --skills

# Install all skills to all agents without prompts
eui-cli new --skills --skillsAll

# Target specific agents and skip confirmations
eui-cli new --skills --skillsAgent "cursor claude-code" --skillsYes

# Install a specific skill globally
eui-cli new --skills --skillsSkill "pr-review" --skillsGlobal
```

> Skills sub-options (`--skillsAgent`, `--skillsSkill`, `--skillsGlobal`, `--skillsYes`, `--skillsAll`) require `--skills` to be set, otherwise the CLI will exit with an error.

#### Automated Mode

Generate an application without prompts using a configuration string:

```sh
eui-cli new --config <config-string> --targetPath <output-directory>
```

Configuration format:
```
appType:angular,appOptions:ecl,appOptionsEclTheme:ecl-ec,npmInstall:false
```

Available options:
- `appType`: `angular`, `mobile`, `web-spring-boot`, `web-maven`
- `groupId`: Maven groupId (for web-spring-boot, e.g., `ec.europa.digit`)
- `artifactId`: Maven artifactId (for web-spring-boot, e.g., `myapp`)
- `appOptions`: `ecl` (use underscore for multiple: `ecl_option2`)
- `appOptionsEclTheme`: `ecl-ec`, `ecl-eu`
- `npmInstall`: `true`, `false`
- `packageManager`: `yarn`, `pnpm`
- `skills`: `true`, `false`
- `skillsAll`: `true`, `false`
- `skillsAgent`: agent name(s), space-separated or `*`
- `skillsSkill`: skill name(s), space-separated or `*`
- `skillsGlobal`: `true`, `false`
- `skillsYes`: `true`, `false`

### Build application

```sh
eui-cli build-app [options]
```

Options:
- `--skipLint` - Skip linting step
- `--skipTest` - Skip testing step
- `--skipCompile` - Skip compilation step
- `-c, --configuration <config>` - Angular build configuration
- `--baseHref, --base-href <href>` - Base href for the application
- `--statsJson` - Generate stats.json file
- `--sourceMap` - Generate source maps

### Serve application

```sh
eui-cli serve-app [options]
```

Options:
- `-c, --configuration <config>` - Angular build configuration
- `-p, --port <port>` - Port number (default: 4200)
- `-h, --host <host>` - Host to serve on
- `--proxyConfig <path>` - Path to proxy configuration file
- `--open` - Open browser automatically

### Lint application

```sh
eui-cli lint-app
```

### Generate SVG sprite

```sh
eui-cli generate-sprite -i <input-folder> -o <output-file>
```

Options:
- `-i, --inFolder <path>` - Input folder containing SVG files (required)
- `-o, --outFile <filename>` - Output sprite filename with .svg extension (required)

## Requirements

- Node.js 24.x or higher
- npm or yarn

## License

EUPL-1.1
