The official balena CLI tool.
Go to file
2018-03-05 16:02:09 +01:00
.github Create ISSUE_TEMPLATE.md 2017-09-04 20:18:23 +03:00
automation Start using Prettier 2018-01-10 09:23:00 +01:00
bin Remove unused resin-write bin script 2015-08-19 11:30:48 -04:00
doc Add 'or mounted resinOS image' 2018-01-30 17:30:18 +01:00
lib Tweak TS & add missing deps that may cause build failures in some envs 2018-02-20 20:26:18 +01:00
tests/auth Inline the entire resin-cli-auth module 2017-11-27 12:02:57 +02:00
typings Add typings for 'ent' 2018-02-07 11:20:08 +01:00
.editorconfig fix resin local push help message and lint errors 2017-03-21 12:06:05 +03:00
.gitignore Build standalone zips into a separate folder 2017-12-18 15:03:17 +01:00
.hound.yml Change java_script to javascript in hound config 2015-10-19 14:21:10 -04:00
.prettierrc Fix prettier configuration to avoid linting errors 2018-03-05 16:02:09 +01:00
.travis.yml Autodeploy built standalone binaries for all platforms to github 2017-12-18 14:55:07 +01:00
appveyor.yml Autodeploy built standalone binaries for all platforms to github 2017-12-18 14:55:07 +01:00
capitanodoc.coffee Add preload to the CLI docs 2017-10-25 13:17:07 +02:00
capitanodoc.ts Move documentation generation to TypeScript 2018-01-09 17:14:49 +01:00
CHANGELOG.md v6.13.4 2018-02-22 18:23:29 +00:00
coffeelint.json Add Coffeelint support 2014-10-31 09:48:53 -04:00
gulpfile.coffee Lint TypeScript and CoffeeScript with resin-lint 2018-01-09 17:14:49 +01:00
LICENSE Change license to Apache 2.0 2016-01-03 23:58:51 -04:00
package.json v6.13.4 2018-02-22 18:23:29 +00:00
README.md Add standalone install instructions to the readme 2017-12-18 14:55:07 +01:00
TROUBLESHOOTING.md Document the case where EACCES is thrown during login 2016-03-09 11:03:45 -04:00
tsconfig.json Convert most of utils to TypeScript 2018-01-09 17:14:48 +01:00

Resin CLI

The official resin.io CLI tool.

npm version dependencies Gitter

Requisites

If you want to install the CLI directly through npm, you'll need the below. If this looks difficult, we do now have an experimental standalone binary release available, see 'Standalone install' below.

  • NodeJS (>= v4)
  • Git
  • The following executables should be correctly installed in your shell environment:
    • ssh: Any recent version of the OpenSSH ssh client (required by resin sync and resin ssh)
      • if you need ssh to work behind the proxy you also need proxytunnel installed (available as proxytunnel package for Ubuntu, for example)
    • rsync: >= 2.6.9 (required by resin sync)
Windows Support

Before installing resin-cli, you'll need a working node-gyp environment. If you don't already have one you'll see native module build errors during installation. To fix this, run npm install -g --production windows-build-tools in an administrator console (available as 'Command Prompt (Admin)' when pressing windows+x in Windows 7+).

resin sync and resin ssh have not been thoroughly tested on the standard Windows cmd.exe shell. We recommend using bash (or a similar) shell, like Bash for Windows 10 or Git for Windows.

If you still want to use cmd.exe you will have to use a package manager like MinGW or chocolatey. For MinGW the steps are:

  1. Install MinGW.
  2. Install the msys-rsync and msys-openssh packages.
  3. Add MinGW to the %PATH% if this hasn't been done by the installer already. The location where the binaries are places is usually C:\MinGW\msys\1.0\bin, but it can vary if you selected a different location in the installer.
  4. Copy your SSH keys to %homedrive%%homepath\.ssh.
  5. If you need ssh to work behind the proxy you also need to install proxytunnel

Getting Started

NPM install

If you've got all the requirements above, you should be able to install the CLI directly from npm. If not, or if you have any trouble with this, please try the new standalone install steps just below.

This might require elevated privileges in some environments.

$ npm install --global --production resin-cli

Standalone install

If you don't have node or a working pre-gyp environment, you can still install the CLI as a standalone binary. This is in experimental and may not work perfectly yet in all environments, but it seems to work well in initial cross-platform testing, so it may be useful, and we'd love your feedback if you hit any issues.

To install the CLI as a standalone binary:

To update in future, simply download a new release and replace the extracted folder.

Have any problems, or see any unexpected behaviour? Please file an issue!

Login

$ resin login

(Typically useful, but not strictly required for all commands)

Run commands

Take a look at the full command documentation at https://docs.resin.io/tools/cli/, or by running resin help.


Plugins

The Resin CLI can be extended with plugins to automate laborious tasks and overall provide a better experience when working with Resin.io. Check the plugin development tutorial to learn how to build your own!

FAQ

Where is my configuration file?

The per-user configuration file lives in $HOME/.resinrc.yml or %UserProfile%\_resinrc.yml, in Unix based operating systems and Windows respectively.

The Resin CLI also attempts to read a resinrc.yml file in the current directory, which takes precedence over the per-user configuration file.

How do I point the Resin CLI to staging?

The easiest way is to set the RESINRC_RESIN_URL=resinstaging.io environment variable.

Alternatively, you can edit your configuration file and set resinUrl: resinstaging.io to persist this setting.

How do I make the Resin CLI persist data in another directory?

The Resin CLI persists your session token, as well as cached images in $HOME/.resin or %UserProfile%\_resin.

Pointing the Resin CLI to persist data in another location is necessary in certain environments, like a server, where there is no home directory, or a device running resinOS, which erases all data after a restart.

You can accomplish this by setting RESINRC_DATA_DIRECTORY=/opt/resin or adding dataDirectory: /opt/resin to your configuration file, replacing /opt/resin with your desired directory.

Support

If you're having any problems, check our troubleshooting guide and if your problem is not addressed there, please raise an issue on GitHub and the resin.io team will be happy to help.

You can also get in touch with us in the resin.io forums.

License

The project is licensed under the Apache 2.0 license.