> For the complete documentation index, see [llms.txt](https://docs.apono.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apono.io/docs/access-requests-and-approvals/cli/access-a-resource-from-the-cli.md).

# Access a resource from the CLI

After access is granted, you can use the Apono CLI to launch a session with commands or use the interactive flow to select a resource and choose how to access it.

<details>

<summary><strong>Commands</strong></summary>

Use this approach when you know the session ID and client name for the session you want to launch.

Follow these steps to access the resource:

1. In Terminal, run the following `apono access` command to list all your session IDs.

{% hint style="info" %}
The session ID is listed under **ID**.
{% endhint %}

```shellscript
apono access list
```

2. Set the session ID.

{% code overflow="wrap" %}

```shellscript
export SESSION_ID="<SESSION_ID>"
```

{% endcode %}

3. Run the following `apono` command to display the list of valid `--client` values to use to launch your session.

```shellscript
apono --help
```

4. Set the client name.

{% code overflow="wrap" %}

```shellscript
export CLIENT_NAME="<CLIENT_NAME>"
```

{% endcode %}

5. Run the following `apono access` command to launch your session.

```shellscript
apono access use ${SESSION_ID} --client "${CLIENT_NAME}"
```

</details>

<details>

<summary><strong>Interactive</strong></summary>

Use the interactive flow to select an available resource and choose how to access it from the CLI.

Follow these steps to access the resource:

1. In Terminal, enter `apono access`. The **Select access** prompt and a list of resources appears.

```shellscript
apono access 
```

2. Select and submit the resource to access. The **Select how to use access** prompt appears.
3. Select and submit an option.

<table><thead><tr><th width="196.81640625">Option</th><th>Description</th></tr></thead><tbody><tr><td><strong>Connect</strong></td><td><p>Connects the user directly to the database</p><p>Once you have connected to the database, you can make queries directly from the CLI prompt.</p></td></tr><tr><td><strong>Instructions</strong></td><td>Prints instructions to access the database to the screen</td></tr></tbody></table>

</details>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apono.io/docs/access-requests-and-approvals/cli/access-a-resource-from-the-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 `automate deployments from our CI pipeline` 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.
