cascade-cli 0.1.152

Stacked diffs CLI for Bitbucket Server
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
# 🚀 Installation Guide

This guide covers installing Cascade CLI on different platforms and environments.

## 📋 **System Requirements**

### **Minimum Requirements**
- **Operating System**: macOS 10.15+, Linux (Ubuntu 18.04+), Windows 10+
- **Git**: Version 2.20+ installed and configured
- **Rust**: 1.82+ (for building from source)
- **Memory**: 50MB RAM minimum
- **Disk**: 100MB free space

### **Recommended Environment**
- **Bitbucket Server/Cloud** access with Personal Access Token
- **Terminal** with 256 color support
- **Shell**: bash, zsh, or fish for completions

---

## 🔧 **Installation Methods**

### **Option 1: From Source (Recommended)**

#### **Prerequisites**
```bash
# Install Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env

# Verify installation
rustc --version
cargo --version
```

#### **Build and Install**
```bash
# Clone repository
git clone https://github.com/JAManfredi/cascade-cli.git
cd cascade-cli

# Build release binary
cargo build --release

# Install to ~/.cargo/bin (automatically in PATH)
cargo install --path .

# Or manually add to PATH
export PATH="$PWD/target/release:$PATH"
echo 'export PATH="'$PWD'/target/release:$PATH"' >> ~/.bashrc
```

#### **Verify Installation**
```bash
ca --version
ca doctor  # Run health check
```

### **Option 2: Pre-built Binaries** *(Recommended)*

#### **macOS**
```bash
# Intel Macs (x64)
curl -L https://github.com/JAManfredi/cascade-cli/releases/latest/download/ca-macos-x64.tar.gz | tar -xz
sudo mv ca /usr/local/bin/

# Apple Silicon Macs (ARM64)  
curl -L https://github.com/JAManfredi/cascade-cli/releases/latest/download/ca-macos-arm64.tar.gz | tar -xz
sudo mv ca /usr/local/bin/

# Auto-detect architecture
curl -L https://github.com/JAManfredi/cascade-cli/releases/latest/download/ca-macos-$(uname -m | sed 's/x86_64/x64/;s/arm64/arm64/').tar.gz | tar -xz
sudo mv ca /usr/local/bin/
```

#### **Linux**
```bash
# x64 (Intel/AMD)
curl -L https://github.com/JAManfredi/cascade-cli/releases/latest/download/ca-linux-x64.tar.gz | tar -xz
sudo mv ca /usr/local/bin/

# ARM64
curl -L https://github.com/JAManfredi/cascade-cli/releases/latest/download/ca-linux-arm64.tar.gz | tar -xz  
sudo mv ca /usr/local/bin/

# Auto-detect architecture
curl -L https://github.com/JAManfredi/cascade-cli/releases/latest/download/ca-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz | tar -xz
sudo mv ca /usr/local/bin/
```

#### **Windows**
```powershell
# x64 (Intel/AMD)
Invoke-WebRequest -Uri "https://github.com/JAManfredi/cascade-cli/releases/latest/download/ca-windows-x64.exe.zip" -OutFile "ca.zip"
Expand-Archive -Path "ca.zip" -DestinationPath "$env:USERPROFILE\bin\"

# ARM64  
Invoke-WebRequest -Uri "https://github.com/JAManfredi/cascade-cli/releases/latest/download/ca-windows-arm64.exe.zip" -OutFile "ca.zip"
Expand-Archive -Path "ca.zip" -DestinationPath "$env:USERPROFILE\bin\"

# Add to PATH if needed
$env:PATH += ";$env:USERPROFILE\bin"
```

### **Option 3: Package Managers**

#### **macOS - Homebrew**
```bash
# Method 1: Download formula and install (works immediately)
curl -O https://raw.githubusercontent.com/JAManfredi/cascade-cli/master/homebrew/cascade-cli.rb
brew install cascade-cli.rb
rm cascade-cli.rb

# Method 2: Using tap (requires tap repository setup)
# brew tap JAManfredi/cascade-cli
# brew install cascade-cli
```

#### **Rust - Cargo**
```bash
cargo install cascade-cli
```

---

## ⚙️ **Post-Installation Setup**

### **1. Verify Installation**
```bash
# Check version
ca --version

# Run system diagnostics
ca doctor

# Test help system
ca --help
```

### **2. Shell Completions**
```bash
# Auto-detect and install for your shell
ca completions install

# Manual installation
ca completions generate bash > ~/.local/share/bash-completion/completions/ca
ca completions generate zsh > ~/.zsh/completions/_ca
ca completions generate fish > ~/.config/fish/completions/ca.fish
```

### **3. First-Time Configuration**
```bash
# Run interactive setup wizard
ca setup

# Manual configuration (if preferred)
cd your-git-repository
ca init --bitbucket-url https://bitbucket.your-company.com
```

---

## 🏢 **Enterprise/Corporate Installation**

### **Behind Corporate Firewall**
```bash
# Configure Git for corporate proxy
git config --global http.proxy http://proxy.company.com:8080
git config --global https.proxy https://proxy.company.com:8080

# Build with proxy settings
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=https://proxy.company.com:8080
cargo build --release
```

### **Custom Certificate Authority**
```bash
# Add corporate CA certificates
export SSL_CERT_FILE=/path/to/corporate-ca-bundle.crt
export SSL_CERT_DIR=/path/to/cert/directory

# Or configure in Git
git config --global http.sslCAInfo /path/to/corporate-ca-bundle.crt
```

### **Restricted Environments**
```bash
# Air-gapped installation
# 1. Download source on internet-connected machine
# 2. Transfer to target environment
# 3. Build offline

cargo build --release --offline
```

---

## 🐳 **Container Installation**

### **Docker**
```dockerfile
FROM rust:1.82 as builder
WORKDIR /app
COPY . .
RUN cargo build --release

FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y git ca-certificates
COPY --from=builder /app/target/release/ca /usr/local/bin/
ENTRYPOINT ["ca"]
```

### **Docker Usage**
```bash
# Build image
docker build -t cascade-cli .

# Run in project directory
docker run -v $(pwd):/workspace -w /workspace cascade-cli status

# Create alias for convenience
alias ca='docker run -v $(pwd):/workspace -w /workspace cascade-cli'
```

---

## 🔧 **Development Installation**

### **For Contributors**
```bash
# Clone with development dependencies
git clone https://github.com/JAManfredi/cascade-cli.git
cd cascade-cli

# Install development tools
rustup component add clippy rustfmt
cargo install cargo-watch cargo-audit

# Run in development mode
cargo run -- --help

# Auto-rebuild on changes
cargo watch -x run
```

### **IDE Setup**

#### **VS Code**
```json
{
  "rust-analyzer.cargo.allFeatures": true,
  "rust-analyzer.checkOnSave.command": "clippy"
}
```

#### **IntelliJ IDEA**
- Install Rust plugin
- Configure Cargo toolchain path
- Enable Clippy integration

---

## 🚨 **Troubleshooting**

### **Common Issues**

#### **"command not found: ca"**
```bash
# Verify PATH includes binary location
echo $PATH
which ca

# Add to PATH if missing
export PATH="$HOME/.cargo/bin:$PATH"
# Make permanent in ~/.bashrc or ~/.zshrc
```

#### **Rust compilation errors**
```bash
# Update Rust toolchain
rustup update

# Clear cargo cache
cargo clean

# Verify dependencies
cargo check
```

#### **Git integration issues**
```bash
# Verify Git installation
git --version

# Check repository status
git status

# Ensure proper Git configuration
git config --list
```

#### **Permission denied**
```bash
# Fix binary permissions
chmod +x /path/to/ca

# Install to user directory instead of system
cargo install --path . --root ~/.local
export PATH="$HOME/.local/bin:$PATH"
```

### **Platform-Specific Issues**

#### **macOS**
```bash
# Xcode Command Line Tools required
xcode-select --install

# macOS Gatekeeper issues
sudo spctl --add /usr/local/bin/ca
```

#### **Linux**
```bash
# Missing system dependencies
sudo apt update
sudo apt install build-essential git pkg-config libssl-dev

# For CentOS/RHEL
sudo yum groupinstall "Development Tools"
sudo yum install git openssl-devel
```

#### **Windows**
```powershell
# Visual Studio Build Tools required
# Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/

# WSL recommended for better experience
wsl --install
```

---

## 📊 **Performance Optimization**

### **Large Repositories**
```bash
# Increase Git performance
git config core.preloadindex true
git config core.fscache true
git config gc.auto 256

# Configure Cascade CLI
ca config set performance.cache_size 1000
ca config set performance.parallel_operations true
```

### **Network Optimization**
```bash
# Configure timeouts for slow networks
ca config set network.timeout 60
ca config set network.retry_attempts 3

# Use compression
git config core.compression 9
```

---

## 🔄 **Updating**

### **From Source**
```bash
cd cascade-cli
git pull origin main
cargo build --release
cargo install --path . --force
```

### **Package Manager Updates**
```bash
# Homebrew (after downloading new formula)
curl -O https://raw.githubusercontent.com/JAManfredi/cascade-cli/master/homebrew/cascade-cli.rb
brew upgrade cascade-cli.rb
rm cascade-cli.rb

# Cargo
cargo install cascade-cli --force
```

---

## **Uninstallation**

### **Complete Removal**
```bash
# Remove binary
rm /usr/local/bin/ca
# or
cargo uninstall cascade-cli

# Remove configuration
rm -rf ~/.cascade/

# Remove completions
rm ~/.local/share/bash-completion/completions/ca
rm ~/.zsh/completions/_ca
rm ~/.config/fish/completions/ca.fish

# Remove Git hooks (per repository)
cd your-repository
ca hooks uninstall
```

---

## 📞 **Support**

If you encounter installation issues:

1. **Check [Troubleshooting Guide]./TROUBLESHOOTING.md**
2. **Run `ca doctor` for diagnostics**
3. **Search [GitHub Issues]https://github.com/JAManfredi/cascade-cli/issues**
4. **Create new issue with system details**

### **System Information for Bug Reports**
```bash
# Gather system info
ca doctor --verbose
rustc --version
git --version
uname -a  # Linux/macOS
systeminfo  # Windows
```