Parsing/fetching my TS network IP addresses

Hi all, this is my first message here, so i’m a bit newbie.
first, thanks to tailscale staff to have bring such a nice platform, i’m enjoing it very much :).

i’m doing a linux project (with a connected raspberry PI w/raspbian distro). I’m quite familiar with command line, bash etc with basic programming experience.
basically i need to run a command line for each IP in my network as command line parameter, fetching IP list (i.e. parsing first coloumn of “./tailscale status” command). when turned on, raspberry fetches IP list and runs, for example:
bash~: mycommand

so i need to make a script to:

  1. run “tailscale status” (or other mean to fetch network’s IP list)
  2. parse IPs and make them variables
  3. run command line “mycommand -ip1 -ip2 …”

Optional but would be nice: When a new machine enters my network, it gets “detected” by the script which runs command for new entry only:
bash~: mycommand

next reboot, new entry get fetched at startup so no need to do anything more.

any suggestion?

I’d use tailscale status --json piped into jq to extract out just the IPs, and pipe that into xargs.

thank you, will try it