Skip to main content

tgbotspec

lint test codecov version license

tgbotspec turns the official Telegram Bot API reference into an OpenAPI 3.0 specification. Use the generated file with SDK generators, API explorers, or your own tooling.

Features

  • Methods: all Telegram Bot API methods are included as OpenAPI paths with proper HTTP verbs and parameters.
  • Objects: all Bot API objects are generated as reusable component schemas.
  • Any‑of/one‑of types: union types from the docs are modeled with OpenAPI anyOf/oneOf (and refs) so generators can produce correct sum types.
  • Authorization: bearer token (TelegramBotToken) with server URL https://api.telegram.org/bot{botToken}.

Examples

Run in Docker

You can run the tool in a container and capture the generated OpenAPI to a file.

  • Using the published image from GHCR:
docker run --rm ghcr.io/metalagman/tgbotspec:latest > openapi.yaml

Run from binary

Download the latest release for your platform from GitHub Releases and run:

./tgbotspec -o openapi.yaml

Build and run locally

All commands require Go 1.26.4+ when building locally.

  • (Recommended) Add the CLI as a tool to your project and run it:
go get -tool github.com/metalagman/tgbotspec/cmd/tgbotspec@latest
go tool tgbotspec -o openapi.yaml
  • Install the CLI into your GOPATH/bin and run it:
go install github.com/metalagman/tgbotspec/cmd/tgbotspec@latest
tgbotspec -o openapi.yaml
  • Or build a local binary from this repo and run it:
go build -o tgbotspec ./cmd/tgbotspec
./tgbotspec -o openapi.yaml

Multi-platform Distribution (Omnidist)

This repository includes Omnidist configuration in .omnidist/omnidist.yaml and a generated GitHub Actions workflow at .github/workflows/omnidist-release.yml.

Local Omnidist commands (using npm package @omnidist/omnidist@latest):

task omnidist:build
task omnidist:stage
task omnidist:verify

One-time Omnidist bootstrap in this repo:

task omnidist:init
task omnidist:ci

Tag-based npm publishing uses trusted publishing. Set UV_PUBLISH_TOKEN for the uv/PyPI workflow.

Maintainers: follow the Bot API refresh and release runbook to update the spec, validate it, and publish from main.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for tgbotspec 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for tgbotspec 0.2.8
File
tgbotspec-0.2.8-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
tgbotspec-0.2.8-py3-none-manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
tgbotspec-0.2.8-py3-none-manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
tgbotspec-0.2.8-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
tgbotspec-0.2.8-py3-none-macosx_10_13_x86_64.whl Python 3 none macOS 10.13+ x86-64 Details

Total release size: 49.8 MB

Release files / tgbotspec-0.2.8-py3-none-win_amd64.whl

Download URL tgbotspec-0.2.8-py3-none-win_amd64.whl
Size 10.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
9eddf1c42e695e6b5311862a618c7cc779a27cd07713a74345978e80bf79e2e5
BLAKE2b-256 checksum
How to use checksums
334a5560ac0b912d68b63e817a3111353e66cbe213a0163c528ffa36dc44b826
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tgbotspec-0.2.8-py3-none-manylinux2014_x86_64.whl

Download URL tgbotspec-0.2.8-py3-none-manylinux2014_x86_64.whl
Size 10.1 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
9f25c5232d7e1c2f5b97859fe3becc03bf5f32e0963aac232f3ecb445caee24b
BLAKE2b-256 checksum
How to use checksums
b72a8ee7c52db762cf4211b8f2654424d7864306268283bf52e0ec5ced269a3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tgbotspec-0.2.8-py3-none-manylinux2014_aarch64.whl

Download URL tgbotspec-0.2.8-py3-none-manylinux2014_aarch64.whl
Size 9.4 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
c5da44c5a19384d0e9d69328b847169f8b1f1f05172b147bc83663183192e075
BLAKE2b-256 checksum
How to use checksums
d267ba543f5d6ab906b7cbbd541337e2b7b03111dde4fb83fa2f00cc47d9559c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tgbotspec-0.2.8-py3-none-macosx_11_0_arm64.whl

Download URL tgbotspec-0.2.8-py3-none-macosx_11_0_arm64.whl
Size 9.6 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a1a0352da738eb257ea821422a5dfe127cfb53167e2f48339fa603c1535c1495
BLAKE2b-256 checksum
How to use checksums
93084776ce1b57603d144fa11a63e658f304b416e8f0b9883308e5004f01803a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tgbotspec-0.2.8-py3-none-macosx_10_13_x86_64.whl

Download URL tgbotspec-0.2.8-py3-none-macosx_10_13_x86_64.whl
Size 10.3 MB
Tags Python 3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
631de0760862232ee3cb16a0340de743de49df574633c72d3903c10285619f2b
BLAKE2b-256 checksum
How to use checksums
5b47683b699e4cb750d814b4851b54997ceac58cd9270c9f13adc78a876f64ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.8 This release

5 release files

0.2.7

5 release files

0.2.6

5 release files

0.2.5

5 release files

0.2.4

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page