---
title: "Generate a script from a plain-language prompt | Grafana Labs"
description: "Use Script Authoring mode to turn a natural-language test request into a runnable k6 draft in the Cloud script editor, with QuickPizza as the target."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Generate a script from a plain-language prompt

This milestone is hands-on with **QuickPizza** at `https://quickpizza.grafana.com`. You do not need your own API or credentials to complete the steps.

You open Grafana Assistant, choose **k6 Script Authoring**, paste a starter prompt, then continue in the Cloud script editor when possible.

Open Performance, then open Grafana Assistant to prepare a script.

1. Open **Performance**.
2. Open **Assistant** from the top toolbar.

You should now see the Assistant panel and be in the Grafana Cloud k6 Performance area.

Choose k6 Script Authoring and send a prompt for a short QuickPizza test.

1. Open the Assistant mode selector and choose **k6 Script Authoring**.
2. Paste this starter prompt, or adapt it to describe your intended test:
   
   > Create a minimal k6 HTTP test for [https://quickpizza.grafana.com](https://quickpizza.grafana.com) that checks for a 200 response, uses sleep(1) between iterations, and runs for 10 iterations.
   
   Click **Send** when the complete prompt is ready.
   
   1. Enter a complete prompt describing the test, success criteria, pacing, and run length.
   2. When your message is complete, click Send.

Assistant returns a draft; review the generated request, checks, pacing, and run length before using it.

Ask Assistant to open its draft in the Cloud script editor, then choose your project and review the test.

1. Ask Assistant to open the Cloud script editor. You can enter: **Open the k6 script editor.** Click **Send** when ready.
   
   1. Ask Assistant to open the k6 script editor.
   2. When your message is complete, click Send.
2. If Assistant asks which project should hold the test, enter the project you want and click **Send**. Skip this step if the editor opens without a project question.
   
   1. Enter your chosen project only when Assistant asks for it.
   2. When your message is complete, click Send.
3. In the editor, use **Create** to save or **Create and Run** for a short smoke run. Review the draft before running it. See [Use the script editor](/docs/grafana-cloud/testing/k6/author-run/script-editor/).
4. Review the draft and confirm it includes a request to `https://quickpizza.grafana.com` (or paths under that host), at least one `check()` for status 200, `sleep(1)` or equivalent pacing, and sensible `options` for a short run.

You have reviewed the draft in Cloud or are ready to copy it for an optional local check.

1. If you use a local file instead of only Cloud runs, you will smoke-test with the k6 CLI.
2. Copy the script into a file such as `quickpizza-assistant.js`, then run:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   k6 run --iterations 1 quickpizza-assistant.js
   ```
   
   Skip this section if you stay entirely in the script editor.
3. You can skip local CLI work when Cloud-only validation is enough for your team.

**More to explore (optional):** at this point in the path you can read [Author and run tests in Grafana Cloud k6](/docs/grafana-cloud/testing/k6/author-run/) for a broader view of authoring in Cloud.

**Example prompt to copy** for QuickPizza in Assistant:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
Create a minimal k6 HTTP test for https://quickpizza.grafana.com that checks for a 200 response, uses sleep(1) between iterations, and runs for 10 iterations.
```

Compare Assistant output to what you expect from [Write your first k6 test script](/docs/learning-paths/run-first-k6-test/write-test-script/) before you change load or add CI.

In the next milestone on the learning path, you either discover endpoints from your stack’s telemetry or stay on QuickPizza for conversion and improvement steps.

Continue on [Discover real endpoints and generate a script](/docs/learning-paths/k6-script-authoring-assistant/discover-generate/) when you are ready.
