Every command, parameter and example is in the th CLI reference.
Install
# Linux, macOS
curl -fsSL https://raw.githubusercontent.com/mrzack99s/thailandhosting-cli/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/mrzack99s/thailandhosting-cli/main/install.ps1 | iexThe scripts download th from GitHub and check its checksum before installing. With Go 1.23+ you can also run go install github.com/mrzack99s/thailandhosting-cli/cmd/th@latest.
Sign in
th auth login opens the Console. Check that the code matches your terminal, then click Approve. The sign-in lasts 90 days and is listed under Account → Sessions. Pick the Project and region once with th config set project … and th config set region ….
Static Web from a folder
th static-site deploy docs ./dist # creates the site on the first deploy
th static-site releases docs
th static-site rollback docs previous
th static-site domains add docs www.example.comBuild your site first (for example npm run build) and deploy the output folder. Each deploy is a release you can roll back to, and counts like a publish in your package.
Object Storage
th object-storage buckets create my-bucket
th object-storage cp ./report.pdf th://my-bucket/reports/
th object-storage cp -r ./backups th://my-bucket/backups
th object-storage sync ./public th://my-bucket/site --delete
th object-storage ls th://my-bucket/reports/
th object-storage sign th://my-bucket/reports/report.pdf --expires 1hDatabase and Cache
th database create app-db --engine postgres
th database public app-db --enable --allow 203.0.113.7/32 # your IP
th database connect app-db # opens psql with the credentials
th database credentials app-db
th database backups create app-db
th cache create sessions --engine thcache
th cache connect sessions # opens redis-cliThe private address works only inside your Project’s VPC; from your computer, turn public access on for your own address first.
Queue Service
th queue create jobs --visibility-timeout 60s
th queue send jobs '{"order": 1042}'
th queue receive jobs --max 10 --ack
th queue tail jobs # receive and acknowledge until Ctrl+CContainers have their own guide: Deploy from your computer or CI with the th CLI.
In CI
- Containers and Static Web: create an API key under Integrations → API keys with Containers: deploy (
run:write) or Static Web: deploy (static:write) and set it asTH_API_KEY. - Object Storage and Queue Service: create an access key on their pages and set
TH_OBJECT_STORAGE_KEY_ID/TH_OBJECT_STORAGE_SECRETorTH_QUEUE_KEY_ID/TH_QUEUE_SECRET.
Signed in on your own computer, th makes a short-lived Object Storage or Queue key for you (12 hours, with what your role allows), so you don’t need to create one.