{
  "slug": "k6-cloud-commands-support-a-configurable-default-stack-f75ad1d847d4",
  "title": "k6 Cloud commands support a configurable default stack",
  "tools": [
    "k6"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-02-10T09:12:21.000Z",
  "announced_at": "2026-02-10T09:12:21.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When running a Grafana Cloud test, log in with a stack to save it as the default, or set a stack for that run with `K6_CLOUD_STACK_ID` or `options.cloud.stackID`.",
    "examples": [
      "k6 cloud login",
      "k6 cloud login --token <YOUR_API_TOKEN> --stack <YOUR_STACK_URL_OR_SLUG>",
      "K6_CLOUD_STACK_ID=<YOUR_STACK_ID> k6 cloud run <SCRIPT.js>"
    ],
    "gotchas": [
      "Version: v1.6.0",
      "--token <YOUR_API_TOKEN>: API token for authentication; used with `--stack` for non-interactive login.",
      "--stack <YOUR_STACK_URL_OR_SLUG>: Stack URL or slug where cloud commands run by default.",
      "K6_CLOUD_STACK_ID=<YOUR_STACK_ID>: Environment variable selecting the stack by ID for cloud commands.",
      "options.cloud.stackID: Stack ID selected for the run; available in k6 v1.6.0 and later.",
      "options.cloud.projectID: Project ID for the cloud run.",
      "Prerequisite: Authenticate with a Grafana Cloud k6 API token and configure a stack to run cloud commands.",
      "A stack slug or stack id is used to determine which default project to use when one is not explicitly provided.",
      "If `projectID` does not belong to the configured stack, the run throws an error.",
      "Stack information will become mandatory to run a test in k6 v2.",
      "Docs conflict: Current k6 documentation says every cloud subcommand requires a configured stack; current release notes state stack is mandatory in k6 v2. The official v1.6.0 source documents stackID and projectID fields, but current documentation may describe newer behavior."
    ]
  },
  "why_it_matters": "Run a test in Grafana Cloud using the configured default stack or a stack selected for that run.",
  "before": "Users had to specify the project ID for every test run.",
  "sources": [
    "https://github.com/grafana/k6/releases/tag/v1.6.0",
    "https://grafana.com/docs/k6/latest/reference/cloud-commands/",
    "https://grafana.com/docs/grafana-cloud/observe-and-act/testing/k6/author-run/tokens-and-cli-authentication/?mdm=referral&plcmt=footer&src=joyk.com",
    "https://github.com/grafana/k6/blob/v1.6.0/cloudapi/config.go"
  ],
  "rank": 0.9703,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-4d59ff63232066fe-0:gate",
    "evidence_hash": "214d637601ab12859a942e0dfb0964627863702fc979acbb4c496833c029e4b8"
  },
  "review": {
    "draft_hash": "dd8e1f3f7e3d2c5d169a36c1358a590544a4d6a6babd7d119581ce4e5e26aab2",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.74 (>= 0.6 needed)."
  }
}
