Repository navigation
Adding a router or switch no longer means editing YAML. mikromcp device add asks the questions for a RouterOS router or a SwOS switch, tests the connection, and writes routers.yaml and .env; device list and device remove manage what is there. Requested in #170 by @Laznology. This release also fixes mikromcp init wiping an existing .env when run a second time.
Upgrading from 1.18. mikromcp init asks whether to use HTTPS before it asks for the port, and suggests 443 for HTTPS instead of 80. Scripts that drive its prompts need the new order. The server itself is unchanged.
Added
mikromcp device add,device listanddevice removemanage the RouterOS routers and SwOS switches inrouters.yamlwithout editing it by hand or running the whole setup wizard again.device addasks for the device type (or takes--type routeros|swos), then only the questions that type needs: TLS, certificate pinning and RouterOS version for a router; none of them, port 80 and an allowed empty factory password for a switch. It offers a connection test (RESTsystem/resource, or SwOSsys.b), validates the result with the server's own schema before writing, keeps the comments and formatting inrouters.yaml, and adds the credentials to~/.mikromcp/.envnext to the existing ones. A credential prefix another device already uses can share its credentials, and an existing id is replaced only after confirmation.device listshows each device's type, address, tags, the default, and whether its credentials are set.device removealso offers to remove credentials no other device uses, and clearsMIKROMCP_DEFAULT_ROUTERwhen it named the removed device (#170).mikromcp initsets up a SwOS switch as well as a RouterOS router, and offers the same connection test before writing anything. It now asks whether to use HTTPS first, then suggests port 443 or 80 to match, and the password is no longer echoed as you type it.
Fixed
- Running
mikromcp initagain with an existing~/.mikromcp/.envno longer replaces the file. Before, it deleted the credentials of every device added earlier, any setting you had changed, and generated a newMIKROMCP_CONFIRMATION_SECRET. The file is now merged: init sets the new device's credentials, the transport and (if chosen) the default router, and leaves everything else alone..envis created owner-only (0600), and a password with spaces,#or quotes is quoted so dotenv reads it back intact.