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 or tma <command> --help for usage details on any command.
Project configuration
Section titled “Project configuration”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.