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.
Installation
Section titled “Installation”bun add -g @tma.sh/cliVerify the installation:
tma --versionCommands
Section titled “Commands”| Command | Description |
|---|---|
tma login | Authenticate with TMA.sh |
tma logout | Clear stored credentials |
tma init [name] | Create a new project |
tma link | Link current directory to existing project |
tma dev | Start local development server |
tma deploy | Deploy to production |
tma env | Manage environment variables |
tma logs | View deployment build logs |
tma bot | Configure Telegram bot settings |
Run tma --help for the command list, then use this docs section for per-command reference.
Project configuration
Section titled “Project configuration”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.jsonSee Commands for the full reference on each command.