0
# Application Configuration
1
2
Core configuration methods for setting up your CLI application including version, title, description, banner, and prompt delimiter.
3
4
## Capabilities
5
6
### Version Configuration
7
8
Sets the version of your application's API.
9
10
```javascript { .api }
11
/**
12
* Sets the version of your application's API
13
* @param version - Version string for the application
14
* @returns Vorpal instance for chaining
15
*/
16
function version(version: string): Vorpal;
17
```
18
19
**Usage Example:**
20
21
```javascript
22
const vorpal = require('vorpal')();
23
24
vorpal
25
.version('1.0.0');
26
```
27
28
### Title Configuration
29
30
Sets the title of your application.
31
32
```javascript { .api }
33
/**
34
* Sets the title of your application
35
* @param title - Title string for the application
36
* @returns Vorpal instance for chaining
37
*/
38
function title(title: string): Vorpal;
39
```
40
41
**Usage Example:**
42
43
```javascript
44
const vorpal = require('vorpal')();
45
46
vorpal
47
.title('My CLI App');
48
```
49
50
### Description Configuration
51
52
Sets the description of your application.
53
54
```javascript { .api }
55
/**
56
* Sets the description of your application
57
* @param description - Description string for the application
58
* @returns Vorpal instance for chaining
59
*/
60
function description(description: string): Vorpal;
61
```
62
63
**Usage Example:**
64
65
```javascript
66
const vorpal = require('vorpal')();
67
68
vorpal
69
.description('A powerful CLI application built with Vorpal');
70
```
71
72
### Banner Configuration
73
74
Sets the banner of your application that displays when starting.
75
76
```javascript { .api }
77
/**
78
* Sets the banner of your application
79
* @param banner - Banner string to display
80
* @returns Vorpal instance for chaining
81
*/
82
function banner(banner: string): Vorpal;
83
```
84
85
**Usage Example:**
86
87
```javascript
88
const vorpal = require('vorpal')();
89
90
vorpal
91
.banner('Welcome to My CLI App v1.0.0');
92
```
93
94
### Delimiter Configuration
95
96
Sets the permanent delimiter for this Vorpal server instance.
97
98
```javascript { .api }
99
/**
100
* Sets the permanent delimiter for CLI prompt
101
* @param str - Delimiter string to display in prompt
102
* @returns Vorpal instance for chaining
103
*/
104
function delimiter(str: string): Vorpal;
105
```
106
107
**Usage Example:**
108
109
```javascript
110
const vorpal = require('vorpal')();
111
112
vorpal
113
.delimiter('myapp$')
114
.show();
115
```
116
117
## Complete Configuration Example
118
119
```javascript
120
const vorpal = require('vorpal')();
121
122
vorpal
123
.version('1.2.0')
124
.title('Data Processor CLI')
125
.description('A tool for processing and transforming data files')
126
.banner('Data Processor CLI v1.2.0 - Ready to process your data!')
127
.delimiter('dataproc$')
128
.show();
129
```