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.

  1. You will open Testing & synthetics, go to Performance, then open Grafana Assistant from the toolbar.

  2. In the main menu, select Testing & synthetics.

  3. Select Performance (Grafana Cloud k6).

  4. Open Assistant from the top toolbar.

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

  1. You will select k6 Script Authoring in the Assistant mode selector, then paste the example prompt in your own words if you prefer.

  2. In the Assistant panel, open the mode selector (bottom of the panel) and choose k6 Script Authoring.

    Paste a prompt that names QuickPizza, success criteria, pacing, and a short run length. For example:

    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.

    Treat the reply as a draft. Wording can differ by stack and model.

    For product details and optional OpenAPI context, refer to Use k6 Script Authoring mode.

  3. You should see Assistant return a k6 script draft you can copy or continue with in the script editor.

  1. You will ask Assistant to open the Cloud script editor, pick a k6 project, then save or run a short test from the UI.

  2. Ask Assistant to open the k6 script editor—for example: Open the k6 script editor. Assistant asks which k6 project should hold the test; pick the project you want.

    In the editor, use Create to save or Create and Run for a short smoke run. Refer to Open the k6 script editor and Use the script editor.

    Optional: if you have an OpenAPI or Swagger spec, attach or paste it in the same thread before or after the prompt so the draft has fewer placeholder // TODO: comments.

  3. 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.

  4. You should have validated the draft in Cloud or be 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
    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 for a broader view of authoring in Cloud.

Example prompt to copy for QuickPizza in Assistant:

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 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 when you are ready.


page 3 of 9