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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tslocal-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 419cb23666038219b7dc74e0e7ad8ed6e9725b1c95e8ac07be2f922fec2bd5ff
MD5 45c86bb0f157bc6b8615bc2e82c7a0bd
BLAKE2b-256 2365ec72ce8f1e45514d64083f4073125c82c417717f395632387b089d714635

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tslocal-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2fe072ae04a78cddb0edb737b61a557f6ca1f26d42d28959480ec0c5b5a20c7
MD5 69b57e82e1327ba1c344b1bd01a1d5d3
BLAKE2b-256 e414df5df2f2a7a67a9ee4946a0a569e5e4988ec32052a6aadb894e828f52aec

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