Skip to Content

apxy rules works on the rules files. In a git worktree, rules live in <worktree>/.apxy/rules.json and apply to the traffic of that workspace. Global rules live in ~/.apxy/rules.json. apxy rules list shows what applies, apxy rules apply pushes a file to the proxy, and apxy rules clear deletes the rules of one file. See Workspaces.

apxy rules

List, apply or clear every rule that applies to this workspace

Options

-h, --help help for rules

Options inherited from parent commands

--config string config file (default is ~/.apxy/config.yaml) --error-format string error output format: text|json (default "text") --help-format string help output format: default|agent (default "default") --no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1) --output string output format: agent|human (default: auto-detect via TTY) --verbose enable verbose output

SEE ALSO

  • apxy - Verify code changes against the HTTP requests they send
  • apxy rules apply - Validate this workspace’s rules file (or the global one with —global) and push it to the running proxy now
  • apxy rules clear - Delete every rule of this workspace (or the global rules with —global)
  • apxy rules list - List the rules that apply to this workspace, with their files

apxy rules apply

Validate this workspace’s rules file (or the global one with —global) and push it to the running proxy now

Synopsis

Validate this workspace’s rules file (<worktree>/.apxy/rules.json), or the global rules file with —global, and push it to the running proxy now: the step after editing the file by hand, by git checkout, or by review.

apxy run and apxy mcp also push a rules file within a second of a change while they run. An invalid file is never pushed: the proxy keeps the last valid rules, and apply exits non-zero with the file, the line and column or the rule (such as mock_rules[2]) and the problem. With no proxy running there is nothing to push: apply checks the file, says when it applies, and exits 0.

apxy rules apply [flags]

Examples

apxy rules apply apxy rules apply --global

Options

--control-url string control API URL (default "http://127.0.0.1:8081") --global use the global rules (~/.apxy/rules.json) instead of this workspace's (<worktree>/.apxy/rules.json): global rules apply to untagged traffic, such as browsers on the system proxy and iOS simulators, and to every workspace after its own. Outside a git worktree, rules are always global -h, --help help for apply

Options inherited from parent commands

--config string config file (default is ~/.apxy/config.yaml) --error-format string error output format: text|json (default "text") --help-format string help output format: default|agent (default "default") --no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1) --output string output format: agent|human (default: auto-detect via TTY) --verbose enable verbose output

SEE ALSO

  • apxy rules - List, apply or clear every rule that applies to this workspace

apxy rules clear

Delete every rule of this workspace (or the global rules with —global)

Synopsis

Delete every rule in this workspace’s rules file, of every kind, and push the empty set to the running proxy. Global rules stay; —global clears them instead. There is no clear that crosses workspaces.

apxy rules clear [flags]

Examples

apxy rules clear apxy rules clear --global

Options

--control-url string control API URL (default "http://127.0.0.1:8081") --dry-run preview what would happen without executing --global use the global rules (~/.apxy/rules.json) instead of this workspace's (<worktree>/.apxy/rules.json): global rules apply to untagged traffic, such as browsers on the system proxy and iOS simulators, and to every workspace after its own. Outside a git worktree, rules are always global -h, --help help for clear

Options inherited from parent commands

--config string config file (default is ~/.apxy/config.yaml) --error-format string error output format: text|json (default "text") --help-format string help output format: default|agent (default "default") --no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1) --output string output format: agent|human (default: auto-detect via TTY) --verbose enable verbose output

SEE ALSO

  • apxy rules - List, apply or clear every rule that applies to this workspace

apxy rules list

List the rules that apply to this workspace, with their files

Synopsis

List every mock, rewrite, filter, script, breakpoint, SSL domain, DNS override, network condition and caching override that applies to requests from this workspace: its own rules (<worktree>/.apxy/rules.json) first, which win, then the global rules (~/.apxy/rules.json). Outside a git worktree only the global rules apply. Each rule names its file, and each file says whether the running proxy applies what the file holds now. A file that does not parse or validate shows the line and column or the rule to fix, and the other file is still listed.

apxy rules list [flags]

Examples

apxy rules list

Options

--control-url string control API URL (default "http://127.0.0.1:8081") -h, --help help for list

Options inherited from parent commands

--config string config file (default is ~/.apxy/config.yaml) --error-format string error output format: text|json (default "text") --help-format string help output format: default|agent (default "default") --no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1) --output string output format: agent|human (default: auto-detect via TTY) --verbose enable verbose output

SEE ALSO

  • apxy rules - List, apply or clear every rule that applies to this workspace
Last updated on