CLI Deploy — Usage¶
Once you've set up the CLI, use plitho to deploy from your local machine.
Basic Usage¶
plitho deploy --at <host> [options] <files...>
| Option | Description |
|---|---|
--at <host> |
Target SSH host alias or user@host (required) |
--config <path> |
Path to plitho.yml (default: ./plitho.yml) |
--nostream |
Don't stream logs after deployment |
-y, --yes |
Skip confirmation prompt |
-h, --help |
Show help |
Go App — Build and Deploy¶
The primary use case for CLI deploy: build a binary locally, deploy it.
# Build
go build -o server .
# Deploy
plitho deploy --at your-server -y ./server
Your plitho.yml:
apps:
- name: myapp
runtime: shell
process:
web:
cmd: ./server
server_port: 8080
No build step on the server — just the binary.
Static Site — Build and Deploy¶
Build with your toolchain, deploy the output:
# Build
npm run build # or hugo, mkdocs, etc.
# Deploy the dist folder
plitho deploy --at your-server -y ./dist
Your plitho.yml:
apps:
- name: mysite
runtime: static
process:
web:
cmd: ""
Rust App¶
# Build for release
cargo build --release
# Deploy
plitho deploy --at your-server -y ./target/release/myapp
Deploy Multiple Files¶
plitho deploy --at your-server -y ./server ./config/
The plitho.yml is always included automatically.
Deploy Current Directory¶
plitho deploy --at your-server -y ./
SSH Host Aliases¶
If you have an SSH alias configured:
# ~/.ssh/config
Host pn01
HostName your-server.example.com
Port 2222
User plitho
plitho deploy --at pn01 -y ./server
Confirmation Prompt¶
==================================================
Ready to Deploy
==================================================
Target Host : pn01
App Name : myapp (from ./plitho.yml)
Payload : ./server
Log Stream : Enabled
==================================================
Proceed? (y/N):
Skip it with -y:
plitho deploy --at pn01 -y ./server
CI/CD Integration¶
GitHub Actions (Go)¶
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- run: go build -o server .
- run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -p 2222 ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts
- run: plitho deploy --at ${{ secrets.SERVER_HOST }} --nostream -y ./server
Shell Script¶
#!/bin/bash
set -e
# Build
go build -o server .
# Deploy
plitho deploy --at production --nostream -y ./server
Troubleshooting¶
"Error: Config './plitho.yml' not found"¶
Make sure you're in the directory containing your plitho.yml, or use --config:
plitho deploy --config ./build/plitho.yml --at server -y ./server
"Error: Could not parse app name"¶
Your plitho.yml must have a name field:
apps:
- name: myapp
SSH connection fails¶
Test first:
ssh -p 2222 plitho@your-server ls