> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siftstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sift CLI setup

> Install, configure, and run the Sift CLI to import and export telemetry from the command line.

The Sift CLI is a command-line tool for moving telemetry in and out of Sift without writing code.

Use the CLI when you want to:

* Import CSV, Parquet, TDMS, HDF5, and ULog files from a terminal or a script.
* Export Run and Asset data to CSV, Parquet, or Sun (WinPlot) format.
* Verify API credentials and connectivity.

The binary is named `sift-cli` (formerly `sift_cli`). It is a standalone command-line tool, distinct from the `sift_client` Python client library.

<Note>
  For every command, flag, and supported value, see the [Sift CLI reference](/documentation/reference/cli-reference).
</Note>

## Install the CLI

<Tabs>
  <Tab title="Unix">
    ```bash theme={null}
    curl --proto '=https' --tlsv1.2 -LsSf https://api.siftstack.com/install/sift-cli | sh
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell theme={null}
    powershell -ExecutionPolicy Bypass -c "irm https://api.siftstack.com/install/sift-cli.ps1 | iex"
    ```
  </Tab>
</Tabs>

<Note>
  For Sift GovCloud, replace `api.siftstack.com` with `api.gov.siftstack.com`.

  To install a specific version, append the version number without a `v` prefix. For example, use `https://api.siftstack.com/install/sift-cli/0.5.0`.
</Note>

## Configure a profile

The CLI reads connection settings from a `sift.toml` config file stored in your user data directory. Each profile holds a gRPC endpoint, a REST endpoint, an API key, and the URL of your Sift web app.

<Steps>
  <Step title="Create the config file">
    ```bash theme={null}
    sift-cli config create
    ```

    This command fails if a config file already exists.
  </Step>

  <Step title="Set the default profile">
    Obtain the gRPC and REST base URLs and an API key from the Sift UI. See [Set up API access](/documentation/manage/set-up-api-access).

    ```bash theme={null}
    sift-cli config update \
      --grpc-uri $SIFT_GRPC_URI \
      --rest-uri $SIFT_REST_URI \
      --api-key $SIFT_API_KEY \
      --app-uri $SIFT_APP_URI
    ```

    `--app-uri` is the URL of your Sift web app, such as `https://app.siftstack.com` or `https://gov.siftstack.com`. Set it so that `sift-cli import` prints an Explore link for the data it uploads. A custom or on-premises deployment requires it.
  </Step>

  <Step title="Confirm the configuration">
    ```bash theme={null}
    sift-cli config show
    ```

    To print the path to the config file instead, run `sift-cli config where`.
  </Step>
</Steps>

To enter values through prompts instead of flags, use the interactive flag:

```bash theme={null}
sift-cli config update --interactive
```

Commands run against the `default` profile unless you pass `--profile <name>`. The `--profile` flag is global and applies to any command.

```bash theme={null}
sift-cli ping --profile mission
```

<Note>
  To connect to a non-cloud Sift environment that does not use TLS, pass the global `--disable-tls` flag.
</Note>

## Manage multiple environments

If you connect to more than one environment, each environment requires its own API key; the REST and gRPC URIs are shared across environments in the same account. Create a separate key for each environment, and use the matching key when you authenticate a request against that environment.

To manage this from the CLI, create a separate profile for each environment. Reuse the same gRPC endpoint, REST endpoint, and app URI as your default profile, and set the API key for the new environment:

```bash theme={null}
sift-cli config update --profile mission \
  --grpc-uri $SIFT_GRPC_URI \
  --rest-uri $SIFT_REST_URI \
  --app-uri $SIFT_APP_URI \
  --api-key $SIFT_ENVIRONMENT_API_KEY
```

`config update` creates the profile if it doesn't already exist. Pass `--profile <name>` to any command to run it against that environment:

```bash theme={null}
sift-cli ping --profile mission
```

## Verify connectivity

Confirm that your profile's credentials and endpoint work:

```bash theme={null}
sift-cli ping
```

The command pings the Sift API and prints the response.

## Import and export data

The CLI's primary workflows are file import and data export:

<CardGroup cols={2}>
  <Card title="Import files" icon="file-import" href="/documentation/cli/import-files-with-the-sift-cli">
    Import CSV, Parquet, TDMS, HDF5, ULog, and backup files into an Asset.
  </Card>

  <Card title="Export data" icon="file-export" href="/documentation/cli/export-data-with-the-sift-cli">
    Export Run or Asset data, including Calculated Channels, to a file.
  </Card>
</CardGroup>

For every command, flag, and supported value, see the [Sift CLI reference](/documentation/reference/cli-reference).

## Install shell completions

Install command autocompletions for your current shell, then restart the shell:

```bash theme={null}
sift-cli install completions update
```

To print completions for a specific shell instead of installing them, name the shell:

```bash theme={null}
sift-cli install completions print --shell zsh
```

If you omit `--shell`, the CLI infers the shell from the `$SHELL` environment variable.

## Serve the docs locally

Serve the CLI's bundled documentation over HTTP:

```bash theme={null}
sift-cli doc
```

The server binds to `0.0.0.0:3000` by default. To bind a different address, pass `--addr`:

```bash theme={null}
sift-cli doc --addr 127.0.0.1:8080
```
