@@ -546,6 +546,43 @@ brev ports create my-instance 3000 --protocol http --public
546546brev ports create my-instance 8888 --protocol http --authorize me@example.com
547547```
548548
549+ #### Update a port
550+
551+ Update a mapping in place while preserving its ` port_id ` and public endpoint.
552+ Omit ` --id ` to select a mapping interactively. ` edit ` is an alias for ` update ` .
553+
554+ ``` bash
555+ brev ports update < instance-or-node> [flags]
556+ ```
557+
558+ ** Flags:**
559+ | Flag | Description |
560+ | ------| -------------|
561+ | ` --id ` | Update the exact mapping with this ` port_id ` ; omit to select interactively |
562+ | ` --destination-port ` | Change the destination port (1-65535) |
563+ | ` --allow ` | Replace source restrictions with this CIDR; repeat to add more than one |
564+ | ` --allow-anywhere ` | Clear all source restrictions |
565+ | ` --protocol ` | Change an HTTP mapping's origin protocol to ` http ` or ` https ` |
566+ | ` --authorize ` | Replace an HTTP mapping's authorized emails; repeat to add more than one |
567+ | ` --public ` | Allow unauthenticated public access to an HTTP mapping |
568+ | ` --json ` | Output the updated mapping as JSON |
569+
570+ ` --allow ` and ` --allow-anywhere ` cannot be combined. ` --authorize ` and
571+ ` --public ` cannot be combined. HTTP access and protocol flags are rejected for
572+ raw TCP, UDP, and SSH mappings. When one command updates multiple field groups,
573+ the API applies them in destination, source, protocol, then access order; those
574+ separate mutations are not transactional.
575+
576+ ** Examples:**
577+ ``` bash
578+ brev ports update my-instance --destination-port 8081
579+ brev ports update my-instance --id nport-abc123 --allow 203.0.113.10/32
580+ brev ports edit my-node --id nport-abc123 --allow-anywhere
581+ brev ports update my-instance --id nport-abc123 --protocol https
582+ brev ports update my-instance --id nport-abc123 --authorize me@example.com
583+ brev ports update my-instance --id nport-abc123 --public --json
584+ ```
585+
549586#### Close ports
550587
551588Select and close one port interactively, close an exact mapping by its
0 commit comments