> For the complete documentation index, see [llms.txt](https://dataflint.gitbook.io/dataflint-for-spark/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dataflint.gitbook.io/dataflint-for-spark/dataflint-copilot/copilot-usage.md).

# Copilot Usage

## Copilot Usage

Now, when you are using the Cursor chat window and add a spark job as context, press "/" and you will get 2 *dataflint-copilot* prompts "spark expert", "highlight" and "optimize":

<figure><img src="/files/ZDEYGAA28XXhXONf2Zmu" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
You might want to approve all MCP tool calls without approval in Cursor/VScode setting, or add the DataFlint MCP requests to the allowlist of MCP tools that does not require approval.
{% endhint %}

**Highlight** will **add code highlight to your current job** based on the last run. You can also trigger it by asking Cursor "add highlight for this job"

<figure><img src="/files/Ss2otyIYNTmxmVtoVgFX" alt=""><figcaption></figcaption></figure>

**Optimize** also **optimize the code based on DataFlint alerts.** you can also trigger it by asking Cursor "optimize this job".

<figure><img src="/files/pXuIoGaFAYaw5rEc4FRb" alt=""><figcaption></figcaption></figure>


---

# 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 current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dataflint.gitbook.io/dataflint-for-spark/dataflint-copilot/copilot-usage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
