balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
455 stars 142 forks source link

`device init` is broken and insufficiently documented #1552

Open pdcastro opened 4 years ago

pdcastro commented 4 years ago

$ balena device init
? Select an application test-rpi (raspberrypi3)
Getting device operating system for raspberrypi3
The image was downloaded successfully
Registering to test-rpi: 870414391c83c80022c69cacb0d8c621396708d8336fff9fb6daf1732b8999
Usage: balena [COMMAND] [OPTIONS]

If you need help, or just want to say hi, don't hesitate in reaching out
through our discussion and support forums at https://forums.balena.io

For bug reports or feature requests, have a look at the GitHub issues or
create a new one at: https://github.com/balena-io/balena-cli/issues/

Primary commands:

    help [command...]                       show help
    login                                   login to balena
    push <applicationOrDevice>              Start a remote build on the balena cloud build servers or a local mode device
    logs <uuidOrDevice>                     show device logs
    ssh <applicationOrDevice> [serviceName] SSH into the host or application container of a device
    apps                                    list all applications
    app <name>                              list a single application
    devices                                 list all devices
    device <uuid>                           list a single device
    tunnel <deviceOrApplication>            Tunnel local ports to your balenaOS device
    preload <image>                         preload an app on a disk image (or Edison zip archive)
    build [source]                          Build a single image or a multicontainer project locally
    deploy <appName> [image]                Deploy a single image or a multicontainer project to a balena application
    join [deviceIp]                         Promote a local device running balenaOS to join an application on a balena server
    leave [deviceIp]                        Detach a local device from its balena application
    scan                                    Scan for balenaOS devices in your local network

Run `balena help --verbose` to list additional commands

Global Options:

    --help, -h
    --version, -v
Initializing device

Note: Initializing the device may ask for administrative permissions
because we need to access the raw devices directly.
? Select a drive (Use arrow keys)
❯ /dev/disk2 (4.1 GB) - TOSHIBA USB Flash Memory Media

Also, the documentation (balena help device init) should clarify that this command runs four other CLI commands behind the scenes, with default options:

The command should print to stdout the version of balenaOS that was downloaded (and, why not, the path to the location it was saved to). Also, it should be possible to override (optionally) the device type for the download and subsequent commands, given that an application may contain devices of multiple types.

balena-ci commented 4 years ago

[pdcastro] This issue has attached support thread https://jel.ly.fish/#/596c83ca-f191-4644-bac4-344c0756ce2b

pdcastro commented 4 years ago

See also the linked support issue above -- it describes a specific feature issue with device init.

Edit: the "specific feature issue" was raised separately in #1627.

srlowe commented 2 years ago

There are a few issues in one here, so enumerating in checklist:

We may want to break these out into separate issues.