Skill: sahil1005/tailscale-orchestrator (version 1.0.0)

# SKILL.md name: Tailscale Network Orchestrator slug: tailscale-orchestrator summary: Manage your Tailscale network and devices directly from ClawBot. description: |- This skill provides commands to check Tailscale status, list connected devices, and perform basic network operations. It leverages the `tailscale` command-line interface (CLI) installed on the host machine where ClawBot is running. This allows for secure and direct management of your Tailscale network without exposing sensitive API keys directly to the skill. author: Manus AI version: 0.1.0 trigger: - "manage tailscale" - "tailscale status" - "list tailscale devices" commands: - name: status description: Displays the current Tailscale status, including connection state and active nodes. usage: "status" script: python3 main.py status - name: devices description: Lists all connected devices in your Tailscale network with their status and IP addresses. usage: "devices" script: python3 main.py devices

path: requirements.txt
content: # No specific Python dependencies beyond built-in modules.
# This skill relies on the 'tailscale' CLI being installed on the host system.


path: README.md
content: # Tailscale Network Orchestrator Skill for ClawBot

## Overview

The **Tailscale Network Orchestrator** is a ClawBot skill designed to provide direct management and monitoring of your Tailscale network and connected devices. It leverages the `tailscale` command-line interface (CLI) installed on the host system where ClawBot is running. This allows for secure and direct interaction with your Tailscale network, enabling you to check status and list devices without needing to expose sensitive API keys directly within the skill's code.

## Features

*   **Tailscale Status:** Get a summary of your Tailscale connection status.
*   **Device Listing:** View all connected devices in your Tailscale network, including their IP addresses and online status.
*   **Secure Operation:** Relies on the locally installed `tailscale` CLI, avoiding the need for API key management within the skill itself.

## Prerequisites

This skill requires the **Tailscale CLI** to be installed and configured on the system where your ClawBot instance is running. If you haven't already, please install Tailscale by following the official instructions:

*   [Install Tailscale](https://tailscale.com/download)

Ensure that the `tailscale` command is accessible in your system's PATH.

## Installation

1.  **Create Skill Directory:** Create a new folder named `tailscale-orchestrator` in your ClawBot skills directory (e.g., `~/.openclaw/skills/` or `<project>/skills/`).
2.  **Download Files:** Place the `SKILL.md`, `main.py`, `requirements.txt`, and `README.md` files into this new directory.
3.  **No Python Dependencies:** This skill uses only standard Python libraries and the `tailscale` CLI, so no `pip install` is required for Python dependencies.

## Usage

Once installed and configured, you can trigger the skill via your ClawBot interface using phrases like:

*   "manage tailscale"
*   "tailscale status"
*   "list tailscale devices"

### Examples

*   To get the current Tailscale status:
    ```
    ClawBot, tailscale status
    ```
*   To list all connected devices:
    ```
    ClawBot, list tailscale devices
    ```

## Security Considerations

*   **Local CLI Dependency:** This skill executes local `tailscale` CLI commands. Ensure your ClawBot environment is secure and that you trust the `tailscale` CLI installation.
*   **Permissions:** The user running ClawBot must have appropriate permissions to execute `tailscale` commands.

## Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests on the GitHub repository for this skill.

## License

This project is licensed under the MIT License - see the `LICENSE` file for details.


path: main.py
content: 
import subprocess
import sys
import json

def run_tailscale_command(command_args):
    """Runs a tailscale CLI command and returns its output."""
    try:
        # Prepend 'tailscale' to the command arguments
        full_command = ["tailscale"] + command_args
        result = subprocess.run(full_command, capture_output=True, text=True, check=True)
        return result.stdout.strip()
    except FileNotFoundError:
        print("Error: Tailscale CLI not found. Please ensure Tailscale is installed and in your system PATH.", file=sys.stderr)
        sys.exit(1)
    except subprocess.CalledProcessError as e:
        print(f"Error executing Tailscale command: {e.stderr.strip()}", file=sys.stderr)
        sys.exit(1)
    except Exception as e:
        print(f"An unexpected error occurred: {e}", file=sys.stderr)
        sys.exit(1)

def get_status():
    """Retrieves and formats the Tailscale status."""
    output = run_tailscale_command(["status", "--json"])
    try:
        status_data = json.loads(output)
        # Extract relevant information for a concise summary
        summary = []
        summary.append(f"Tailscale Status: {status_data.get("BackendState", "Unknown")}")
        summary.append(f"  Logged In: {status_data.get("Self", {}).get("Online", False)}")
        summary.append(f"  IP Address: {', '.join(status_data.get("Self", {}).get("TailscaleIPs", []))}")
        summary.append(f"  Hostname: {status_data.get("Self", {}).get("HostName", "N/A")}")
        summary.append(f"  Peers: {len(status_data.get("Peer", {}))}")
        return "\n".join(summary)
    except json.JSONDecodeError:
        return f"Raw Tailscale status:\n{output}"

def list_devices():
    """Lists connected Tailscale devices."""
    output = run_tailscale_command(["status", "--json"])
    try:
        status_data = json.loads(output)
        devices = []
        for peer_id, peer_data in status_data.get("Peer", {}).items():
            device_name = peer_data.get("HostName", "Unknown")
            ips = ", ".join(peer_data.get("TailscaleIPs", []))
            online = "Online" if peer_data.get("Online", False) else "Offline"
            devices.append(f"- {device_name} ({ips}) - {online}")
        if not devices:
            return "No other Tailscale devices found."
        return "\n".join(["Connected Tailscale Devices:"] + devices)
    except json.JSONDecodeError:
        return f"Raw Tailscale devices list:\n{output}"

def main():
    if len(sys.argv) < 2:
        print("Usage: python3 main.py [status|devices]", file=sys.stderr)
        sys.exit(1)

    action = sys.argv[1]

    if action == "status":
        print(get_status())
    elif action == "devices":
        print(list_devices())
    else:
        print(f"Unknown action: {action}. Use 'status' or 'devices'.", file=sys.stderr)
        sys.exit(1)

if __name__ == "__main__":
    main()


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)