Shipback is an SFTP deployment tool for shared hosting environments, whose core feature is "undoable deployment." It solves the problem in traditional SFTP deployment where files cannot be rolled back after being accidentally overwritten, and is especially suited to shared hosting scenarios such as cPanel that lack git revert capability.
Purpose
Deploy a local folder to any SFTP host (cPanel, Plesk, DirectAdmin, regular VPS) and ensure that every deployment can be undone with a single command. It can be run manually, invoked from scripts, or handed to AI clients that support MCP, such as Claude Code and Cursor.
Main capabilities
- Backup before deployment: Before each overwrite, the files on the server that are being replaced are saved to the
_backup-<时间>/directory, and the added files and the SHA-256 checksum of each file are recorded. - Atomic writes: Each file is first uploaded as a
.shipback-part-<name>temporary file and then renamed into place as a whole, avoiding file corruption caused by connection interruptions. - One-click undo: The
--restorecommand restores the backed-up files and deletes the files added by this deployment. - Prevent overwriting online changes: If files on the server are manually modified after deployment, the restore operation stops and names the file; unless
--forceis used, and even a forced restore first backs up the modified copies. - Restores can also be undone: A restore operation likewise backs up the files it replaces, so it can be restored back again.
- Concurrency lock: During deployment or restore, a
.shipback-lockis held in the remote root directory and refreshed every 30 seconds to prevent multiple processes from writing at the same time. - Symlink safety: It never writes through symlinks or special files, avoiding writes outside the site.
- Drift detection:
--pull --dry-runshows changes on the server since the last deployment, avoiding accidentally overwriting online edits. - MCP server: Provides
shipback-mcpfor AI clients to call; the tools do not include dangerous operations such as deletion or skipping backups. - No-shell agent support: When the local app is running, tasks such as deploy, preview, pull, and restore can be submitted through a file queue.
- Local UI:
npm startstarts a local interface (http://127.0.0.1:4646),可管理站点、预览、部署、拉取、上传、浏览服务器和历史记录。 - Claude Code guard hook:
bin/claude-guard.jscan be added as a PreToolUse hook to prevent Claude from using--mirrorand--no-backupin commands.
Usage
- Install:
npm install -g shipback-sftp, or usenpx -p shipback-sftp shipback mysite --dry-run. - Run from source:
git clone https://github.com/aldohushi1-stack/shipback-sftp.git,npm install, thennode bin/cli.js. - Configuration: configure an entry for each site in
sites.json, supporting a password orprivateKeyPath. - Common commands:
shipback mysite --dry-run(preview),shipback mysite(deploy),shipback mysite --restore(undo),shipback mysite --pull --dry-run(view server changes),shipback mysite --backups(list backups). - Any command with
--jsonMachine-readable output is available. The exit code is 4 when a restore is rejected, and 5 when rejected due to a concurrency lock. - MCP configuration: in
mcp.jsonorclaude_desktop_config.json, configureshipback-mcp; the first time, you must first run a CLI command once to store the password in the system keychain.
Use cases
- Deployment environments such as cPanel shared hosting that have no git or SSH shell.
- Scenarios where an AI agent performs automatic deployment but security and controllability are required.
- When multiple people collaborate, or an agent and a human operate at the same time, concurrent overwrites need to be prevented.
- Emergency situations where a mistaken deployment needs to be rolled back quickly.
Limitations
- Requires Node 18+.
- Backups are stored on the same server and cannot replace the host's own backups; they cannot protect against loss of the hosting account.
- For files larger than 8 MB with the same size, they are treated as unchanged when there is no manifest hash.
- Undo does not cover databases, deployments using
--no-backup, cleaned-up backups, and other cases; see the undo commitment document for details. - On some shared hosts the SFTP port is not 22, or only whitelisted IPs are allowed; if the connection times out, check these two items.
- The password is stored in the operating system keychain and does not pass through the model; CI environments can provide it via the environment variable
SFTP_PASSWORD.