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.1.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::LocalClient;

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

Python

from tslocal import LocalClient

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

TypeScript

import { LocalClient } from "tslocal";

const client = new LocalClient();
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.1.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.1.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tslocal-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 10a1800b7f70503f446da6dd439cecb34665108c84a61cdbd646294d31a32cda
MD5 258e86c9d635b5a88d851f55d573b589
BLAKE2b-256 97a8fc5a6133cdb161b8bc64fdb747831355dda59be50bc7c90d51b369843751

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tslocal-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab858130d91948ba5ab6c96d6bd093e588d1721bb4b898f5a9418cff08421bae
MD5 2b8c250a6e5fa4a95add19358985d5fd
BLAKE2b-256 b06055e27e3f2df5f5c1534203d64270b76fe0ceb9298b92108542f984599672

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