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.0"

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.0.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.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tslocal-0.3.0.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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.0.tar.gz
Algorithm Hash digest
SHA256 d4d1fb87b02c5c2a4a90ef4ee1c93962c1f059862fccb69a35bb23fe1c53e0cd
MD5 282307dc149068b63e2d915f7d926cfc
BLAKE2b-256 a39a40c34b4ee53a588d11b1166773fc238bcfbb565da5446d72b9fe63fcd4ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tslocal-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fac031d002a561f13e245d4bf84b63f0c02c4ff3abc75ea2f999701cbcac3c7
MD5 dcc43b9fadc1b1f9a43eb272671e7e5d
BLAKE2b-256 f4333d490f8dbda3f728b4dfce76f422fcd92548c479149394949b1cea7805fd

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