zackstrap 1.0.4

A CLI tool to bootstrap project configuration files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# Zackstrap

[![CI/CD Pipeline](https://github.com/zackkitzmiller/zackstrap/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/zackkitzmiller/zackstrap/actions/workflows/ci.yml)
[![Test Coverage](https://codecov.io/gh/zackkitzmiller/zackstrap/graph/badge.svg?token=LL69KNNRL0)](https://codecov.io/gh/zackkitzmiller/zackstrap)
[![Crates.io](https://img.shields.io/crates/v/zackstrap.svg)](https://crates.io/crates/zackstrap)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A powerful Rust CLI tool to bootstrap project configuration files. Quickly generate common project configuration files like `.editorconfig`, `.prettierrc`, and Ruby-specific configurations.

## Features

- ๐Ÿš€ **Fast**: Built in Rust for blazing-fast performance
- ๐ŸŽฏ **Smart**: Automatically detects project types and generates appropriate configs
- ๐Ÿ”’ **Safe**: Built-in safety checks and error handling
- ๐ŸŽจ **Beautiful**: Colored output and progress indicators
- ๐Ÿงช **Tested**: Comprehensive test coverage
- ๐Ÿ” **Auto-detection**: Automatically detects Ruby projects and generates appropriate configs
- ๐ŸŽฏ **Interactive**: Guided setup with user prompts
- ๐ŸŽจ **Templates**: Multiple configuration templates for different coding styles
- ๐Ÿ‘€ **Dry Run**: Preview what would be created without actually creating files

## Installation

### From Source

```bash
git clone https://github.com/zackkitzmiller/zackstrap.git
cd zackstrap
cargo build --release
cargo install --path .
```

### Using Cargo

```bash
cargo install zackstrap
```

## Usage

### Basic Project Configuration

Generate basic configuration files (`.editorconfig`, `.prettierrc`):

```bash
zackstrap basic
```

### Ruby Project Configuration

Generate Ruby-specific configuration files:

```bash
zackstrap ruby
```

This will create:

```md
- .editorconfig
- .prettierrc
- .ruby-version (set to 3.3.0)
- .node-version (set to 24)
- .rubocop.yml (comprehensive configuration)
- package.json (with prettier-plugin-ruby)
```

### Python Project Configuration

Generate Python-specific configuration files:

```bash
zackstrap python
```

This will create:

```bash
- .editorconfig
- .prettierrc
- .python-version (set to 3.12)
- pyproject.toml (with black, flake8, mypy)
- .flake8 configuration
- requirements-dev.txt
- justfile with Python development tasks
```

### Node.js Project Configuration

Generate Node.js-specific configuration files:

```bash
zackstrap node
```

This will create:

```bash
- .editorconfig
- .prettierrc
- .nvmrc (set to Node.js 20)
- .eslintrc.js (ESLint configuration)
- package.json (with development dependencies)
- justfile with Node.js development tasks
```

### Go Project Configuration

Generate Go-specific configuration files:

```bash
zackstrap go
```

This will create:

```bash
- .editorconfig
- .prettierrc
- go.mod (Go module file)
- .golangci.yml (golangci-lint configuration)
- .gitignore additions for Go
- justfile with Go development tasks
```

### Rust Project Configuration

Generate Rust-specific configuration files:

```bash
zackstrap rust
```

This will create:

```bash
- .editorconfig
- .prettierrc
- rustfmt.toml (Rust formatting configuration)
- .clippy.toml (Clippy linting configuration)
- .cargo/config.toml (Cargo configuration)
- justfile with Rust development tasks
```

### Force Overwrite

Use the `--force` flag to overwrite existing files:

```bash
zackstrap basic --force
zackstrap ruby --force
```

### Target Directory

Specify a different target directory:

```bash
zackstrap basic --target /path/to/project
zackstrap ruby --target /path/to/project
```

### List Available Configurations

See what configuration files are available:

```bash
zackstrap list
```

### Auto-Detection

Automatically detect project type and generate appropriate configs:

```bash
zackstrap auto
```

### Interactive Mode

Guided setup with user prompts:

```bash
zackstrap interactive
```

### Template System

Use different configuration templates:

```bash
# Basic projects with different styles
zackstrap basic --template google
zackstrap basic --template airbnb

# Ruby projects with framework-specific configs
zackstrap ruby --template rails
zackstrap ruby --template sinatra
zackstrap ruby --template gem

# Python projects with framework-specific configs
zackstrap python --template django
zackstrap python --template flask

# Node.js projects with framework-specific configs
zackstrap node --template express
zackstrap node --template react

# Go projects with project type configs
zackstrap go --template web
zackstrap go --template cli

# Rust projects with project type configs
zackstrap rust --template web
zackstrap rust --template cli
```

### Dry Run Mode

Preview what would be created without actually creating files:

```bash
# Note: --dry-run must come BEFORE the subcommand
zackstrap --dry-run basic
zackstrap --dry-run ruby --template rails
zackstrap --dry-run auto
```

## Generated Files

### Basic Projects

- `.editorconfig` - Multi-language editor configuration
- `.prettierrc` - Prettier formatting rules
- `justfile` - Project automation and development tasks

### Ruby Projects (includes basic +)

- `.ruby-version` - Ruby 3.3.0
- `.node-version` - Node.js 24
- `.rubocop.yml` - Comprehensive Ruby linting
- `package.json` - With `prettier-plugin-ruby`
- `justfile` - Ruby-specific automation tasks

### Python Projects (includes basic +)

- `.python-version` - Python 3.12
- `pyproject.toml` - Project configuration with black, flake8, mypy
- `.flake8` - Flake8 linting configuration
- `requirements-dev.txt` - Development dependencies
- `justfile` - Python-specific automation tasks

### Node.js Projects (includes basic +)

- `.nvmrc` - Node.js 20
- `.eslintrc.js` - ESLint configuration
- `package.json` - With development dependencies
- `justfile` - Node.js-specific automation tasks

### Go Projects (includes basic +)

- `go.mod` - Go module file
- `.golangci.yml` - golangci-lint configuration
- `.gitignore` - Go-specific ignore patterns
- `justfile` - Go-specific automation tasks

### Rust Projects (includes basic +)

- `rustfmt.toml` - Rust formatting configuration
- `.clippy.toml` - Clippy linting configuration
- `.cargo/config.toml` - Cargo configuration
- `justfile` - Rust-specific automation tasks

## Configuration Files

### .editorconfig

- Root settings for consistent coding style
- File-specific overrides for Ruby, JavaScript, TypeScript
- UTF-8 encoding, LF line endings
- 2-space indentation

### .prettierrc

- Semi-colons enabled
- Single quotes
- 2-space tab width
- 80 character print width
- ES5 trailing comma style

**Templates available:**

- **default**: Standard configuration
- **google**: Google style (double quotes, 80 char width)
- **airbnb**: Airbnb style (single quotes, 100 char width)

### .ruby-version

- Set to Ruby 3.3.0 (latest stable)

### .node-version

- Set to Node.js 24 (latest LTS)

### .rubocop.yml

- Comprehensive Ruby linting rules
- RSpec-specific configurations
- Performance and security checks
- Bundler integration

**Templates available:**

- **default**: Standard Ruby configuration
- **rails**: Rails-specific rules and exclusions
- **sinatra**: Lightweight Sinatra configuration
- **gem**: Gem development with stricter rules

### package.json

- Prettier with Ruby plugin
- Development dependencies only

**Templates available:**

- **default**: Basic Ruby project setup
- **rails**: Rails app with ESLint and additional tools
- **sinatra**: Sinatra app setup
- **gem**: Gem development with RSpec

### Python Configuration Files

#### .python-version

- Set to Python 3.12 (latest stable)

#### pyproject.toml

- Black formatting configuration (88 char width)
- Flake8 linting configuration
- MyPy type checking configuration
- Pytest configuration

**Templates available:**

- **default**: Standard Python configuration
- **django**: Django-specific settings and stubs
- **flask**: Flask app configuration

#### .flake8

- 88 character line length (compatible with Black)
- Extended ignore patterns for common issues

#### requirements-dev.txt

- Black (code formatter)
- Flake8 (linter)
- MyPy (type checker)
- Pytest (testing framework)

### Node.js Configuration Files

#### .nvmrc

- Set to Node.js 20 (LTS version)

#### .eslintrc.js

- ES2022 environment support
- Recommended ESLint rules
- Framework-specific configurations

**Templates available:**

- **default**: Standard Node.js configuration
- **express**: Express.js with console logging allowed
- **react**: React with JSX support and relaxed prop-types

#### package.json

- ESLint and Prettier development dependencies
- Framework-specific dependencies based on template

### Go Configuration Files

#### go.mod

- Go 1.21 module configuration
- Project module name

#### .golangci.yml

- golangci-lint configuration
- Common linters enabled (gofmt, golint, govet, errcheck)
- 5-minute timeout for large projects

#### .gitignore

- Go-specific ignore patterns
- Binary files, test files, and workspace files

### Rust Configuration Files

#### rustfmt.toml

- Rust 2021 edition
- 100 character line width

#### .clippy.toml

- Clippy linting configuration
- Customizable rules and settings

#### .cargo/config.toml

- Cargo build configuration
- Native CPU optimization flags

### justfile

- Project automation and development tasks
- Common development commands for all languages
- Language-specific commands and workflows
- Framework-specific commands and tasks

**Templates available:**

- **Basic**: Standard development tasks (build, test, format, lint)
- **Ruby**: Ruby development with bundler and tools
  - **Rails**: Rails-specific commands (server, console, routes, db)
  - **Sinatra**: Sinatra development commands
  - **Gem**: Gem development and release commands
- **Python**: Python development with virtual environments
  - **Django**: Django-specific commands (server, migrate, shell)
  - **Flask**: Flask development commands
- **Node.js**: Node.js development with npm/yarn
  - **Express**: Express.js development commands
  - **React**: React development and build commands
- **Go**: Go development with go commands
  - **Web**: Web application commands
  - **CLI**: Command-line application commands
- **Rust**: Rust development with cargo
  - **Web**: Web application commands
  - **CLI**: Command-line application commands

## Development

### Prerequisites

- Rust 1.70+
- Cargo

### Building

```bash
cargo build
```

### Testing

```bash
cargo test
```

### Running

```bash
cargo run -- basic
cargo run -- ruby
```

## Project Structure

```bash
zackstrap/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.rs           # CLI entry point
โ”‚   โ”œโ”€โ”€ lib.rs               # Library exports
โ”‚   โ”œโ”€โ”€ config.rs         # Configuration structures
โ”‚   โ”œโ”€โ”€ error.rs           # Error handling
โ”‚   โ””โ”€โ”€ generators.rs  # File generation logic
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ integration_tests.rs
โ”œโ”€โ”€ Cargo.toml
โ””โ”€โ”€ README.md
```

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests
5. Run the test suite
6. Submit a pull request

## License

MIT License - see LICENSE file for details.

## Author

Zack Kitzmiller - [GitHub](https://github.com/zackkitzmiller)