> For the complete documentation index, see [llms.txt](https://docs.pipekit.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pipekit.io/reference/cli/advanced.md).

# Advanced

For the standard install and command flow, see [Install](/reference/cli/install.md) and [Commands](/reference/cli/commands.md). This page covers patterns you'll reach for in CI, containers, or multi-account setups.

## Non-interactive login

Log in by passing credentials as arguments:

```bash
pipekit login -u username -p password
# or
pipekit login --user username --password password
```

Or via environment variables:

```bash
export PIPEKIT_USERNAME=username
export PIPEKIT_PASSWORD=password
pipekit login
```

This is the path the [Docker container](#docker-container) section and CI runners take.

## Token storage location

By default, the CLI writes the access token to `~/.pipekit/token`. Set `PIPEKIT_CONFIG_DIR` to point at a different directory; the CLI then reads and writes `$PIPEKIT_CONFIG_DIR/token`:

```bash
export PIPEKIT_CONFIG_DIR=/tmp/pipekit-ci
pipekit login -u username -p password
```

Use this when:

* Running the CLI in CI, containers, or integration tests where each invocation needs an isolated token store.
* Running multiple agents (e.g. [MCP servers](/ai/setup.md)) against different Organizations from the same host.

## Logging flags

The CLI accepts `--log-level` and `--log-format` on every command:

```bash
pipekit login --log-level=debug --log-format=json
```

| Flag           | Values                                    | Default |
| -------------- | ----------------------------------------- | ------- |
| `--log-level`  | `debug`, `info`, `warn`, `error`, `fatal` | `info`  |
| `--log-format` | `text`, `json`                            | `text`  |

JSON logging is the right choice when feeding CLI output into a log aggregator.

## Docker container

The basics of running `pipekit13/cli` are in [Install > Docker container](/reference/cli/install.md#docker-container). This section covers more involved patterns.

### Used within a workflow

Embed the CLI inside an Argo Workflow step:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: pipekit-cli
spec:
  entrypoint: main
  templates:
  - name: main
    dag:
      tasks:
        - name: pipekit-cli
          template: pipekit-cli
  - name: pipekit-cli
    env:
      - name: PIPEKIT_USERNAME
        valueFrom:
          secretKeyRef:
            name: pipekit-credentials
            key: username
      - name: PIPEKIT_PASSWORD
        valueFrom:
          secretKeyRef:
            name: pipekit-credentials
            key: password
    container:
      image: pipekit13/cli
      command:
        - sh
        - -c
        - |
          pipekit login
          pipekit list clusters
      resources:
        requests:
          memory: 10Mi
          cpu: 10m
```

### Used within another container

Copy the CLI binary into a container you control. This example adds it to a Jupyter notebook image:

```dockerfile
FROM jupyter/scipy-notebook
COPY --from=pipekit13/cli /usr/local/bin/pipekit /usr/local/bin/pipekit
```

## MCP server pointer

The CLI also hosts an MCP server. For LLM client integration, see [AI > Setup](/ai/setup.md).
