# ZLI Cheat Sheet

{% hint style="danger" %}

### <mark style="color:red;">**The BastionZero product is maintained for existing BastionZero customers only.**</mark>&#x20;

Moving forward, we are natively rebuilding BastionZero’s technology as Cloudflare’s [Access for Infrastructure](https://developers.cloudflare.com/cloudflare-one/applications/non-http/infrastructure-apps/) service.
{% endhint %}

The below are commonly used commands from the `zli`. For full details on all the `zli` commands, see the [ZLI Reference Manual](/docs/zli-reference-manual.md) or execute `zli --help` from your terminal.

| Action                                        | ZLI Command                                                                             |
| --------------------------------------------- | --------------------------------------------------------------------------------------- |
| Log in to BastionZero                         | `zli login`                                                                             |
| Log out of BastionZero                        | `zli logout`                                                                            |
| Connect to your target                        | `zli connect {user@target-name}`                                                        |
| Send zli and daemon logs to BastionZero       | `zli send-logs`                                                                         |
| Send kube or bzero target logs to BastionZero | `zli send-logs -t {target-name/id}`                                                     |
| Set the log level on an agent to be trace     | `zli agent configure {agent-name/id} loglevel trace`                                    |
| Use kubectl with BastionZero                  | `zli kube -- {your kubectl command}`                                                    |
| List targets                                  | `zli list-targets` or `zli lt`                                                          |
| List targets with full detail                 | `zli list-targets --detail` or `zli lt -d`                                              |
| List targets with target IDs                  | `zli list-targets --showId` or `zli lt -i`                                              |
| List targets of a specific type               | `zli lt -t {target-type}`, use `zli lt -t --help` for additional details                |
| List connections                              | `zli list-connections` or `zli lc`                                                      |
| List policies                                 | `zli policy list`                                                                       |
| List policies of a specific type              | `zli policy list -t {policy-type}`, use `zli policy list --help` for additional details |
| List the organization's BastionZero users     | `zli policy users`                                                                      |
| List the organization's SSO groups            | `zli policy groups`                                                                     |
| Check if you have active daemons running      | `zli status`                                                                            |
| Disconnect from all active daemons            | `zli disconnect`                                                                        |
| Disconnect from daemon of specific type       | `zli disconnect {type}`, use `zli disconnect --help` for additional details             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bastionzero.com/docs/user-guide/zli-cheat-sheet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
