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.
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
```
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.
Some CLI commans prompt to select an existing application, presending a
dropdown with all the application names, however it's hard to remember
which application belon to which device type, which makes it easier to
select the wrong application.
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.
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.
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.