Commit Graph

410 Commits

Author SHA1 Message Date
Juan Cruz Viotti
ebefd816b6 Show shorter uuids when listing devices 2016-01-21 10:26:13 -04:00
Juan Cruz Viotti
fb1ef0df63 Promote shorter uuids in all examples 2016-01-21 10:23:40 -04:00
Juan Cruz Viotti
add30b33a1 Remove registered device resource in case of errors in quickstart
A device resource needs to be registered with the API before being able
to create the `config.json` file that goes in a device.

This means thats the device image is configured and written to an
external drive (e.g: SDCard) *after* the device resource registered.

If any of the above operations fail, there will be an unitialized orphan
device living in the selected application that the user will have to
remove himself.
2016-01-14 09:14:45 -04:00
Juan Cruz Viotti
4645ad06bc Redirect users to signup from login if they don't have an account 2016-01-13 00:25:31 -04:00
Juan Cruz Viotti
c3a5998d5c Reuse messages 2016-01-12 10:45:32 -04:00
Juan Cruz Viotti
78ab2af8ba Print verbose help in resin help command 2016-01-12 10:39:29 -04:00
Juan Cruz Viotti
11354de596 Print an informative message after successful login 2016-01-12 10:30:56 -04:00
Juan Cruz Viotti
86cac606e4 Add Resin.io ASCII art in login 2016-01-12 10:23:46 -04:00
Juan Cruz Viotti
9b052c9aa5 Handle authentication in quickstart
If the user is not logged in, make quickstart prompt for authentication
automatically.
2016-01-12 10:12:44 -04:00
Juan Cruz Viotti
8d709aea7d Implement purely interactive login command
The new login command interactively asks the user if he wants to login
using web/credentials/token.
2016-01-12 09:08:03 -04:00
Juan Cruz Viotti
11c0d2a847 Merge pull request #289 from resin-io/help/device-init-primary
Don't make `device init` a primary command
2016-01-12 08:08:38 -04:00
Juan Cruz Viotti
d859228aa9 Stop instructing users to run quickstart as root
Elevation is asked in specific steps automatically.
2016-01-11 16:01:40 -04:00
Juan Cruz Viotti
2be105d329 Don't make device init a primary command
Unlikely that a user will run this directly having the more high level
`quickstart`.
2016-01-11 16:00:07 -04:00
Juan Cruz Viotti
9cfce68489 Change license to Apache 2.0 2016-01-03 23:58:51 -04:00
Juan Cruz Viotti
b71c28cec0 Add optional credential-based authentication 2015-12-12 00:11:04 -04:00
Juan Cruz Viotti
26e3cb7957 Add timestamp to logs lines 2015-12-11 20:28:29 -04:00
Juan Cruz Viotti
210680c9c9 Lazy load command actions dependencies
In my system (MBPr 13), printing the current version takes over 2
seconds:

```sh
$ time ./bin/resin version
2.4.0
./bin/resin version  1.37s user 0.19s system 73% cpu 2.130 total
```

The CLI takes almost all of these time to parse the dependency tree
before returning control over the actually called command.

To mitigate this problem, we only require the NPM dependencies a command
requires when executing such command, and thus prevent dependencies from
being required and parsed unnecessary.

After this improvement, printing the original example (`resin version`)
returns in less than a second (2x improvement):

```sh
$ time ./bin/resin version
2.4.0
./bin/resin version  0.88s user 0.09s system 102% cpu 0.938 total
```
2015-12-07 11:48:54 -03:00
Juan Cruz Viotti
7d0da7adc0 Merge pull request #277 from resin-io/jviotti/feat/token-login
Support for login in with token
2015-12-04 10:55:39 -04:00
Juan Cruz Viotti
2e247faae4 Merge pull request #276 from resin-io/jviotti/feat/quickstart-after-instructions
Add helpful instructions after quickstart
2015-12-03 10:24:13 -04:00
Juan Cruz Viotti
3997a61b78 Support for login in with token
This is useful in the scenario when the user is using the CLI in an
environment in which he/she doesn't have access to a web browser, like a
headless server or a Vagrant development environment.
2015-12-03 10:22:22 -04:00
Juan Cruz Viotti
8ef27f0525 Add helpful instructions after quickstart 2015-12-02 16:28:32 -04:00
Juan Cruz Viotti
20855be968 Merge pull request #275 from resin-io/jviotti/feat/sudo-explain
Explain why we need the computer password on device init
2015-12-02 15:59:27 -04:00
Juan Cruz Viotti
abc8399260 Explain why we need the computer password on device init 2015-12-02 11:15:20 -04:00
Juan Cruz Viotti
9ad2ba1131 Show id in devices command 2015-12-02 09:06:41 -04:00
Juan Cruz Viotti
9a89e3c3ca Perform automatic token exchange with the dashboard 2015-11-25 09:25:08 -04:00
Juan Cruz Viotti
ae8621dc81 Simplify download output message
The message displayed the output of the download, which was mainly used
for debugging purposes when developing `device init` and `quickstart`.
2015-11-23 23:38:28 -04:00
Juan Cruz Viotti
a4642f6184 Clarify resin url on auth and whoami
When you change the `resinUrl` config from time to time it can be
confusing to remember where you're logging in, or in which host you're
in.

Currently I have to check the configuration files/environment variables
manually or run `resin settings`.

This PR prints the detected resin url on `resin login` and `resin
whoami` so it's always clear where you are.
2015-11-16 10:11:08 -04:00
Juan Cruz Viotti
f52dd2976f Implement settings command
This command allows the user to list all detected settings.
2015-11-15 22:08:02 -04:00
Juan Cruz Viotti
43697a3476 Show uuid in devices command
The command to get information about a device, `resin device` requires a
`uuid` as a parameter. Given that we don't show uuids in `resin
devices`, the user has no way to know what uuid to pass to get extra
information.

We also remove some non very used information columns from `resin
devices` to make space for the uuid.
2015-11-13 14:06:55 -04:00
Juan Cruz Viotti
ba318f2939 Implement device move command
This command allows to user to move a device to another application he
owns.
2015-11-12 07:47:16 -04:00
Juan Cruz Viotti
f64676ab98 Implement config reconfigure command
This command allows the user to reconfigure an already provisioned
device.

Fixes: https://github.com/resin-io/resin-cli/issues/102
2015-11-11 10:38:45 -04:00
Juan Cruz Viotti
4fc7a4e436 Make use of resin-config-json for config commands
This module encapsulates the low level details of `config.json` I/O and
tests them extensively.

See: https://github.com/resin-io/resin-config-json
2015-11-11 10:04:46 -04:00
Juan Cruz Viotti
3b35aed3bf Implement config write command
This command allows the user to overwrite properties of the config.json
file.
2015-11-10 14:28:18 -04:00
Juan Cruz Viotti
5509a3e9fd Implement config read command
This command is used to read a config.json from a provisioned device
2015-11-10 12:53:34 -04:00
Juan Cruz Viotti
f921488e8c Remove app associate command 2015-10-21 13:25:22 -04:00
Juan Cruz Viotti
f66cd00646 Remove project directory creation in quickstart
The last part of `quickstart` feels weird. By consensus, we remove the
part that attempts to create a project directory and leave that step to
the user.
2015-10-21 11:18:29 -04:00
Juan Cruz Viotti
7a4f551a47 Use rindle instead of custom waitStream 2015-10-21 10:17:10 -04:00
Juan Cruz Viotti
c1e6a28640 Refactor validation to a single place 2015-10-21 09:37:25 -04:00
Juan Cruz Viotti
ec72f93480 Merge pull request #242 from resin-io/jviotti/feature/us-pw-login
Implement user/password login with 2FA support
2015-10-21 09:32:17 -04:00
Juan Cruz Viotti
8913fb515b Implement user/password login with 2FA support 2015-10-21 08:28:20 -04:00
Juan Cruz Viotti
f2507daa09 Allow advanced option in device init
This option is inherited to `os configure`.
2015-10-20 09:16:56 -04:00
Juan Cruz Viotti
ff81c1e514 Merge pull request #234 from resin-io/jviotti/feature/advanced-options
Ignore advanced configuration questions by default
2015-10-20 09:12:38 -04:00
Juan Cruz Viotti
d28ecf3230 Allow passing a custom uuid to device register 2015-10-19 14:16:47 -04:00
Juan Cruz Viotti
ec28bd9c9e Ignore advanced configuration questions by default
The advanced questions can be enabled by passing `--advanced` in `os
configure`.
2015-10-19 14:02:57 -04:00
Juan Cruz Viotti
ad68dcf692 Fix --type option taking no effect in app create 2015-10-19 13:07:23 -04:00
Juan Cruz Viotti
b2425d2c0e Take device type as an option in os initialize 2015-10-15 09:11:38 -04:00
Juan Cruz Viotti
71ee0a6cf7 Support drive option in os initialize
This allows the user to bypass the drive selection dialog.

This option can be used along with `--yes` to make the command
completely non-interactive. For example:

	$ resin os initialize rpi.img 'raspberry-pi' --drive /dev/disk2 --yes
2015-10-15 08:14:35 -04:00
Juan Cruz Viotti
58713dc291 Add missing yes option to os initialize
This option is tried to be used within the command, but is not defined
as a formal Capitano option.
2015-10-14 17:49:27 -04:00
Juan Cruz Viotti
cddf630907 Avoid _.ary in temporal path disposer
For some reason fails with a weird Bluebird error on Windows
2015-10-12 18:12:58 -04:00
Juan Cruz Viotti
e5e871ddcd Upgrade SDK to v3.0.0
Breaking changes in this version:

- `resin.models.device.generateUUID()` is now async.
2015-10-12 08:34:22 -04:00