# PKI Client — Installation Guide

## Quick install (recommended)

```bash
curl -fsSL https://raw.githubusercontent.com/rayketcham-lab/PKI-Client/main/install.sh | sudo bash
```

This downloads the latest release binary and installs it to `/usr/local/bin/pki`.

## Manual install

### Download

Get the latest release from [GitHub Releases](https://github.com/rayketcham-lab/PKI-Client/releases):

```bash
# Download
curl -LO https://github.com/rayketcham-lab/PKI-Client/releases/latest/download/pki-linux-x86_64.tar.gz

# Verify checksum
curl -LO https://github.com/rayketcham-lab/PKI-Client/releases/latest/download/SHA256SUMS.txt
sha256sum -c SHA256SUMS.txt

# Install
tar xzf pki-linux-x86_64.tar.gz
sudo mv pki /usr/local/bin/pki
sudo chmod +x /usr/local/bin/pki
```

### Verify installation

```bash
pki --version
# pki 0.7.0

pki --help
```

## Build from source

### Prerequisites

- Rust 1.80+ (stable)
- cmake (for aws-lc-sys)

### Standard build

```bash
git clone https://github.com/rayketcham-lab/PKI-Client.git
cd PKI-Client
cargo build --release
sudo cp target/release/pki /usr/local/bin/pki
```

### With post-quantum support

```bash
cargo build --release --features pqc
```

### Static binary (musl)

```bash
rustup target add x86_64-unknown-linux-musl
sudo apt-get install -y musl-tools
cargo build --release --target x86_64-unknown-linux-musl
```

## Shell completions

```bash
# Bash
pki completions bash | sudo tee /etc/bash_completion.d/pki > /dev/null

# Zsh
pki completions zsh > ~/.zsh/completions/_pki

# Fish
pki completions fish > ~/.config/fish/completions/pki.fish
```

## Man pages

```bash
sudo mkdir -p /usr/local/share/man/man1
pki manpages /usr/local/share/man/man1/
sudo mandb
```

## Platform support

| Platform | Architecture | Status |
|----------|-------------|--------|
| Ubuntu 18.04+ | x86_64 | Supported |
| Rocky Linux / RHEL 8+ | x86_64 | Supported |
| Debian 10+ | x86_64 | Supported |
| Amazon Linux 2+ | x86_64 | Supported |
| Alpine Linux 3.12+ | x86_64 | Supported (musl native) |

## Uninstall

```bash
sudo rm /usr/local/bin/pki
sudo rm -f /etc/bash_completion.d/pki
sudo rm -f /usr/local/share/man/man1/pki*.1
```
