Skip to content

CLI Overview

The tma CLI is the primary tool for developing and deploying Telegram Mini Apps on TMA.sh. It handles project scaffolding, local development, deployment, environment variable management, and bot configuration.

Terminal window
bun add -g @tma.sh/cli

Verify the installation:

Terminal window
tma --version
CommandDescription
tma loginAuthenticate with TMA.sh
tma logoutClear stored credentials
tma init [name]Create a new project
tma linkLink current directory to existing project
tma devStart local development server
tma deployDeploy to production
tma envManage environment variables
tma logsView deployment build logs
tma botConfigure Telegram bot settings

Run tma --help or tma <command> --help for usage details on any command.

When you run tma init or tma link, the CLI creates a .tma/project.json file in your project root:

{
"projectId": "proj_abc123",
"orgId": "org_xyz789",
"projectName": "my-app"
}

This file tells the CLI which TMA.sh project this directory belongs to. Commit it to version control so your team and CI pipelines can resolve the project automatically.

See Commands for the full reference on each command.