# 🌊 HADEX Shell Completion

HADEX provides shell completion for bash, zsh, and fish shells.

---

## Installation

### Bash
```bash
eval "$(_HADEX_COMPLETE=bash_source hadex)"
```

Zsh

```zsh
eval "$(_HADEX_COMPLETE=zsh_source hadex)"
```

Fish

```fish
eval (env _HADEX_COMPLETE=fish_source hadex)
```

---

Available Commands

Core Commands

Command Description
hadex monitor Real-time hadal zone monitoring
hadex pressure Calculate pressure at depth
hadex density Compute seawater density (Tait equation)
hadex acoustic Calculate sound velocity (Mackenzie equation)
hadex navigate Swarm navigation commands
hadex energy Piezoelectric energy harvesting status
hadex dashboard Launch interactive dashboard
hadex trenches List hadal trenches

Parameter Commands

```bash
hadex monitor hcr          # Hydrostatic Compression
hadex monitor nac          # Acoustic Refraction Index
hadex monitor oflux        # Benthic Oxygen Flux
hadex monitor peh          # Piezoelectric Energy Harvest
hadex monitor ttc          # Turbidity Current Transport
hadex monitor cbl          # Chemiluminescent Mapping
hadex monitor hts          # Thermocline Stability
hadex monitor apd          # Autonomous Position Drift
hadex monitor sei          # Composite Hadal Index
```

Trench Commands

```bash
hadex trenches list                                   # List all 27 hadal trenches
hadex trenches show --name "Mariana"                  # Show trench details
hadex trenches compare --t1 "Mariana" --t2 "Tonga"    # Compare two trenches
hadex trenches region --depth 10000                    # Filter by depth (>10,000m)
```

Depth Calculations

```bash
hadex pressure --depth 10911           # Pressure at Challenger Deep (110 MPa)
hadex density --depth 10911 --temp 2   # Density with Tait equation
hadex acoustic --depth 10911 --temp 2  # Sound velocity (1664 m/s)
hadex viscosity --depth 10911 --temp 2 # Dynamic viscosity (2.18e-3 Pa·s)
```

Swarm Navigation

```bash
hadex swarm init --vehicles 12          # Initialize 12-vehicle swarm
hadex swarm position --id all           # Get all vehicle positions
hadex swarm accuracy                    # Current navigation accuracy
hadex swarm simulate --hours 72         # Run 72-hour simulation
```

Energy Harvesting

```bash
hadex energy status                      # Current power generation
hadex energy predict --area 10 --freq 0.05 # Predict power from transducer
hadex energy harvest --duration 8        # Harvest for 8 hours
```

Alert Thresholds

```bash
hadex alert --status quiet          # SEI 95-100% ⚪
hadex alert --status caution        # SEI 80-94% 🟢
hadex alert --status watch          # SEI 60-79% 🟡
hadex alert --status warning        # SEI 40-59% 🟠
hadex alert --status critical       # SEI 0-39% 🔴
```

---

Examples

```bash
# Monitor real-time hadal conditions
hadex monitor --trench mariana --update 60

# Calculate pressure at specific depth
hadex pressure --depth 10911 --output MPa

# Run swarm navigation simulation
hadex swarm simulate --vehicles 12 --hours 72 --output json

# Check current alerts
hadex alerts --status active --severity critical

# List all trenches deeper than 10,000m
hadex trenches list --min-depth 10000 --details

# Calculate density with Tait equation
hadex density --depth 10911 --temp 1.9 --salinity 34.68

# Launch dashboard
hadex dashboard --port 8501 --map-type bathymetry

# Simulate turbidity current
hadex simulate --current-speed 1.5 --density 1050 --slope 4.2
```

---

Tab Completion Features

Trench Name Completion

· Auto-completes from 27 hadal trenches
· Groups by depth (10,000m+, 8,000-10,000m, 6,000-8,000m)

Parameter Completion

· All 8 HADEX parameters
· Parameter groups (physical, chemical, biological, navigation)

Depth Completion

· challenger-deep (10,911m)
· tonga (10,882m)
· philippine (10,540m)
· kermadec (10,047m)
· izugasaki (9,810m)
· japan (9,000m)

Alert Status Colors

· ⚪ QUIET       (SEI 95-100%)
· 🟢 CAUTION     (SEI 80-94%)
· 🟡 WATCH       (SEI 60-79%)
· 🟠 WARNING     (SEI 40-59%)
· 🔴 CRITICAL    (SEI 0-39%)

---

Environment Variables

```bash
export HADEX_CONFIG=~/.hadex/config.yaml
export HADEX_DATA_DIR=/data/hadex
export NOAA_BATHYMETRY_KEY=your_key_here
export JAMSTEC_API_KEY=your_key_here
export GEBCO_TOKEN=your_token_here
export IODP_API_KEY=your_key_here
```

---

Live Resources

· Dashboard: https://hadex.netlify.app
· Documentation: https://hadex.readthedocs.io
· GEBCO Bathymetry: https://www.gebco.net
· JAMSTEC: https://www.jamstec.go.jp
· IODP: https://www.iodp.org

---

🌊 The hadal zone is Earth's final frontier. HADEX illuminates the abyss.
