{"id":22505316,"url":"https://github.com/azer/remotely","last_synced_at":"2025-08-03T11:33:09.178Z","repository":{"id":14896299,"uuid":"17620114","full_name":"azer/remotely","owner":"azer","description":"Run given command remotely via SSH","archived":false,"fork":false,"pushed_at":"2014-03-13T02:01:13.000Z","size":148,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-15T03:09:39.928Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-11T05:59:50.000Z","updated_at":"2019-11-04T08:08:21.000Z","dependencies_parsed_at":"2022-09-11T23:22:53.820Z","dependency_job_id":null,"html_url":"https://github.com/azer/remotely","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fremotely","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fremotely/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fremotely/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fremotely/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azer","download_url":"https://codeload.github.com/azer/remotely/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228540841,"owners_count":17934031,"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":[],"created_at":"2024-12-07T00:17:24.174Z","updated_at":"2024-12-07T00:17:24.867Z","avatar_url":"https://github.com/azer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## remotely\n\nRun given command remotely via SSH\n\n```js\nremotely = require('remotely')\n\nremotely('user@hostname', 'echo $HOME').stdout.pipe(process.stdout)\n// =\u003e /home/username\n```\n\n## Install\n\n```bash\n$ npm install remotely\n```\n\n## Usage\n\n### Callbacks\n\nIf callbacks work better than piping in your case, pass a function as last parameter:\n\n```js\nremotely = require('remotely')\n\nremotely('user@hostname', 'echo $HOME', function (error, stdout, stderr) {\n\n  stdout\n  // =\u003e /home/username\n\n})\n```\n\n### Streams\n\nYou can pipe commands to call:\n\n```js\nremotely = require('remotely')('azer.io')\n\nremotely.stdout.pipe(process.stdout)\n\nprocess.stdin.resume()\nprocess.stdin.pipe(remotely.stdin)\n```\n\nSee `example.js` for a working example\n\n### Child Process options\n\nRemotely has a similar interface to `child_process.exec`. You can pass child options as third parameter:\n\n```js\nremotely('user@hostname', 'echo $HOME', { timeout: 2000 }).stdout.pipe(process.stdout)\n```\n\nSee `test.js` and `example.js` for more information.\n\n### SSH Options\n\nTo specify SSH options like `UserKnownHostsFile`:\n\n```js\nremotely('user@host', 'pwd', { options: { UserKnownHostsFile: '/dev/null' } }).stdout.pipe(process.stdout)\n```\n\n### SSH Identity\n\nYou can specify a custom identity file:\n\n```js\nremotely('user@host', 'pwd', { identity: '/home/azer/ssh-foo/.id_rsa' }).stdout.pipe(process.stdout)\n```\n\n## Debugging\n\n```bash\nDEBUG=remotely:* node yourscript.js\n```\n\n## Testing\n\nTest module requires a hostname as third parameter.\n\n```bash\n$ node test.js user@hostname\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazer%2Fremotely","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazer%2Fremotely","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazer%2Fremotely/lists"}