> For the complete documentation index, see [llms.txt](https://docs.userlane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.userlane.com/developers/userlane-commands/open-the-assistant.md). Agents can also search and read this documentation through its [MCP server](https://docs.userlane.com/~gitbook/mcp).

# Implement a command to open the Assistant

Trigger the Assistant from a custom button or toggle using the `openAssistant` command.

## About opening the Assistant

A user normally opens the Assistant by clicking the Assistant icon in one corner of the screen. The `openAssistant` command opens it from a different trigger instead. This is useful where the Assistant icon is hidden, or where the application already has its own help control.

Two common cases:

* Open the Assistant when a user clicks a specific element, for example a Help or Interactive Support button in the application.
* Open the Assistant when a user activates a toggle.

To hide the Assistant icon and open the Assistant only from a custom control, use passive mode together with this command. Do not use the `hide` command for this. See Option C in [Hide Userlane on specific pages](https://docs.userlane.com/developers/userlane-commands/hide-userlane-on-specific-pages.md).

## Requirements

The Userlane snippet is implemented in the application. See How Userlane is deployed.

## Implement the command

Add the command to the element that should open the Assistant. When the element is clicked, the Assistant opens in the same way as clicking the Assistant icon.

```js
// open the Assistant
Userlane('openAssistant');
```

The command does nothing apart from writing a message to the browser console when it runs before Userlane has finished initializing, while a Guide is playing or paused, while the Assistant is minimized, while the Editor is open, or while a welcome slide or announcement is showing.

## Relevant articles

* [Hide Userlane on specific pages](https://docs.userlane.com/developers/userlane-commands/hide-userlane-on-specific-pages.md)
* [Quick reference of commands](https://docs.userlane.com/developers/userlane-commands/quick-reference-of-commands.md)
* How Userlane is deployed


---

# 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.userlane.com/developers/userlane-commands/open-the-assistant.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.
