SnapDeploy

v0.1.2
io.github.somdip-2310/snapdeploy Checked 10 hours ago Published 1 month ago

Deploy and manage SnapDeploy apps from your AI assistant: builds, logs, env vars, add-ons, domains.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_apps

List the user's SnapDeploy containers with status and URL, plus plan, deploy-limit and free-hours state. Start here to find container ids/names.

get_status

Full status of one container (by name or id): state, URL, port, detected technology, resources. Env-var VALUES are never returned — names only.

ParameterTypeDescription
container *stringContainer name or id

get_logs

Recent RUNTIME logs of a container (CloudWatch, up to 1000 lines). For BUILD logs of a deployment use get_deployments with a deployment_id.

ParameterTypeDescription
container *stringContainer name or id
linesintegerLine count, default 100

get_deployments

Deployment history of a container, or one deployment in detail (status, error code/message and build-log tail — use this to diagnose a failed build).

ParameterTypeDescription
containerstringContainer name or id (for the list)
deployment_idstringOne deployment in detail
limitintegerList size, default 10

check_quota

Can the user deploy and run apps right now? Merges the deploy limit (5 per rolling 12h — ONLY for accounts without an Always-On/Sprint entitlement; failed attempts count) and the free-hours cap (containers refuse to start at 402 when exhausted), plus any unassigned Always-On subscriptions.

list_repos

List (or search) the GitHub repositories connected to this SnapDeploy account. If GitHub is not connected yet, returns the connect link for the user.

ParameterTypeDescription
pageinteger
querystringSearch text; omit to list

detect_env_vars

Scan a repo for the environment variables it needs (import.meta.env / process.env usage, .env.example, Dockerfile). For known keys (Supabase etc.) the reply says where the user finds the value. Do this BEFORE the first deploy of a Lovable/Bolt/v0 export. Rows with source DOCKERFILE and instruction ENV already have their value inside the image and follow the repository on every push: do NOT pass them to deploy's env unless the user wants a different value. Rows with instruction ARG are build arguments with a Dockerfile default; same rule.

ParameterTypeDescription
repo *stringowner/name
branchstring

deploy

Deploy a connected GitHub repo to SnapDeploy: creates the container if needed, links the repo, builds, and waits for the result. Reply includes the live URL or, on failure, the error and build-log tail. On accounts without an Always-On/Sprint entitlement this uses one unit of the deploy limit (failed attempts count); Always-On accounts are uncapped.

ParameterTypeDescription
repo *stringowner/name of a repo on the user's connected GitHub
branchstringBranch to deploy (default: repo default branch)
containerstringContainer name (default: repo name, lowercased)
envobjectEnvironment variables the USER wants set (VITE_*/public-prefixed ones are applied at build time). Do not repeat values that detect_env_vars reported as Dockerfile ENV/ARG defaults — the image alread…
portintegerApp port if auto-detection needs an override
sizestringContainer size: small (512 MB, free) | medium (2 GB, needs a STARTER Always-On) | large (4 GB, needs a PRO Always-On). Default small. If the account lacks the entitlement the platform returns its upgr…

set_env

Set/replace a container's environment variables (rolling restart, no rebuild). Values are accepted but NEVER echoed back. Public build-time names (VITE_*, NEXT_PUBLIC_*, REACT_APP_*) only take effect in the bundle after the next deploy.

ParameterTypeDescription
container *stringContainer name or id
env *objectFull desired map of env vars

start_container

Start a stopped container. May answer 402 when free hours are exhausted — relay that message and link, do not retry.

ParameterTypeDescription
container *stringContainer name or id

stop_container

Stop a running container (safe, reversible — deletion is NOT possible through this connector by design).

ParameterTypeDescription
container *stringContainer name or id

wake_container

Wake a sleeping free-plan container so its URL serves again.

ParameterTypeDescription
container *stringContainer name or id

create_database

Create a managed add-on: PostgreSQL, MySQL, MariaDB, MongoDB, Redis or RabbitMQ. Requires a purchased add-on subscription — without one this returns the purchase link (relay it, don't retry). Credentials are provisioned server-side and shown to the user in the SnapDeploy UI, never through this connector.

ParameterTypeDescription
type *stringEngine — POSTGRESQL is accepted as an alias of POSTGRES
containerstringContainer to link it to (name or id)
database_namestring
namestringAdd-on name

add_domain

Attach a custom domain to a container. Returns the DNS records the user must create; verification then runs from the SnapDeploy UI.

ParameterTypeDescription
container *stringContainer name or id
domain *stringe.g. app.example.com

assign_always_on

Attach an UNASSIGNED Always-On subscription to a container (keeps it running 24/7 and lifts the deploy limit). Only call this after the user explicitly confirms — check_quota lists any unassigned subscriptions.

ParameterTypeDescription
container *stringContainer name or id
subscription_id *stringFrom check_quota or a 402 reply's spareSubscriptionId

deploy_image

Deploy a Docker image from a LOCAL `docker save` file (.tar, .tar.gz or .tgz) on this machine. The file is uploaded straight to SnapDeploy's storage with a presigned URL (never through the API), loaded, pushed to the private registry and started. The image must be built for linux/arm64 (docker buildx build --platform linux/arm64); an amd64 image fails at build time with a rebuild hint. Free accounts may upload up to 2 GB; any Always-On subscription raises the cap (the platform returns its store link on 402 — relay it, do not retry). Uses one deploy-limit unit like other deploys.

ParameterTypeDescription
path *stringAbsolute path of the docker-save file on this machine
containerstringContainer name (default: derived from the file name)
portintegerPort the app listens on inside the container (default 8080)
sizestringsmall (512 MB, free) | medium (2 GB, STARTER Always-On) | large (4 GB, PRO Always-On)