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

# CLI

This page describes the Lenses CLI

{% hint style="danger" %}
The Lenses 5.x CLI is incompatible with Lenses 6.x
{% endhint %}

A new CLI for HQ is available [here](https://archive.lenses.io/lenses/6.1/). To view the available commands run

{% code title="terminal" %}

```sh
docker run -it lensesio/lenses-cli:6.2 --help

Command line interface to the Lenses HQ HTTP API.

Usage:
  lenses [command]

Available Commands:
  agent            Command line interface to the agent.
  api              API meta information.
  completion       Generate the autocompletion script for the specified shell
  config           Manage CLI configuration.
  environments     Manage Environments.
  groups           Manage Groups.
  help             Help about any command
  misc             Miscellaneous commands.
  roles            Manage Roles.
  service-accounts Manage ServiceAccounts.
  users            Manage Users.
  utils            Bundles utility commands.
  version          Display's the cli's version

Flags:
  -a, --address string      URL to the HQ HTTP api.
  -c, --context string      Config context.
  -h, --help                help for hq
  -k, --insecure            Insecure. Disables TLS verification.
  -p, --password string     Password.
  -s, --session-id string   Session ID (cookie auth).
  -t, --token string        Auth (bearer) token of a service account.
  -u, --username string     Username.
  -v, --verbose             Verbose; log to stderr.
  -w, --verboser            Verboser; log raw http traffic to stderr.

Use "lenses [command] --help" for more information about a command.
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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 following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lenses.io/latest/resources/cli.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
