Deploy and control your applications from the terminal
Sign in with a code in your browser, deploy any folder with one command, and reach logs, databases and workspaces from the same prompt, with output your scripts can read.
Install with one command
The install script and the npm package download the build for your system from the latest release and check its checksum before installing it.
macOS, Linux and WSL
curl -fsSL https://cli.squarecloud.app/install | bashInstalls to /usr/local/bin, so it may ask for your password.
Windows
npm i -g @squarecloud/cliNeeds Node.js with npm. The same command also works on macOS and Linux.
- Checked against the release's SHA-256 checksums
- Builds for x86 and ARM, Apple silicon included
- To update, run the same command again
Sign in without copying a key
The CLI shows a code, you approve it in your browser and the terminal gets a key of its own, the same way the VS Code extension connects.
- 1
The terminal shows a code
Run the login command and your browser opens on the approval page, while the terminal shows an eight-character code and a countdown.
- 2
You approve it in the browser
Type the code on the Square Cloud page and approve. Never enter a code that someone sent you.
- 3
The CLI is signed in
The terminal confirms your account and saves a key made for it, with only the permissions its commands use.
- Each key lasts 90 days, and
auth whoamishows until when - Asks before replacing another account on this machine
- Over SSH,
--no-browserprints the link to open anywhere - Have a key already? Use
--tokenor--with-token
Deploy from any folder
Upload the folder you're in as a new application, send changes to one that already exists, or link a GitHub repository so every push deploys it.
Upload an application
The CLI zips the current folder with your ignore rules, creates the application and prints the link to its page in the dashboard.
uploadupload --file- Or send a zip you already have
- Writes the new ID into squarecloud.app, if the project has one
Commit changes
Send the folder, or a zip, to an application that already exists. It keeps its ID, domain and settings.
commitcommit -rcommit --path- Restarts the application afterwards, if you ask
- Can place the files in a folder of the application
Deploy on every push
Link a repository and branch through the Square Cloud GitHub App, or create a webhook with a GitHub token, without leaving the terminal.
app deploy github linkapp deploy webhookapp deploy list- Lists recent deployments with commit, state and branch
- Or run the CLI in GitHub Actions
One ignore file for the CLI and VS Code
upload, commit and zip leave out what squarecloud.ignore lists in the root of your project. The VS Code extension reads the same file, with the same rules.
The syntax of .gitignore
#for comments,!to bring a path back,dir/for folders only,/buildfor the root only, and*,?,[abc]and**. The last matching line wins, and case doesn't matter.Sensible defaults
node_modules,.git,.github,.vscodeand the npm, pnpm and Yarn lockfiles stay out before your rules run. A line like!yarn.lockbrings one back.Check before you send
squarecloud zipbuilds the same archive in your folder, so you can open it and see exactly what would go up.
Variables arrive exactly as you typed them
Your application loads its variables through a shell. Since version 3.1.1, the CLI sends values with spaces or characters such as $, & or ; in quotes, so the shell can't cut them short or expand them.
Set from the terminal
Pass as many KEY=VALUE pairs as you like. The CLI takes the application from squarecloud.app or lets you pick it from a list.
app env setapp env list- Single quotes, or double when the value has one
- A value already in quotes is sent as written
Load a .env file
Reads KEY=VALUE lines from a file and skips comments and blank lines. Lines that start with export and quoted values work too.
--from-file .env- Works when you set or replace variables
- The list shows them back as KEY=VALUE
Safe bulk changes
Replace every variable at once, or remove them all. Both ask before changing anything, and a replace needs at least one new variable.
app env replaceapp env remove --all-y- A flag answers yes for you in scripts
- Answer no and nothing changes
Made for scripts and CI
Output a program can read, exit codes that mean what they say and a key that works without a browser.
JSON on request
Commands that print data can answer in JSON, with only the result on stdout. The others refuse the flag with an error rather than print text a parser would trip on.
--jsonHonest exit codes
Every failure exits with 1. When a confirmation can't be asked, with no terminal and no flag to answer it, the command fails and changes nothing.
-yA clean stdout
Errors, questions and notices go to stderr, and so does the progress when you ask for JSON, so a pipe carries only the result.
stdoutstderrA key for pipelines
Set a key from your account as an environment variable and every command uses it, with no login. When CI is true, the browser login won't start.
SQUARECLOUD_API_KEYCI=trueTraces safe to share
One variable prints the method, path, status and duration of each API call to stderr, never headers, query strings or bodies.
SQUARECLOUD_DEBUG=1GitHub Actions
The Square Cloud Action installs the CLI on the runner, checks it against the release checksums and runs any command with your key.
squarecloudofc/github-action@v2
The rest of the platform, too
Logs, metrics, files, snapshots, domains, databases and workspaces, each one a command away.
Logs and live stream
Print the latest lines, or follow the output live along with each status change. Lines your application writes to stderr stay on stderr.
app logsapp realtimeStatus and metrics
CPU, memory, disk and uptime for one application or a line for each of them, plus the last 24 hours of metrics.
app status --allapp metricsRemote files
List, read, write, move and delete the application's files. Writing from a file keeps binaries intact, and reading into one asks before overwriting it.
app file readapp file writeSnapshots
Create a snapshot and download it, list its versions and restore one, for applications and databases.
app snapshot createdb snapshot restoreDomains and traffic
Set a custom domain, get the DNS records to create, read analytics, errors and performance from the edge, and purge the cache.
app network domainapp network analyticsDatabases
Create MongoDB, MySQL, PostgreSQL and Redis databases, start or stop them, download the TLS certificate and rotate the password.
db createdb credentials reset
Careful, open and in your language
In eight languages
Messages, help and tables follow your system's display language on every run. LC_ALL picks another one for a single command.
No ID to memorize
Most commands take the application from squarecloud.app, or list yours so you can pick one.
Asks before deleting
Deleting, replacing every variable, restoring a snapshot or purging the cache asks first, and scripts can confirm with a flag.
Open source
The code is on GitHub, and each release publishes its builds with SHA-256 checksums.
A plan for every stage of your project
Start small and scale when you need to, with no loyalty contracts.
Hobby
To validate ideas, bots and personal projects
From R$12.49/mo ≈ $2.25
- 1 GB RAM
- 1 vCPU
- Up to 4 projects
- Scales up to 2 GB on the same plan
Standard
RecommendedFor production, with databases and custom domains
From R$44.99/mo ≈ $8.10
- 4 GB RAM
- 4 vCPU
- Up to 16 projects
- Scales up to 8 GB on the same plan
Pro
For high scale, with daily application snapshots and advanced analytics
From R$124.99/mo ≈ $22.50
- 12 GB RAM
- 6 vCPU
- Up to 48 projects
- Scales up to 24 GB on the same plan
4.9 out of 5 · 402 reviews on Google + TrustpilotTrustpilot