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 for the command list, then use this docs section for per-command reference.

Both tma init and tma link create .tma/project.json, but with different shapes:

tma init writes a local scaffold config:

{
"projectName": "my-app"
}

tma link writes the full linked-project config used by authenticated commands:

{
"projectId": "11111111-2222-4333-8444-555555555555",
"orgId": "66666666-7777-4888-8999-000000000000",
"projectName": "my-app"
}

Run tma link after tma init before using commands that require a linked project (deploy, env, logs, bot).

Commit .tma/project.json, but ignore local runtime artifacts under .tma/:

.tma/*
!.tma/project.json

See Commands for the full reference on each command.