Skip to main content

Client library for the Tailscale Local API

Project description

tslocal

Client libraries for the Tailscale Local API in Rust, Python, and TypeScript.

These are direct ports of the official Go client (tailscale/client/local), targeting Tailscale v1.94.1.

Libraries

Language Path Runtime
Rust rust/ async/tokio
Python python/ sync
TypeScript ts/ Node.js

Installation

Rust — add to Cargo.toml:

[dependencies]
tslocal = "0.3.2"

Python:

pip install tslocal

TypeScript:

npm install tslocal

Usage

All three libraries communicate with the local Tailscale daemon over a Unix domain socket. The daemon must be running on the same machine.

Rust

use tslocal::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let status = client.status().await?;
    println!("Tailscale version: {}", status.version);
    Ok(())
}

Python

from tslocal import Client

with Client() as client:
    status = client.status()
    print(f"Tailscale version: {status.version}")

TypeScript

import { Client } from "tslocal";

const client = new Client();
const status = await client.status();
console.log(`Tailscale version: ${status.Version}`);
client.destroy();

Supported Methods

Description Go Rust Python TypeScript
Get full node status including peers Status status status status
Get node status without peer information StatusWithoutPeers status_without_peers status_without_peers statusWithoutPeers
Look up identity by IP address WhoIs who_is who_is whoIs
Look up identity by node key WhoIsNodeKey who_is_node_key who_is_node_key whoIsNodeKey
Look up identity with proto and address WhoIsProto who_is_proto who_is_proto whoIsProto
Get TLS certificate and private key CertPair cert_pair cert_pair certPair
Get TLS certificate with minimum validity CertPairWithValidity cert_pair_with_validity cert_pair_with_validity certPairWithValidity
Get current serve configuration GetServeConfig get_serve_config get_serve_config getServeConfig
Set serve configuration SetServeConfig set_serve_config set_serve_config setServeConfig

Build & Test

# Rust
cargo test
cargo check
cargo clippy

# Python
uv run pytest

# TypeScript
npm test
npx tsc --noEmit

License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tslocal-0.3.2.tar.gz (4.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tslocal-0.3.2-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file tslocal-0.3.2.tar.gz.

File metadata

  • Download URL: tslocal-0.3.2.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tslocal-0.3.2.tar.gz
Algorithm Hash digest
SHA256 6753b89723d46dcdb532814ee636dea43284f6d2890a648f3d48861ac2faf137
MD5 60c819c0cffde363ff2fb333cac68e00
BLAKE2b-256 5be9668ebd0001467fd8e61707e5f2028e1eea775631e5da5a10efd1f148f48a

See more details on using hashes here.

File details

Details for the file tslocal-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: tslocal-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tslocal-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf3cedf32cae572383c489fc6bbe7bc0154d643d3c24e5d744e12312eb1322d1
MD5 2559d1cab5657667248cfb6c7c153968
BLAKE2b-256 038253891e858f70522d225f59ce6503b20505e0a4a2d9d9ac0f3f496725c1b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page