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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tslocal-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 382e55604e385ef65a328272ccc2408ccd82e9a9a9589f4f72ac844dfa0a1d1b
MD5 974382e0a37285871feb973fe8be46a6
BLAKE2b-256 6dba1f7b0fc554cdcb0493295e0c6503512a03cfd72f96c8bf3ab27c4027ded4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tslocal-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bfd56318add84977a0ee0c5dadb59a374a87960e2bb8753dac5333826271614a
MD5 34627b46823651bbe54e0969def39b23
BLAKE2b-256 c1acfce9bf88ba7ff8f0ccd5be4455eb67aa2d9c569d6eb5f9d852e5ebdf9109

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