# Installation
This guide covers the different ways to install the Datalab CLI.
## Requirements
- **Rust**: Version 1.70 or later (for building from source)
- **Operating System**: Linux, macOS, or Windows
---
## Install from Cargo (Recommended)
If you have Rust installed, the easiest way to install is via Cargo:
```bash
cargo install datalab
```
This installs the `datalab` binary to `~/.cargo/bin/`.
!!! tip "Add Cargo bin to PATH"
Make sure `~/.cargo/bin` is in your PATH:
```bash
export PATH="$HOME/.cargo/bin:$PATH"
```
---
## Build from Source
Clone the repository and build:
```bash
git clone https://github.com/datalab/datalab-cli
cd datalab-cli
cargo build --release
```
The binary will be at `target/release/datalab`.
### Install system-wide
=== "Linux/macOS"
```bash
sudo cp target/release/datalab /usr/local/bin/
```
=== "Windows"
Copy `target\release\datalab.exe` to a directory in your PATH.
---
## Verify Installation
Check that the CLI is installed correctly:
```bash
datalab --version
```
Expected output:
```
datalab 0.1.0
```
Get help:
```bash
datalab --help
```
---
## Install Man Pages
Man pages are generated during the build process. To install them:
=== "Linux"
```bash
# Find the generated man pages
ls target/release/build/datalab-*/out/man/
# Install to system man directory
sudo cp target/release/build/datalab-*/out/man/*.1 /usr/local/share/man/man1/
# Update man database
sudo mandb
```
=== "macOS"
```bash
# Install to local man directory
cp target/release/build/datalab-*/out/man/*.1 /usr/local/share/man/man1/
```
After installation, you can view man pages:
```bash
man datalab
man datalab-convert
man datalab-extract
```
---
## Updating
To update to the latest version:
=== "Cargo"
```bash
cargo install datalab --force
```
=== "From Source"
```bash
cd datalab-cli
git pull
cargo build --release
```
---
## Uninstalling
=== "Cargo"
```bash
cargo uninstall datalab
```
=== "Manual"
```bash
# Remove binary
rm /usr/local/bin/datalab
# Remove man pages
rm /usr/local/share/man/man1/datalab*.1
# Remove cache (optional)
rm -rf ~/.cache/datalab
```
---
## Next Steps
- [Set up your API key](configuration.md)
- [Follow the quickstart guide](quickstart.md)