Network
intercept
Intercept network requests: block URLs, mock responses from files, or inject custom headers.
Usage
$ cdpilot intercept <subcmd> [args...]Arguments
| Name | Required | Description |
|---|---|---|
subcmd | required | block <pattern>, mock <pattern> <json-file>, headers <pattern> <header:value>, clear, or list |
Examples
Block all analytics requests
$ npx cdpilot intercept block "*.analytics.com*"Mock an API endpoint with a local JSON file
$ npx cdpilot intercept mock "*/api/users" ./mock-users.jsonAdd a custom header to all requests
$ npx cdpilot intercept headers "*" "X-Debug:true"Show active interception rules
$ npx cdpilot intercept listRemove all interception rules
$ npx cdpilot intercept clear