# Enabling from the CLI

{% stepper %}
{% step %}
**Access Intercept Command**

The `intercept` command is used to configure the proxy settings with the CLI. In our case, we can use it to configure `stoobly-agent` to intercept and mock requests.

```bash
$ stoobly-agent intercept --help
```

```
Usage: stoobly-agent intercept [OPTIONS] COMMAND [ARGS]...

  Manage request intercept

Options:
  -h, --help  Show this message and exit.

Commands:
  configure  Configure intercept
  disable    Disable intercept
  enable     Enable intercept
  show       Show intercept

  Run 'stoobly-agent intercept COMMAND --help' for more information on a
  command.
```

{% endstep %}

{% step %}
**Access Intercept Configure Command**

Here's the `configure` sub-command to configure the proxy mode and policy.

```
$ stoobly-agent intercept set --help
```

```
Usage: stoobly-agent intercept set [OPTIONS]

  Configure intercept

Options:
  --mode [mock|record|replay]
  --policy [all|found]
  -h, --help                   Show this message and exit.
```

{% endstep %}

{% step %}
**Configure Intercept Mode**

Run that command and set the mode to `mock`. Optionally add extra `--policy` flag as needed. Defaults to mocking all requests.

```
stoobly-agent intercept set --mode mock
```

{% endstep %}

{% step %}
**Enable Intercept**

Next, enable the proxy to start mocking. This is equivalent to pressing the Run button in the UI

```
stoobly-agent intercept enable
```

{% endstep %}

{% step %}
**Test Intercept**

Finally send some requests to the Agent and see your mocked HTTP requests!
{% endstep %}

{% step %}
**Cleanup**

After you are done with mocking, you can optionally disable the intercept mock mode with:

```
stoobly-agent intercept disable
```

{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stoobly.com/guides/how-to-mock-apis/how-to-enable-mocking/enabling-from-the-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
