or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

action-system.mdcli.mdconsole.mdgenerator-api.mdindex.mdprogrammatic.mdtemplate-system.md

cli.mddocs/

0

# Command Line Interface

1

2

Plop's CLI provides a comprehensive interface for running generators, managing plopfiles, and getting help information.

3

4

## Capabilities

5

6

### Basic Commands

7

8

Run plop generators through simple command line interface.

9

10

```bash { .api }

11

# Show available generators and select one

12

plop

13

14

# Run specific generator by name

15

plop <generator-name>

16

17

# Run generator with bypass arguments

18

plop <generator-name> [arguments...]

19

20

# Run generator with named arguments

21

plop <generator-name> -- --arg1=value1 --arg2=value2

22

```

23

24

**Usage Examples:**

25

26

```bash

27

# Interactive generator selection

28

plop

29

30

# Run component generator

31

plop component

32

33

# Run component generator with name bypass

34

plop component "MyComponent"

35

36

# Skip first prompt, provide second argument

37

plop component _ "react"

38

39

# Use named arguments

40

plop component -- --name "MyComponent" --type "react"

41

```

42

43

### Help and Information

44

45

Get help and version information.

46

47

```bash { .api }

48

# Show help screen

49

plop --help

50

plop -h

51

52

# Show version information

53

plop --version

54

plop -v

55

```

56

57

### Initialization

58

59

Create initial plopfile configurations.

60

61

```bash { .api }

62

# Generate basic plopfile.js

63

plop --init

64

plop -i

65

66

# Generate TypeScript plopfile.ts

67

plop --init-ts

68

69

# Force overwrite existing plopfile

70

plop --init --force

71

plop -i -f

72

```

73

74

### Generator Options

75

76

Options that modify generator behavior.

77

78

```bash { .api }

79

# Show full type names instead of symbols

80

plop --show-type-names

81

plop -t

82

83

# Force overwrite existing files

84

plop --force

85

plop -f

86

87

# Disable progress bar

88

plop --no-progress

89

```

90

91

### Advanced Options

92

93

Advanced configuration options for specialized use cases.

94

95

```bash { .api }

96

# Specify custom plopfile path

97

plop --plopfile /path/to/plopfile.js

98

99

# Set working directory for plopfile discovery

100

plop --cwd /path/to/directory

101

102

# Preload modules before execution (comma-separated)

103

plop --preload module1,module2

104

105

# Override output destination directory

106

plop --dest /path/to/output

107

108

# Disable progress spinner

109

plop --no-progress

110

111

# Enable shell completion support

112

plop --completion

113

```

114

115

## Command Processing

116

117

### Argument Handling

118

119

```javascript { .api }

120

/**

121

* Handles all basic argument flags

122

* @param env - Values parsed by Liftoff containing configuration paths

123

*/

124

function handleArgFlags(env);

125

```

126

127

The CLI processes arguments in the following order:

128

1. Parse command line arguments using minimist

129

2. Handle special flags (--help, --version, --init)

130

3. Check for plopfile existence

131

4. Pass remaining arguments to generator selection

132

133

### Generator Selection

134

135

```javascript { .api }

136

/**

137

* Parses user input to identify generator and bypass data

138

* @param plop - The plop context with available generators

139

* @param passArgsBeforeDashes - Whether to pass args before '--' to generator

140

* @returns Object containing generator name, bypass array, and parsed arguments

141

*/

142

function getBypassAndGenerator(plop, passArgsBeforeDashes);

143

```

144

145

## Exit Codes

146

147

- **0**: Successful execution

148

- **1**: Error occurred (no plopfile, generator not found, action failed, validation error)

149

150

## Error Handling

151

152

The CLI handles various error scenarios:

153

154

- **No plopfile found**: Shows error message and help screen, exits with code 1

155

- **No generators defined**: Shows error message, exits with code 1

156

- **Generator not found**: Shows error with fuzzy name matching, exits with code 1

157

- **Too many bypass arguments**: Shows generator help, exits with code 1

158

- **Invalid named arguments**: Shows error and generator help, exits with code 1

159

- **Action failures**: Can abort execution based on generator configuration