{"id":19362678,"url":"https://github.com/svandriel/sftp-deployer","last_synced_at":"2025-04-23T12:33:05.354Z","repository":{"id":48710016,"uuid":"346646569","full_name":"svandriel/sftp-deployer","owner":"svandriel","description":"A command-line tool for lightning-fast SFTP deployments.","archived":false,"fork":false,"pushed_at":"2023-02-27T22:42:30.000Z","size":1767,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T10:34:36.947Z","etag":null,"topics":["cli","deploy","nodejs","sftp","ssh","upload","uploader"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svandriel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-11T09:26:26.000Z","updated_at":"2023-02-09T13:14:12.000Z","dependencies_parsed_at":"2024-11-14T21:42:09.896Z","dependency_job_id":"c62c2ef1-d538-4d2c-9447-2bb4c3019d4d","html_url":"https://github.com/svandriel/sftp-deployer","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svandriel%2Fsftp-deployer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svandriel%2Fsftp-deployer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svandriel%2Fsftp-deployer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svandriel%2Fsftp-deployer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svandriel","download_url":"https://codeload.github.com/svandriel/sftp-deployer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250435230,"owners_count":21430239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","deploy","nodejs","sftp","ssh","upload","uploader"],"created_at":"2024-11-10T07:29:53.524Z","updated_at":"2025-04-23T12:33:00.345Z","avatar_url":"https://github.com/svandriel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sftp-deployer\n\n[![Build status](https://github.com/svandriel/sftp-deployer/actions/workflows/node.js.yml/badge.svg?branch=master)](https://github.com/svandriel/sftp-deployer/actions/workflows/node.js.yml?query=branch%3Amaster)\n\n[![Version](https://img.shields.io/github/package-json/v/svandriel/sftp-deployer?color=%2300d000\u0026label=Latest%20version\u0026style=plastic)](https://www.npmjs.com/package/sftp-deployer)\n\nA command-line tool for lightning-fast SFTP deployments.\n\n- Transfers a directory as a single compressed file\n- Minimizes downtime of target directory with [blue/green deployment](https://en.wikipedia.org/wiki/Blue-green_deployment)\n\n![SFTP deployer demo](https://github.com/svandriel/sftp-deployer/blob/master/demo.gif?raw=true)\n\n## Install\n\nYou need Node.JS to use `sftp-deployer`.\n\n```\nnpm install -g sftp-deployer\n```\n\n## Usage\n\nThe following command uploads the contents of the `./build` directory to a remote SSH host, to `/var/www/build`:\n\n```\nsftp-deployer --host example.com \\\n  --user bob \\\n  --key private_key.pem \\\n  --local ./build \\\n  --target /var/www/build\n```\n\nAvailable options:\n\n```\n  -V, --version                output the version number\n  -c, --config \u003cconfig file\u003e   configuration file to use (default: \".sftp.json\")\n  -h, --host \u003chost\u003e            hostname to connect to\n  -p, --port \u003cport\u003e            SSH port to use (defaults to 22)\n  -u, --user \u003cusername\u003e        the ssh username\n  -k, --key \u003ckey_or_file\u003e      path to private key file, or private key itself\n  --password \u003cpassword\u003e        the password to the private key\n  -l, --local \u003cpath\u003e           directory to upload\n  -t, --target \u003ctarget_dir\u003e    target directory on remote host\n  -s, --staging \u003cstaging_dir\u003e  staging directory on remote host\n                               (defaults to the target directory + .staging)\n  -u, --upload \u003cupload_dir\u003e    upload directory on remote host\n                               (default: \"/var/tmp\")\n  --help                       display help for command\n```\n\n## Using a configuration file\n\nEach of the options listed above may also be specified in a configuration file called `.sftp.json`.\nYou may override this filename by using the `-c` option (see above).\n\nFor example:\n\n```javascript\n{\n  \"host\": \"example.com\",\n  \"port\": 1234, /* Optional, defaults to 22 */\n  \"user\": \"bob\"\n  \"key\": \"private_key.pem\"\n  \"password\": \"super_secure\", /* Optional, only needed if the key is encrypted */\n  \"local\": \"./build\",\n  \"target\": \"/var/www/build\",\n  \"staging\": \"/var/www/incoming/uploads\", /* Optional, defaults to target directory + .staging */\n  \"upload\": \"/my/upload/dir\" /* Optional, defaults to /var/tmp */\n}\n```\n\nYou may then simply invoke `sftp-deployer` and it will take its input from the `.sftp.json` file in the current working directory.\n\n## Blue/green deployment\n\nWhen a directory is uploaded but a target directory already exists, the following steps are taken to minimize downtime:\n\n- Deploy new directory to a staging location\n- Swap staging location and target location\n\nThis makes sure that the target directory is only down for a couple of milliseconds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvandriel%2Fsftp-deployer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvandriel%2Fsftp-deployer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvandriel%2Fsftp-deployer/lists"}