
import { Tabs, TabItem } from '@astrojs/starlight/components';

## Prerequisites

Bulker requires a container engine to run commands. Install one before proceeding:

- **Docker**: [docs.docker.com/get-docker](https://docs.docker.com/get-docker/) — works on Linux, macOS, and Windows (WSL2).
- **Apptainer**: [apptainer.org/docs](https://apptainer.org/docs/user/latest/quick_start.html) — preferred on HPC clusters; formerly known as Singularity.

Bulker auto-detects whichever engine is available at runtime. If both are installed, you can specify one explicitly (see the Optional: customize config section below).

<Tabs>
  <TabItem label="Quick install">
    ```bash
    curl -sL https://bulker.io/install.sh | bash
    ```

    Downloads the binary to `~/.local/bin/bulker` and adds the shell function to your `~/.bashrc` or `~/.zshrc`. Restart your shell or `source ~/.bashrc` after installing.
  </TabItem>

  <TabItem label="Linux x86_64">
    ```bash
    curl -sL https://github.com/databio/bulkers/releases/latest/download/bulker-Linux-musl-x86_64.tar.gz | tar xz && mv bulker ~/.local/bin/
    ```

    Then add the shell function to your RC file:

    <Tabs>
      <TabItem label="Bash">
        Add to `~/.bashrc`:
        ```bash
        eval "$(bulker init-shell bash)"
        ```
      </TabItem>
      <TabItem label="Zsh">
        Add to `~/.zshrc`:
        ```bash
        eval "$(bulker init-shell zsh)"
        ```
      </TabItem>
    </Tabs>
  </TabItem>

  <TabItem label="Linux aarch64">
    ```bash
    curl -sL https://github.com/databio/bulkers/releases/latest/download/bulker-Linux-musl-arm64.tar.gz | tar xz && mv bulker ~/.local/bin/
    ```

    Then add the shell function to your RC file:

    <Tabs>
      <TabItem label="Bash">
        Add to `~/.bashrc`:
        ```bash
        eval "$(bulker init-shell bash)"
        ```
      </TabItem>
      <TabItem label="Zsh">
        Add to `~/.zshrc`:
        ```bash
        eval "$(bulker init-shell zsh)"
        ```
      </TabItem>
    </Tabs>
  </TabItem>

  <TabItem label="macOS Apple Silicon">
    ```bash
    curl -sL https://github.com/databio/bulkers/releases/latest/download/bulker-macOS-arm64.tar.gz | tar xz && mv bulker ~/.local/bin/
    ```

    Then add the shell function to your RC file:

    ```bash
    eval "$(bulker init-shell zsh)"
    ```

    Add this line to `~/.zshrc`.
  </TabItem>

  <TabItem label="macOS Intel">
    ```bash
    curl -sL https://github.com/databio/bulkers/releases/latest/download/bulker-macOS-x86_64.tar.gz | tar xz && mv bulker ~/.local/bin/
    ```

    Then add the shell function to your RC file:

    ```bash
    eval "$(bulker init-shell zsh)"
    ```

    Add this line to `~/.zshrc`.
  </TabItem>

  <TabItem label="Build from source">
    ```bash
    git clone https://github.com/databio/bulkers
    cd bulkers
    cargo build --release
    ./install.sh
    ```

    The install script adds the shell function automatically.
  </TabItem>
</Tabs>

## Verify installation

```bash
bulker --version
bulker crate list
```

## Migrating from Python bulker

```bash
# Remove the Python version
pip uninstall bulker

# Install bulker (your existing crates and config are compatible)
curl -sL https://bulker.io/install.sh | bash
```

Your existing crate manifests work with both versions — no changes needed.

## Optional: customize config

Bulker works out of the box with no configuration. On first use, it auto-detects your container engine and creates `~/.config/bulker/bulker_config.yaml` with sensible defaults.

To explicitly (re)generate the config or choose a specific engine:

<Tabs>
  <TabItem label="Auto-detect">
    ```bash
    bulker config init
    ```
  </TabItem>
  <TabItem label="Docker">
    ```bash
    bulker config init -e docker
    ```
  </TabItem>
  <TabItem label="Apptainer">
    ```bash
    bulker config init -e apptainer
    ```
  </TabItem>
</Tabs>

Use `--force` to overwrite an existing config. See the [Configuration reference](/docs/reference/configuration/) for all settings.

## Uninstall

```bash
# Remove the binary
rm ~/.local/bin/bulker

# Remove config and cached manifests
rm -rf ~/.config/bulker

# Remove the shell function line from your RC file
# Delete the `eval "$(bulker init-shell ...)"` line from ~/.bashrc or ~/.zshrc
```

## Next Steps

Now that you have bulker installed, follow the [Tutorial](/docs/getting-started/tutorial/) to see bulker in action with practical examples.
