{
  "doc": {
    "id": "api/commands/task",
    "title": "task | Cypress Documentation",
    "description": "Execute code in Node.js via the task plugin event in Cypress.",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/task.md",
    "version": "a8fd16711bdda4c7b5645b9717e588ae99ec2470",
    "updated_at": "2026-05-18T17:21:32.047Z",
    "headings": [
      {
        "id": "api/commands/task#task",
        "text": "task",
        "level": 1
      },
      {
        "id": "api/commands/task#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/task#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/task#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/task#yields-learn-about-subject-management",
        "text": "Yields Learn about subject management",
        "level": 3
      },
      {
        "id": "api/commands/task#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/task#read-a-file-that-might-not-exist",
        "text": "Read a file that might not exist",
        "level": 3
      },
      {
        "id": "api/commands/task#return-number-of-files-in-the-folder",
        "text": "Return number of files in the folder",
        "level": 3
      },
      {
        "id": "api/commands/task#seed-a-database",
        "text": "Seed a database",
        "level": 3
      },
      {
        "id": "api/commands/task#return-a-promise-from-an-asynchronous-task",
        "text": "Return a Promise from an asynchronous task",
        "level": 3
      },
      {
        "id": "api/commands/task#save-a-variable-across-non-same-origin-url-visits",
        "text": "Save a variable across non same-origin URL visits",
        "level": 3
      },
      {
        "id": "api/commands/task#command-options",
        "text": "Command options",
        "level": 3
      },
      {
        "id": "api/commands/task#change-the-timeout",
        "text": "Change the timeout",
        "level": 4
      },
      {
        "id": "api/commands/task#notes",
        "text": "Notes",
        "level": 2
      },
      {
        "id": "api/commands/task#tasks-must-end",
        "text": "Tasks must end",
        "level": 3
      },
      {
        "id": "api/commands/task#tasks-that-do-not-end-are-not-supported",
        "text": "Tasks that do not end are not supported",
        "level": 4
      },
      {
        "id": "api/commands/task#tasks-are-merged-automatically",
        "text": "Tasks are merged automatically",
        "level": 3
      },
      {
        "id": "api/commands/task#reset-timeout-via-cypress-config",
        "text": "Reset timeout via Cypress.config()",
        "level": 3
      },
      {
        "id": "api/commands/task#set-timeout-in-the-test-configuration",
        "text": "Set timeout in the test configuration",
        "level": 3
      },
      {
        "id": "api/commands/task#allows-a-single-argument-only",
        "text": "Allows a single argument only",
        "level": 3
      },
      {
        "id": "api/commands/task#argument-should-be-serializable",
        "text": "Argument should be serializable",
        "level": 3
      },
      {
        "id": "api/commands/task#accessing-secrets-securely",
        "text": "Accessing secrets securely",
        "level": 3
      },
      {
        "id": "api/commands/task#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/task#requirements-learn-about-chaining-commands",
        "text": "Requirements Learn about chaining commands",
        "level": 3
      },
      {
        "id": "api/commands/task#assertions-learn-about-assertions",
        "text": "Assertions Learn about assertions",
        "level": 3
      },
      {
        "id": "api/commands/task#timeouts-learn-about-timeouts",
        "text": "Timeouts Learn about timeouts",
        "level": 3
      },
      {
        "id": "api/commands/task#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/task#history",
        "text": "History",
        "level": 2
      },
      {
        "id": "api/commands/task#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/commands/task#syntax",
      "doc_id": "api/commands/task",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\ncy.task(event)cy.task(event, arg)cy.task(event, arg, options)\n```\n\n### Usage\n\n**Correct Usage**\n\n```\n// in testcy.task('log', 'This will be output to the terminal')\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        log(message) {          console.log(message)          return null        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        log(message) {          console.log(message)          return null        },      })    },  },})\n```\n\nThe `task` plugin event handler can return a value or a promise. The command will fail if `undefined` is returned or if the promise is resolved with `undefined`. This helps catch typos or cases where the task event is not handled.\n\nIf you do not need to return a value, explicitly return `null` to signal that the given event has been handled.\n\n### Arguments\n\n**event _(String)_**\n\nAn event name to be handled via the `task` event in the [setupNodeEvents](/llm/markdown/app/plugins/plugins-guide.md#Using-a-plugin) function.\n\n**arg _(Object)_**\n\nAn argument to send along with the event. This can be any value that can be serialized by [JSON.stringify()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Unserializable types such as functions, regular expressions, or symbols will be omitted to `null`.\n\nIf you need to pass multiple arguments, use an object\n\n```\n// in testcy.task('hello', { greeting: 'Hello', name: 'World' })\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        // deconstruct the individual properties        hello({ greeting, name }) {          console.log('%s, %s', greeting, name)          return null        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        // deconstruct the individual properties        hello({ greeting, name }) {          console.log('%s, %s', greeting, name)          return null        },      })    },  },})\n```\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `cy.task()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `timeout` | [`taskTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `cy.task()` to resolve before [timing out](#Timeouts) |\n\n### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)\n\n`cy.task()` yields the value returned or resolved by the `task` event in [setupNodeEvents](/llm/markdown/app/plugins/plugins-guide.md#Using-a-plugin).\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 563
    },
    {
      "id": "api/commands/task#usage",
      "doc_id": "api/commands/task",
      "heading": "Usage",
      "heading_level": 3,
      "content_markdown": "### Usage\n\n**Correct Usage**\n\n```\n// in testcy.task('log', 'This will be output to the terminal')\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        log(message) {          console.log(message)          return null        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        log(message) {          console.log(message)          return null        },      })    },  },})\n```\n\nThe `task` plugin event handler can return a value or a promise. The command will fail if `undefined` is returned or if the promise is resolved with `undefined`. This helps catch typos or cases where the task event is not handled.\n\nIf you do not need to return a value, explicitly return `null` to signal that the given event has been handled.\n",
      "section": "api",
      "anchors": [
        "usage"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 213
    },
    {
      "id": "api/commands/task#arguments",
      "doc_id": "api/commands/task",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**event _(String)_**\n\nAn event name to be handled via the `task` event in the [setupNodeEvents](/llm/markdown/app/plugins/plugins-guide.md#Using-a-plugin) function.\n\n**arg _(Object)_**\n\nAn argument to send along with the event. This can be any value that can be serialized by [JSON.stringify()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Unserializable types such as functions, regular expressions, or symbols will be omitted to `null`.\n\nIf you need to pass multiple arguments, use an object\n\n```\n// in testcy.task('hello', { greeting: 'Hello', name: 'World' })\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        // deconstruct the individual properties        hello({ greeting, name }) {          console.log('%s, %s', greeting, name)          return null        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        // deconstruct the individual properties        hello({ greeting, name }) {          console.log('%s, %s', greeting, name)          return null        },      })    },  },})\n```\n\n**options _(Object)_**\n\nPass in an options object to change the default behavior of `cy.task()`.\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `log` | `true` | Displays the command in the [Command log](/llm/markdown/app/core-concepts/open-mode.md#Command-Log) |\n| `timeout` | [`taskTimeout`](/llm/markdown/app/references/configuration.md#Timeouts) | Time to wait for `cy.task()` to resolve before [timing out](#Timeouts) |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 313
    },
    {
      "id": "api/commands/task#examples",
      "doc_id": "api/commands/task",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n`cy.task()` provides an escape hatch for running arbitrary Node code, so you can take actions necessary for your tests outside of the scope of Cypress. This is great for:\n\n*   Seeding your test database.\n*   Storing state in Node that you want persisted between spec files.\n*   Performing parallel tasks, like making multiple http requests outside of Cypress.\n*   Running an external process.\n\n### Read a file that might not exist\n\nCommand [cy.readFile()](/llm/markdown/api/commands/readfile.md) assumes the file exists. If you need to read a file that might not exist, use `cy.task`.\n\n```\n// in testcy.task('readFileMaybe', 'my-file.txt').then((textOrNull) => { ... })\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')const fs = require('fs')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        readFileMaybe(filename) {          if (fs.existsSync(filename)) {            return fs.readFileSync(filename, 'utf8')          }          return null        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'import fs from 'fs'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        readFileMaybe(filename) {          if (fs.existsSync(filename)) {            return fs.readFileSync(filename, 'utf8')          }          return null        },      })    },  },})\n```\n\n### Return number of files in the folder\n\n```\n// in testcy.task('countFiles', 'cypress/downloads').then((count) => { ... })\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')const fs = require('fs')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        countFiles(folderName) {          return new Promise((resolve, reject) => {            fs.readdir(folderName, (err, files) => {              if (err) {                return reject(err)              }              resolve(files.length)            })          })        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'import fs from 'fs'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        countFiles(folderName) {          return new Promise((resolve, reject) => {            fs.readdir(folderName, (err, files) => {              if (err) {                return reject(err)              }              resolve(files.length)            })          })        },      })    },  },})\n```\n\n### Seed a database\n\n```\n// in testdescribe('e2e', () => {  beforeEach(() => {    cy.task('defaults:db')    cy.visit('/')  })  it('displays article values', () => {    cy.get('.article-list').should('have.length', 10)  })})\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')// we require some code in our app that// is responsible for seeding our databaseconst db = require('../../server/src/db')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        'defaults:db': () => {          return db.seed('defaults')        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'// we require some code in our app that// is responsible for seeding our databaseimport db from '../../server/src/db'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        'defaults:db': () => {          return db.seed('defaults')        },      })    },  },})\n```\n\n### Return a Promise from an asynchronous task\n\n```\n// in testcy.task('pause', 1000)\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        pause(ms) {          return new Promise((resolve) => {            // tasks should not resolve with undefined            setTimeout(() => resolve(null), ms)          })        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        pause(ms) {          return new Promise((resolve) => {            // tasks should not resolve with undefined            setTimeout(() => resolve(null), ms)          })        },      })    },  },})\n```\n\n### Save a variable across non same-origin URL visits\n\nWhen visiting non same-origin URL, Cypress will [change the hosted URL to the new URL](/llm/markdown/app/guides/cross-origin-testing.md), wiping the state of any local variables. We want to save a variable across visiting non same-origin URLs.\n\nWe can save the variable and retrieve the saved variable outside of the test using `cy.task()` as shown below.\n\n```\n// in testdescribe('Href visit', () => {  it('captures href', () => {    cy.visit('https://example.cypress.io')    cy.get('a')      .invoke('attr', 'href')      .then((href) => {        // href is not same-origin as current url        // like https://www.cypress-dx.com        cy.task('setHref', href)      })  })  it('visit href', () => {    cy.task('getHref').then((href) => {      // visit non same-origin url https://www.cypress-dx.com      cy.visit(href)    })  })})\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')let hrefmodule.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        setHref: (val) => {          return (href = val)        },        getHref: () => {          return href        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'let href: stringexport default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        setHref: (val) => {          return (href = val)        },        getHref: () => {          return href        },      })    },  },})\n```\n\n### Command options\n\n#### Change the timeout\n\nYou can increase the time allowed to execute the task, although _we do not recommend executing tasks that take a long time to exit_.\n\nCypress will _not_ continue running any other commands until `cy.task()` has finished, so a long-running command will drastically slow down your test runs.\n\n```\n// will fail if seeding the database takes longer than 20 seconds to finishcy.task('seedDatabase', null, { timeout: 20000 })\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 1207
    },
    {
      "id": "api/commands/task#read-a-file-that-might-not-exist",
      "doc_id": "api/commands/task",
      "heading": "Read a file that might not exist",
      "heading_level": 3,
      "content_markdown": "### Read a file that might not exist\n\nCommand [cy.readFile()](/llm/markdown/api/commands/readfile.md) assumes the file exists. If you need to read a file that might not exist, use `cy.task`.\n\n```\n// in testcy.task('readFileMaybe', 'my-file.txt').then((textOrNull) => { ... })\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')const fs = require('fs')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        readFileMaybe(filename) {          if (fs.existsSync(filename)) {            return fs.readFileSync(filename, 'utf8')          }          return null        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'import fs from 'fs'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        readFileMaybe(filename) {          if (fs.existsSync(filename)) {            return fs.readFileSync(filename, 'utf8')          }          return null        },      })    },  },})\n```\n",
      "section": "api",
      "anchors": [
        "read-a-file-that-might-not-exist"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 183
    },
    {
      "id": "api/commands/task#return-number-of-files-in-the-folder",
      "doc_id": "api/commands/task",
      "heading": "Return number of files in the folder",
      "heading_level": 3,
      "content_markdown": "### Return number of files in the folder\n\n```\n// in testcy.task('countFiles', 'cypress/downloads').then((count) => { ... })\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')const fs = require('fs')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        countFiles(folderName) {          return new Promise((resolve, reject) => {            fs.readdir(folderName, (err, files) => {              if (err) {                return reject(err)              }              resolve(files.length)            })          })        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'import fs from 'fs'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        countFiles(folderName) {          return new Promise((resolve, reject) => {            fs.readdir(folderName, (err, files) => {              if (err) {                return reject(err)              }              resolve(files.length)            })          })        },      })    },  },})\n```\n",
      "section": "api",
      "anchors": [
        "return-number-of-files-in-the-folder"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 187
    },
    {
      "id": "api/commands/task#seed-a-database",
      "doc_id": "api/commands/task",
      "heading": "Seed a database",
      "heading_level": 3,
      "content_markdown": "### Seed a database\n\n```\n// in testdescribe('e2e', () => {  beforeEach(() => {    cy.task('defaults:db')    cy.visit('/')  })  it('displays article values', () => {    cy.get('.article-list').should('have.length', 10)  })})\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')// we require some code in our app that// is responsible for seeding our databaseconst db = require('../../server/src/db')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        'defaults:db': () => {          return db.seed('defaults')        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'// we require some code in our app that// is responsible for seeding our databaseimport db from '../../server/src/db'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        'defaults:db': () => {          return db.seed('defaults')        },      })    },  },})\n```\n",
      "section": "api",
      "anchors": [
        "seed-a-database"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 193
    },
    {
      "id": "api/commands/task#return-a-promise-from-an-asynchronous-task",
      "doc_id": "api/commands/task",
      "heading": "Return a Promise from an asynchronous task",
      "heading_level": 3,
      "content_markdown": "### Return a Promise from an asynchronous task\n\n```\n// in testcy.task('pause', 1000)\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        pause(ms) {          return new Promise((resolve) => {            // tasks should not resolve with undefined            setTimeout(() => resolve(null), ms)          })        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        pause(ms) {          return new Promise((resolve) => {            // tasks should not resolve with undefined            setTimeout(() => resolve(null), ms)          })        },      })    },  },})\n```\n",
      "section": "api",
      "anchors": [
        "return-a-promise-from-an-asynchronous-task"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 165
    },
    {
      "id": "api/commands/task#save-a-variable-across-non-same-origin-url-visits",
      "doc_id": "api/commands/task",
      "heading": "Save a variable across non same-origin URL visits",
      "heading_level": 3,
      "content_markdown": "### Save a variable across non same-origin URL visits\n\nWhen visiting non same-origin URL, Cypress will [change the hosted URL to the new URL](/llm/markdown/app/guides/cross-origin-testing.md), wiping the state of any local variables. We want to save a variable across visiting non same-origin URLs.\n\nWe can save the variable and retrieve the saved variable outside of the test using `cy.task()` as shown below.\n\n```\n// in testdescribe('Href visit', () => {  it('captures href', () => {    cy.visit('https://example.cypress.io')    cy.get('a')      .invoke('attr', 'href')      .then((href) => {        // href is not same-origin as current url        // like https://www.cypress-dx.com        cy.task('setHref', href)      })  })  it('visit href', () => {    cy.task('getHref').then((href) => {      // visit non same-origin url https://www.cypress-dx.com      cy.visit(href)    })  })})\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')let hrefmodule.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        setHref: (val) => {          return (href = val)        },        getHref: () => {          return href        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'let href: stringexport default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        setHref: (val) => {          return (href = val)        },        getHref: () => {          return href        },      })    },  },})\n```\n",
      "section": "api",
      "anchors": [
        "save-a-variable-across-non-same-origin-url-visits"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 292
    },
    {
      "id": "api/commands/task#command-options",
      "doc_id": "api/commands/task",
      "heading": "Command options",
      "heading_level": 3,
      "content_markdown": "### Command options\n\n#### Change the timeout\n\nYou can increase the time allowed to execute the task, although _we do not recommend executing tasks that take a long time to exit_.\n\nCypress will _not_ continue running any other commands until `cy.task()` has finished, so a long-running command will drastically slow down your test runs.\n\n```\n// will fail if seeding the database takes longer than 20 seconds to finishcy.task('seedDatabase', null, { timeout: 20000 })\n```\n",
      "section": "api",
      "anchors": [
        "command-options"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 100
    },
    {
      "id": "api/commands/task#change-the-timeout",
      "doc_id": "api/commands/task",
      "heading": "Change the timeout",
      "heading_level": 4,
      "content_markdown": "#### Change the timeout\n\nYou can increase the time allowed to execute the task, although _we do not recommend executing tasks that take a long time to exit_.\n\nCypress will _not_ continue running any other commands until `cy.task()` has finished, so a long-running command will drastically slow down your test runs.\n\n```\n// will fail if seeding the database takes longer than 20 seconds to finishcy.task('seedDatabase', null, { timeout: 20000 })\n```\n",
      "section": "api",
      "anchors": [
        "change-the-timeout"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 96
    },
    {
      "id": "api/commands/task#notes",
      "doc_id": "api/commands/task",
      "heading": "Notes",
      "heading_level": 2,
      "content_markdown": "## Notes\n\n### Tasks must end\n\n#### Tasks that do not end are not supported\n\n`cy.task()` does not support tasks that do not end, such as:\n\n*   Starting a server.\n*   A task that watches for file changes.\n*   Any process that needs to be manually interrupted to stop.\n\nA task must end within the `taskTimeout` or Cypress will fail the current test.\n\n### Tasks are merged automatically\n\nSometimes you might be using plugins that export their tasks for registration. Cypress automatically merges `on('task')` objects for you. For example if you are using [cypress-skip-and-only-ui](https://github.com/bahmutov/cypress-skip-and-only-ui) plugin and want to install your own task to read a file that might not exist:\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')const skipAndOnlyTask = require('cypress-skip-and-only-ui/task')const fs = require('fs')const myTask = {  readFileMaybe(filename) {    if (fs.existsSync(filename)) {      return fs.readFileSync(filename, 'utf8')    }    return null  },}module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      // register plugin's task      on('task', skipAndOnlyTask)      // and register my own task      on('task', myTask)    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'import skipAndOnlyTask from 'cypress-skip-and-only-ui/task'import fs from 'fs'const myTask = {  readFileMaybe(filename) {    if (fs.existsSync(filename)) {      return fs.readFileSync(filename, 'utf8')    }    return null  },}export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      // register plugin's task      on('task', skipAndOnlyTask)      // and register my own task      on('task', myTask)    },  },})\n```\n\nSee [#2284](https://github.com/cypress-io/cypress/issues/2284) for implementation.\n\n**Duplicate task keys**\n\nIf multiple task objects use the same key, the later registration will overwrite that particular key, similar to how merging multiple objects with duplicate keys will overwrite the first one.\n\n### Reset timeout via `Cypress.config()`\n\nYou can change the timeout of `cy.task()` for the remainder of the tests by setting the new values for `taskTimeout` within [Cypress.config()](/llm/markdown/api/cypress-api/config.md).\n\n```\nCypress.config('taskTimeout', 30000)Cypress.config('taskTimeout') // => 30000\n```\n\n### Set timeout in the test configuration\n\nYou can configure the `cy.task()` timeout within a suite or test by passing the new configuration value within the [test configuration](/llm/markdown/app/references/configuration.md#Test-Configuration).\n\nThis will set the timeout throughout the duration of the tests, then return it to the default `taskTimeout` when complete.\n\n```\ndescribe('has data available from database', { taskTimeout: 90000 }, () => {  before(() => {    cy.task('seedDatabase')  })  // tests  after(() => {    cy.task('resetDatabase')  })})\n```\n\n### Allows a single argument only\n\nThe syntax `cy.task(name, arg, options)` only has place for a single argument to be passed from the test code to the plugins code. In the situations where you would like to pass multiple arguments, place them into an object to be destructured inside the task code. For example, if you would like to execute a database query and pass the database profile name you could do:\n\n```\n// in testconst dbName = 'stagingA'const query = 'SELECT * FROM users'cy.task('queryDatabase', { dbName, query })\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')const mysql = require('mysql')// the connection strings for different databases could// come from system environment variablesconst connections = {  stagingA: {    host: 'staging.my.co',    user: 'test',    password: '***',    database: 'users',  },  stagingB: {    host: 'staging-b.my.co',    user: 'test',    password: '***',    database: 'users',  },}// querying the database from Nodefunction queryDB(connectionInfo, query) {  const connection = mysql.createConnection(connectionInfo)  connection.connect()  return new Promise((resolve, reject) => {    connection.query(query, (error, results) => {      if (error) {        return reject(error)      }      connection.end()      return resolve(results)    })  })}module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        // destructure the argument into the individual fields        queryDatabase({ dbName, query }) {          const connectionInfo = connections[dbName]          if (!connectionInfo) {            throw new Error(`Do not have DB connection under name ${dbName}`)          }          return queryDB(connectionInfo, query)        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'import mysql from 'mysql'// the connection strings for different databases could// come from system environment variablesconst connections = {  stagingA: {    host: 'staging.my.co',    user: 'test',    password: '***',    database: 'users',  },  stagingB: {    host: 'staging-b.my.co',    user: 'test',    password: '***',    database: 'users',  },}// querying the database from Nodefunction queryDB(connectionInfo, query) {  const connection = mysql.createConnection(connectionInfo)  connection.connect()  return new Promise((resolve, reject) => {    connection.query(query, (error, results) => {      if (error) {        return reject(error)      }      connection.end()      return resolve(results)    })  })}export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        // destructure the argument into the individual fields        queryDatabase({ dbName, query }) {          const connectionInfo = connections[dbName]          if (!connectionInfo) {            throw new Error(`Do not have DB connection under name ${dbName}`)          }          return queryDB(connectionInfo, query)        },      })    },  },})\n```\n\n### Argument should be serializable\n\nThe argument `arg` sent via `cy.task(name, arg)` should be serializable; it cannot have circular dependencies (issue [#5539](https://github.com/cypress-io/cypress/issues/5539)). If there are any special fields like `Date`, you are responsible for their conversion (issue [#4980](https://github.com/cypress-io/cypress/issues/4980)):\n\n```\n// in testcy.task('date', new Date()).then((s) => {  // the yielded result is a string  // we need to convert it to Date object  const result = new Date(s)})\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        date(s) {          // s is a string, so convert it to Date          const d = new Date(s)          // do something with the date          // and return it back          return d        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        date(s) {          // s is a string, so convert it to Date          const d = new Date(s)          // do something with the date          // and return it back          return d        },      })    },  },})\n```\n\n### Accessing secrets securely\n\nYou can use `cy.task()` to securely access secrets at runtime when they aren't available during configuration. Using `cy.task()` may be useful when secrets are retrieved from external secret managers or APIs that aren't available at configuration time.\n\n[cy.env()](/llm/markdown/api/commands/env.md) is the preferred way to access secrets securely and use them in your tests, and is recommended for secrets that are available at configuration time.\n\n```\n// in test - executes at runtimecy.task('getSecret', 'API_KEY').then((apiKey) => {  cy.request({    method: 'POST',    url: 'https://api.example.com/data',    headers: {      Authorization: `Bearer ${apiKey}`,    },  })})\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      // Task definition - executes when cy.task() is called in tests      on('task', {        getSecret(secretName) {          // This reads from process.env at runtime, not at configuration time          // Useful when secrets are fetched dynamically or only needed conditionally          const secret = process.env[secretName]          if (!secret) {            throw new Error(`Secret ${secretName} is not set`)          }          return secret        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      // Task definition - executes when cy.task() is called in tests      on('task', {        getSecret(secretName: string) {          // This reads from process.env at runtime, not at configuration time          // Useful when secrets are fetched dynamically or only needed conditionally          const secret = process.env[secretName]          if (!secret) {            throw new Error(`Secret ${secretName} is not set`)          }          return secret        },      })    },  },})\n```\n",
      "section": "api",
      "anchors": [
        "notes"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 1649
    },
    {
      "id": "api/commands/task#tasks-must-end",
      "doc_id": "api/commands/task",
      "heading": "Tasks must end",
      "heading_level": 3,
      "content_markdown": "### Tasks must end\n\n#### Tasks that do not end are not supported\n\n`cy.task()` does not support tasks that do not end, such as:\n\n*   Starting a server.\n*   A task that watches for file changes.\n*   Any process that needs to be manually interrupted to stop.\n\nA task must end within the `taskTimeout` or Cypress will fail the current test.\n",
      "section": "api",
      "anchors": [
        "tasks-must-end"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 81
    },
    {
      "id": "api/commands/task#tasks-that-do-not-end-are-not-supported",
      "doc_id": "api/commands/task",
      "heading": "Tasks that do not end are not supported",
      "heading_level": 4,
      "content_markdown": "#### Tasks that do not end are not supported\n\n`cy.task()` does not support tasks that do not end, such as:\n\n*   Starting a server.\n*   A task that watches for file changes.\n*   Any process that needs to be manually interrupted to stop.\n\nA task must end within the `taskTimeout` or Cypress will fail the current test.\n",
      "section": "api",
      "anchors": [
        "tasks-that-do-not-end-are-not-supported"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 76
    },
    {
      "id": "api/commands/task#tasks-are-merged-automatically",
      "doc_id": "api/commands/task",
      "heading": "Tasks are merged automatically",
      "heading_level": 3,
      "content_markdown": "### Tasks are merged automatically\n\nSometimes you might be using plugins that export their tasks for registration. Cypress automatically merges `on('task')` objects for you. For example if you are using [cypress-skip-and-only-ui](https://github.com/bahmutov/cypress-skip-and-only-ui) plugin and want to install your own task to read a file that might not exist:\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')const skipAndOnlyTask = require('cypress-skip-and-only-ui/task')const fs = require('fs')const myTask = {  readFileMaybe(filename) {    if (fs.existsSync(filename)) {      return fs.readFileSync(filename, 'utf8')    }    return null  },}module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      // register plugin's task      on('task', skipAndOnlyTask)      // and register my own task      on('task', myTask)    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'import skipAndOnlyTask from 'cypress-skip-and-only-ui/task'import fs from 'fs'const myTask = {  readFileMaybe(filename) {    if (fs.existsSync(filename)) {      return fs.readFileSync(filename, 'utf8')    }    return null  },}export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      // register plugin's task      on('task', skipAndOnlyTask)      // and register my own task      on('task', myTask)    },  },})\n```\n\nSee [#2284](https://github.com/cypress-io/cypress/issues/2284) for implementation.\n\n**Duplicate task keys**\n\nIf multiple task objects use the same key, the later registration will overwrite that particular key, similar to how merging multiple objects with duplicate keys will overwrite the first one.\n",
      "section": "api",
      "anchors": [
        "tasks-are-merged-automatically"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 291
    },
    {
      "id": "api/commands/task#reset-timeout-via-cypress-config",
      "doc_id": "api/commands/task",
      "heading": "Reset timeout via Cypress.config()",
      "heading_level": 3,
      "content_markdown": "### Reset timeout via `Cypress.config()`\n\nYou can change the timeout of `cy.task()` for the remainder of the tests by setting the new values for `taskTimeout` within [Cypress.config()](/llm/markdown/api/cypress-api/config.md).\n\n```\nCypress.config('taskTimeout', 30000)Cypress.config('taskTimeout') // => 30000\n```\n",
      "section": "api",
      "anchors": [
        "reset-timeout-via-cypress-config"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 45
    },
    {
      "id": "api/commands/task#set-timeout-in-the-test-configuration",
      "doc_id": "api/commands/task",
      "heading": "Set timeout in the test configuration",
      "heading_level": 3,
      "content_markdown": "### Set timeout in the test configuration\n\nYou can configure the `cy.task()` timeout within a suite or test by passing the new configuration value within the [test configuration](/llm/markdown/app/references/configuration.md#Test-Configuration).\n\nThis will set the timeout throughout the duration of the tests, then return it to the default `taskTimeout` when complete.\n\n```\ndescribe('has data available from database', { taskTimeout: 90000 }, () => {  before(() => {    cy.task('seedDatabase')  })  // tests  after(() => {    cy.task('resetDatabase')  })})\n```\n",
      "section": "api",
      "anchors": [
        "set-timeout-in-the-test-configuration"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 99
    },
    {
      "id": "api/commands/task#allows-a-single-argument-only",
      "doc_id": "api/commands/task",
      "heading": "Allows a single argument only",
      "heading_level": 3,
      "content_markdown": "### Allows a single argument only\n\nThe syntax `cy.task(name, arg, options)` only has place for a single argument to be passed from the test code to the plugins code. In the situations where you would like to pass multiple arguments, place them into an object to be destructured inside the task code. For example, if you would like to execute a database query and pass the database profile name you could do:\n\n```\n// in testconst dbName = 'stagingA'const query = 'SELECT * FROM users'cy.task('queryDatabase', { dbName, query })\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')const mysql = require('mysql')// the connection strings for different databases could// come from system environment variablesconst connections = {  stagingA: {    host: 'staging.my.co',    user: 'test',    password: '***',    database: 'users',  },  stagingB: {    host: 'staging-b.my.co',    user: 'test',    password: '***',    database: 'users',  },}// querying the database from Nodefunction queryDB(connectionInfo, query) {  const connection = mysql.createConnection(connectionInfo)  connection.connect()  return new Promise((resolve, reject) => {    connection.query(query, (error, results) => {      if (error) {        return reject(error)      }      connection.end()      return resolve(results)    })  })}module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        // destructure the argument into the individual fields        queryDatabase({ dbName, query }) {          const connectionInfo = connections[dbName]          if (!connectionInfo) {            throw new Error(`Do not have DB connection under name ${dbName}`)          }          return queryDB(connectionInfo, query)        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'import mysql from 'mysql'// the connection strings for different databases could// come from system environment variablesconst connections = {  stagingA: {    host: 'staging.my.co',    user: 'test',    password: '***',    database: 'users',  },  stagingB: {    host: 'staging-b.my.co',    user: 'test',    password: '***',    database: 'users',  },}// querying the database from Nodefunction queryDB(connectionInfo, query) {  const connection = mysql.createConnection(connectionInfo)  connection.connect()  return new Promise((resolve, reject) => {    connection.query(query, (error, results) => {      if (error) {        return reject(error)      }      connection.end()      return resolve(results)    })  })}export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        // destructure the argument into the individual fields        queryDatabase({ dbName, query }) {          const connectionInfo = connections[dbName]          if (!connectionInfo) {            throw new Error(`Do not have DB connection under name ${dbName}`)          }          return queryDB(connectionInfo, query)        },      })    },  },})\n```\n",
      "section": "api",
      "anchors": [
        "allows-a-single-argument-only"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 507
    },
    {
      "id": "api/commands/task#argument-should-be-serializable",
      "doc_id": "api/commands/task",
      "heading": "Argument should be serializable",
      "heading_level": 3,
      "content_markdown": "### Argument should be serializable\n\nThe argument `arg` sent via `cy.task(name, arg)` should be serializable; it cannot have circular dependencies (issue [#5539](https://github.com/cypress-io/cypress/issues/5539)). If there are any special fields like `Date`, you are responsible for their conversion (issue [#4980](https://github.com/cypress-io/cypress/issues/4980)):\n\n```\n// in testcy.task('date', new Date()).then((s) => {  // the yielded result is a string  // we need to convert it to Date object  const result = new Date(s)})\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        date(s) {          // s is a string, so convert it to Date          const d = new Date(s)          // do something with the date          // and return it back          return d        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      on('task', {        date(s) {          // s is a string, so convert it to Date          const d = new Date(s)          // do something with the date          // and return it back          return d        },      })    },  },})\n```\n",
      "section": "api",
      "anchors": [
        "argument-should-be-serializable"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 267
    },
    {
      "id": "api/commands/task#accessing-secrets-securely",
      "doc_id": "api/commands/task",
      "heading": "Accessing secrets securely",
      "heading_level": 3,
      "content_markdown": "### Accessing secrets securely\n\nYou can use `cy.task()` to securely access secrets at runtime when they aren't available during configuration. Using `cy.task()` may be useful when secrets are retrieved from external secret managers or APIs that aren't available at configuration time.\n\n[cy.env()](/llm/markdown/api/commands/env.md) is the preferred way to access secrets securely and use them in your tests, and is recommended for secrets that are available at configuration time.\n\n```\n// in test - executes at runtimecy.task('getSecret', 'API_KEY').then((apiKey) => {  cy.request({    method: 'POST',    url: 'https://api.example.com/data',    headers: {      Authorization: `Bearer ${apiKey}`,    },  })})\n```\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      // Task definition - executes when cy.task() is called in tests      on('task', {        getSecret(secretName) {          // This reads from process.env at runtime, not at configuration time          // Useful when secrets are fetched dynamically or only needed conditionally          const secret = process.env[secretName]          if (!secret) {            throw new Error(`Secret ${secretName} is not set`)          }          return secret        },      })    },  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  // setupNodeEvents can be defined in either  // the e2e or component configuration  e2e: {    setupNodeEvents(on, config) {      // Task definition - executes when cy.task() is called in tests      on('task', {        getSecret(secretName: string) {          // This reads from process.env at runtime, not at configuration time          // Useful when secrets are fetched dynamically or only needed conditionally          const secret = process.env[secretName]          if (!secret) {            throw new Error(`Secret ${secretName} is not set`)          }          return secret        },      })    },  },})\n```\n",
      "section": "api",
      "anchors": [
        "accessing-secrets-securely"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 357
    },
    {
      "id": "api/commands/task#rules",
      "doc_id": "api/commands/task",
      "heading": "Rules",
      "heading_level": 2,
      "content_markdown": "## Rules\n\n### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)\n\n*   `cy.task()` requires being chained off of `cy`.\n*   `cy.task()` requires the task to eventually end.\n\n### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)\n\n*   `cy.task()` will only run assertions you have chained once, and will not [retry](/llm/markdown/app/core-concepts/retry-ability.md).\n\n### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)\n\n*   `cy.task()` can time out waiting for the task to end.\n",
      "section": "api",
      "anchors": [
        "rules"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 79
    },
    {
      "id": "api/commands/task#command-log",
      "doc_id": "api/commands/task",
      "heading": "Command Log",
      "heading_level": 2,
      "content_markdown": "## Command Log\n\nThis example uses the [Return number of files in the folder](#Return-number-of-files-in-the-folder) task defined above.\n\n```\ncy.task('countFiles', 'cypress/e2e')\n```\n\nThe command above will display in the Command Log as:\n\nWhen clicking on the `task` command within the command log, the console outputs the following:\n",
      "section": "api",
      "anchors": [
        "command-log"
      ],
      "path": "/llm/json/chunked/api/commands/task.json",
      "token_estimate": 61
    }
  ]
}