Notă
Accesul la această pagină necesită autorizare. Puteți încerca să vă conectați sau să modificați directoarele.
Accesul la această pagină necesită autorizare. Puteți încerca să modificați directoarele.
Starts Dev Proxy.
Synopsis
devproxy [options]
Options:
-c, --config-file <file> Configuration file path (default: devproxyrc.json)
-u, --urls-to-watch <urls> URLs to intercept (supports wildcards)
-p, --port <port> Proxy port (default: 8000)
--ip-address <ipAddress> Proxy bind address (default: 127.0.0.1)
--api-port <apiPort> API port (default: 8897)
--api-ip-address <address> API bind address (default: 127.0.0.1)
--log-level <level> Logging level: trace|debug|information|warning|error
--output <format> Output format: text|json (default: text)
--record Start recording immediately
--report-dir <path> Folder where reporters write report files
--discover Run in URL discovery mode
--watch-pids <pids> Process IDs to watch
--watch-process-names <names> Process names to watch
--watch-process-tree Also watch descendants of watched processes
-e, --env <env> Environment variables to set for the Dev Proxy process (name=value)
--as-system-proxy <true|false> Register Dev Proxy as the system proxy (default: true, false when CI is set). See https://go.devproxy.net?go=system-proxy
--install-cert <true|false> Install and trust the root certificate (default: true, false when CI is set). On Linux, trust it manually
--no-first-run Skip the first run experience
-t, --timeout <seconds> Auto-stop after inactivity
--no-watch Disable config file auto-restart on changes
--no-color Disable colored output
--detach Run proxy in the background (detached mode)
--version Show version
-?, -h, --help Show help and usage information
Usage
devproxy
Tip
To check your configuration file for errors without starting Dev Proxy, use the validate command.
Arguments
None
Subcommands and options order
When you run a subcommand, like api show or config get, specify the subcommand as the first argument and put options after it. Options that apply to all commands, like --log-level and --output, work after the subcommand too.
devproxy api show --log-level debug
If you put options before a subcommand, Dev Proxy shows an error message and exits with code 2:
Options must follow the subcommand. Use: devproxy api show [options]
When you use --output json, Dev Proxy writes the error as a JSON log entry. For example, devproxy --detach api show fails instead of running api show.
Subcommands print messages as plain text without the text labels that Dev Proxy uses when it runs as a proxy. For more information, see Console output text labels.
Options
| Name | Description | Allowed values | Default |
|---|---|---|---|
--api-ip-address <apiIpAddress> |
The IP address for the Dev Proxy API to bind to. This address is independent of --ip-address. Use a non-loopback address only on trusted networks because bearer tokens are sent over HTTP. |
IPv4 or IPv6 address | 127.0.0.1 |
--api-port <apiPort> |
The port for the Dev Proxy API to listen on. Set to 0 to let the OS assign a random available port. |
integer | 8897 |
--as-system-proxy <true\|false> |
Whether to register Dev Proxy as the system proxy on startup. When set to true requires installCert to be, set to true. Specifying the option without a value is the same as true. When the CI environment variable is set, defaults to false unless you set asSystemProxy in the configuration file. For more information, see Use the system proxy option |
true, false |
true (false when CI is set) |
-c, --config-file <configFile> |
The path to the configuration file | Local file path | devproxyrc.json |
--detach |
Run Dev Proxy in the background (detached mode) | n/a | n/a |
--discover |
Run Dev Proxy in discovery mode | n/a | n/a |
-e, --env <env> |
Environment variables to set for the Dev Proxy process. Values replace the same variables set in the env setting of the configuration file. You can reference these values using ${name} placeholders in the configuration file and in plugin data files. Dev Proxy also uses them to replace the deprecated {name} placeholders in API spec files used by the MinimalPermissions plugins and the OpenApiMockResponsePlugin. Changes to HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, or NO_PROXY (including lowercase variants) require stopping and starting Dev Proxy because hot reload can't refresh cached HTTP proxy settings. |
One or more space-separated name=value pairs, for example, CI=1 |
n/a |
--install-cert <true\|false> |
Whether to install and trust the root certificate. Specifying the option without a value is the same as true. On Linux, you need to trust the certificate manually. When the CI environment variable is set, defaults to false unless you set installCert in the configuration file. For more information, see Use Dev Proxy in CI/CD scenarios |
true, false |
true (false when CI is set) |
--ip-address <ipAddress> |
The IP address for the proxy to bind to | IPv4 address | 127.0.0.1 |
--log-level <loglevel> |
Level of messages to log | trace, debug, information, warning, error |
information |
--no-color |
Disable colored output. Can also be set via a non-empty NO_COLOR environment variable or TERM=dumb. An empty NO_COLOR value doesn't disable colored output |
n/a | n/a |
--no-first-run |
Skip the first run experience (don't trust certificate on macOS) | n/a | n/a |
--no-watch |
Disable automatic proxy restart when the configuration file changes | n/a | n/a |
--output <format> |
Output format for structured logging. See JSON output and results | text, json |
text |
-p, --port <port> |
The port for the proxy server to listen on. Set to 0 to let the OS assign a random available port. |
integer | 8000 |
--record |
Use this option to record all request logs | n/a | n/a |
--report-dir <path> |
Folder where reporters write report files. Overrides the reportsFolder setting from the configuration file. Relative paths resolve against the current working directory, also when you use --detach. Supports the ~/, ~appFolder, and ~dataFolder path tokens. Dev Proxy creates the folder if it doesn't exist. If the path points to an existing file, Dev Proxy doesn't start and shows an error. |
Folder path | Current working directory |
-t, --timeout <seconds> |
Automatically stop proxy after a period of inactivity | integer | n/a |
-u, --urls-to-watch <urlsToWatch> |
List of URLs that proxy should intercept | Absolute URL (can contain wildcards) for example, "https://api.contoso.com/*" |
See devproxyrc file |
--version |
Show version information | n/a | n/a |
--watch-pids <pids> |
The IDs of processes to watch for requests | One or more space-separated integers | n/a |
--watch-process-names <processNames> |
The names of processes to watch for requests | One or more space-separated names | n/a |
--watch-process-tree |
Also watch descendants (child processes) of processes selected by --watch-pids or --watch-process-names |
true, false |
false |
-?, -h, --help |
Show help and usage information | n/a | n/a |
Detached mode output
When you start Dev Proxy with the --detach option, it runs in the background and prints startup information to the console.
Text output (default)
Dev Proxy started in background.
PID: 6456
Proxy URL: http://127.0.0.1:8000
API URL: http://127.0.0.1:8897
API token: <token>
Log file: /Users/user/.local/dev-proxy/logs/devproxy-6456-2026-03-05.log
JSON output
When you use --output json with --detach, Dev Proxy outputs single-line JSONL for machine parsing:
Success:
{"type":"result","data":{"pid":6456,"proxyUrl":"http://127.0.0.1:8000","apiUrl":"http://127.0.0.1:8897","token":"<token>","logFile":"/Users/user/.local/dev-proxy/logs/devproxy-6456-2026-03-05.log"},"timestamp":"2026-03-05T14:22:42.0000000Z"}
Error:
{"type":"log","level":"error","message":"Dev Proxy is already running (PID: 6456). Use 'devproxy stop' to stop it first.","timestamp":"2026-03-05T14:22:42.0000000Z"}
Tip
Use --port 0 to let the OS assign a random available port. The Proxy URL in the output shows the actual port assigned by the OS.
Dev Proxy omits the API token from startup output when the CI environment variable is set, including when you set it using --env or the env setting in the configuration file. Use devproxy api token --pid <PID> to retrieve it explicitly.
Port conflicts
Before it starts, Dev Proxy checks if the proxy port and the API port are available. If a port is already in use, Dev Proxy shows an error message and exits with code 1. When another Dev Proxy instance uses the port, the message includes the instance's process ID:
Port 8000 is already in use by another Dev Proxy instance (PID: 1234).
Stop the existing instance with 'devproxy stop --pid 1234' or use a different port:
devproxy --port 0 (lets the OS assign a free port)
When another application uses the port, the message suggests using a different port:
API port 8897 is already in use by another application.
Use a different port:
devproxy --api-port 0 (lets the OS assign a free port)
You can also set 'apiPort' in your devproxyrc.json config file.
When you use --detach and the background process exits early, Dev Proxy shows the contents of its log file so that you can see why it failed to start. When you use --output json, Dev Proxy outputs the error message as JSON.
JSON output and results
When you use --output json, Dev Proxy writes log messages and command results as single-line JSON objects (JSONL). Commands that return data, like status, stop, outdated, config get, api show, and jwt create, emit result records with the command's data in the data property.
Dev Proxy always emits result records, even when you set the log level to warning or higher using --log-level or the logLevel setting. The log level only filters diagnostic log messages.
If Dev Proxy can't parse the command line, for example because of an invalid option value, an unknown option, or a missing argument, it writes each error as a JSON log entry to stderr and exits with code 2:
{"type":"log","level":"error","message":"'abc' is not a valid port. Specify a number between 0 and 65535.","timestamp":"2026-11-30T10:15:00.0000000Z"}
If the value of the --output option itself is invalid, for example --output xml, Dev Proxy writes the error as plain text.
Documentation links
The help output of every command (--help) ends with a Docs: line that links to the command's documentation using a stable shortlink, for example:
Docs: https://go.devproxy.net?go=cli-config-get
- The root command and command groups, like
apiorcert, link to the CLI reference (https://go.devproxy.net?go=cli). - Other commands link to their reference page (
https://go.devproxy.net?go=cli-<command path>), for examplecli-api-showfordevproxy api show. - Commands contributed by plugins shipped with Dev Proxy link to the plugin's reference page, for example
https://go.devproxy.net?go=mockresponsepluginfordevproxy mocks. Commands contributed by third-party plugins don't include a docs link.
When a plugin shipped with Dev Proxy fails to load or initialize, has no URLs to watch, or has a configuration that doesn't match its schema, the error message ends with a link to the plugin's reference page, for example:
Plugin MockResponsePlugin must have at least one URL to watch. Please add a URL to watch in the configuration file or use the --urls-to-watch option. Docs: https://go.devproxy.net?go=mockresponseplugin
API token
By default, Dev Proxy generates a random API token each time it starts. To use a fixed token instead, set the DEV_PROXY_API_TOKEN environment variable (at least 32 characters) before you start Dev Proxy or pass it using the --env option. If the value isn't valid, Dev Proxy doesn't start and exits with code 1. For the token requirements, see Proxy API.
Exit codes
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Runtime error |
2 |
Invalid input or usage |