0
# CLI Usage
1
2
Command-line interface for interactive and automated dependency management. The CLI provides a comprehensive set of options for checking, updating, and managing package dependencies.
3
4
## Command Syntax
5
6
```bash { .api }
7
taze [mode] [options]
8
```
9
10
## Update Modes
11
12
Specify the maximum level of version updates to consider:
13
14
```bash { .api }
15
# Available modes
16
taze default # Respect existing version ranges (safe, default behavior)
17
taze major # Allow major version updates (breaking changes)
18
taze minor # Allow minor version updates (new features)
19
taze patch # Allow patch version updates (bug fixes only)
20
taze latest # Update to latest stable version
21
taze newest # Update to newest version (including pre-release)
22
taze next # Update to next version tag
23
```
24
25
**Usage Examples:**
26
27
```bash
28
# Check for updates within existing ranges
29
taze
30
31
# Check for major updates (including breaking changes)
32
taze major
33
34
# Check only for patch updates (bug fixes)
35
taze patch
36
```
37
38
## Core Options
39
40
### Directory and Search Options
41
42
```bash { .api }
43
--cwd, -C <cwd> # Specify current working directory
44
--recursive, -r # Recursively search for package.json in subdirectories
45
--ignore-paths <paths> # Ignore specific paths during recursive search
46
--ignore-other-workspaces # Ignore package.json files in other workspaces (default: true)
47
```
48
49
### Dependency Filtering Options
50
51
```bash { .api }
52
--include, -n <deps> # Only check specified dependencies (comma-separated)
53
--exclude, -x <deps> # Exclude specific dependencies (comma-separated, overrides --include)
54
--include-locked, -l # Include locked dependencies and devDependencies
55
--peer # Include peerDependencies in the update process
56
```
57
58
### Update and Write Options
59
60
```bash { .api }
61
--write, -w # Write changes to package.json files
62
--interactive, -I # Interactive mode for selective updates
63
--install, -i # Run package manager install after updating
64
--update, -u # Run package manager update after updating
65
```
66
67
### Display and Output Options
68
69
```bash { .api }
70
--all, -a # Show all packages, including up-to-date ones
71
--sort <type> # Sort by update urgency (diff-asc, diff-desc, name-asc, name-desc)
72
--group # Group dependencies by source (dependencies, devDependencies, etc.)
73
--timediff # Show time difference between current and updated versions (default: enabled)
74
--nodecompat # Show package compatibility with current Node.js version (default: enabled)
75
```
76
77
### Logging and Control Options
78
79
```bash { .api }
80
--loglevel <level> # Set log level (debug, info, warn, error, silent)
81
--silent, -s # Complete silent mode (equivalent to --loglevel silent)
82
--fail-on-outdated # Exit with code 1 if outdated dependencies are found
83
--force, -f # Force fetching from server, bypass cache
84
```
85
86
### Global Package Management
87
88
```bash { .api }
89
--global, -g # Update global packages instead of local ones
90
```
91
92
## Common Usage Patterns
93
94
### Basic Workflows
95
96
```bash
97
# Check for updates (read-only)
98
taze
99
100
# Check and write updates interactively
101
taze -I -w
102
103
# Check for minor updates and install automatically
104
taze minor -w -i
105
106
# Recursively check monorepo with interactive updates
107
taze -r -I -w
108
```
109
110
### Advanced Filtering
111
112
```bash
113
# Only check React ecosystem packages
114
taze -n "react,react-dom,@types/react" -w
115
116
# Exclude testing libraries from updates
117
taze -x "jest,vitest,@testing-library/*" -w
118
119
# Update only TypeScript type packages
120
taze -n "@types/*" minor -w
121
```
122
123
### CI/CD Integration
124
125
```bash
126
# Check for outdated dependencies in CI (fail build if found)
127
taze --fail-on-outdated --silent
128
129
# Generate update report without writing changes
130
taze major --all --sort diff-desc
131
132
# Force cache refresh in CI environment
133
taze --force --loglevel warn
134
```
135
136
### Monorepo Management
137
138
```bash
139
# Recursively check all packages in monorepo
140
taze -r
141
142
# Update workspace root and all packages
143
taze -r -w --include-locked
144
145
# Interactive updates across entire monorepo
146
taze -r -I -w --group
147
```
148
149
### Global Package Management
150
151
```bash
152
# Check global packages
153
taze -g
154
155
# Update global packages interactively
156
taze -g -I -w
157
158
# Update specific global packages
159
taze -g -n "typescript,@angular/cli" -w
160
```
161
162
## Configuration Files
163
164
Taze supports configuration files for persistent settings:
165
166
### .tazerc.json
167
168
```json
169
{
170
"mode": "minor",
171
"recursive": true,
172
"include": ["react*", "@types/*"],
173
"exclude": ["legacy-*"],
174
"write": false,
175
"interactive": true,
176
"sort": "diff-desc",
177
"group": true
178
}
179
```
180
181
### taze.config.js
182
183
```javascript
184
export default {
185
mode: "patch",
186
recursive: true,
187
depFields: {
188
dependencies: true,
189
devDependencies: true,
190
peerDependencies: false
191
},
192
packageMode: {
193
"react": "minor",
194
"typescript": "patch"
195
}
196
};
197
```
198
199
## Interactive Mode
200
201
When using `--interactive` or `-I`, Taze provides a rich interactive interface:
202
203
### Features
204
- **Checkbox selection**: Use space to toggle individual dependencies
205
- **Bulk actions**: Select/deselect all with keyboard shortcuts
206
- **Filtering**: Search and filter dependencies by name or type
207
- **Preview**: See exactly what changes will be made before writing
208
- **Grouping**: Dependencies organized by type (deps, devDeps, etc.)
209
210
### Keyboard Controls
211
- `↑/↓`: Navigate between dependencies
212
- `Space`: Toggle selection
213
- `a`: Select all
214
- `i`: Invert selection
215
- `Enter`: Apply selected changes
216
- `q/Esc`: Quit without changes
217
218
## Exit Codes
219
220
```bash { .api }
221
0 # Success, no outdated dependencies or updates applied successfully
222
1 # Outdated dependencies found (when using --fail-on-outdated)
223
1 # Error occurred during execution
224
```
225
226
## Environment Variables
227
228
```bash { .api }
229
DEBUG=taze:* # Enable debug logging for all Taze operations
230
NO_COLOR=1 # Disable colored output
231
FORCE_COLOR=1 # Force colored output even in non-TTY environments
232
```
233
234
## Package Manager Integration
235
236
Taze automatically detects and works with different package managers:
237
238
### npm
239
```bash
240
# Taze will use npm commands when package-lock.json is present
241
taze -w -i # Runs 'npm install' after updates
242
```
243
244
### yarn
245
```bash
246
# Taze will use yarn commands when yarn.lock is present
247
taze -w -u # Runs 'yarn upgrade' after updates
248
```
249
250
### pnpm
251
```bash
252
# Taze will use pnpm commands when pnpm-lock.yaml is present
253
taze -w -i # Runs 'pnpm install' after updates
254
```
255
256
## Examples with Output
257
258
### Standard Check
259
```bash
260
$ taze
261
┌─────────────────────────────────────────────────────────────┐
262
│ Dependencies │
263
├─────────────────┬─────────────┬─────────────┬──────────────┤
264
│ Name │ Current │ Wanted │ Latest │
265
├─────────────────┼─────────────┼─────────────┼──────────────┤
266
│ typescript │ ^4.9.5 │ ^5.2.2 │ 5.2.2 │
267
│ @types/node │ ^18.0.0 │ ^18.17.5 │ 18.17.5 │
268
└─────────────────┴─────────────┴─────────────┴──────────────┘
269
```
270
271
### Interactive Mode
272
```bash
273
$ taze -I
274
┌─────────────────────────────────────────────────────────────┐
275
│ Interactive Updates │
276
├─────────────────┬─────────────┬─────────────┬──────────────┤
277
│ ☐ typescript │ ^4.9.5 │ ^5.2.2 │ 5.2.2 │
278
│ ☑ @types/node │ ^18.0.0 │ ^18.17.5 │ 18.17.5 │
279
└─────────────────┴─────────────┴─────────────┴──────────────┘
280
281
Use ↑/↓ to navigate, Space to select, Enter to apply
282
```