GithubHelp home page GithubHelp logo

balena-io / balena-cli Goto Github PK

View Code? Open in Web Editor NEW
450.0 450.0 138.0 32.85 MB

The official balena CLI tool.

License: Apache License 2.0

JavaScript 1.45% TypeScript 97.95% CSS 0.08% Shell 0.37% Dockerfile 0.02% EJS 0.12% Batchfile 0.01%

balena-cli's People

Contributors

ab77 avatar afitzek avatar balena-ci avatar camerondiver avatar dansku avatar dfunckt avatar emirotin avatar flowzone-app[bot] avatar imrehg avatar jviotti avatar kb2ma avatar klutchell avatar lekkas avatar lucianbuzzo avatar mbalamat avatar myarmolinsky avatar nwneisen avatar otaviojacobi avatar page- avatar pcarranzav avatar pcgeek86 avatar pdcastro avatar pimterry avatar pipex avatar srlowe avatar thgreasi avatar vipulgupta2048 avatar wrboyce avatar xginn8 avatar zvin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

balena-cli's Issues

>= 2 word command help doesn't work correctly

So this runs correctly:-

resin help app
Usage: app <name>

Use this command to show detailed information for a single application.

Examples:

    $ resin app MyApp

But if I run resin help app rm I get the same output:-

[~]$ resin help app rm                                                                                   
Usage: app <name>

Use this command to show detailed information for a single application.

Examples:

    $ resin app MyApp

Also in both cases I feel it would be useful to have flags like -y available and listed here :)

The -y flag needs to be at the end of the command which is unusal

It seems that the flag has to be put last in the command, which is very unusual:-

[~]$ resin -y app rm foo                                                                
Usage: resin [COMMAND] [OPTIONS]

Commands:

    version                         output the version number
    help [command...]               show help
    login [token]                   login to resin.io
    logout                          logout from resin.io
    signup                          signup to resin.io
    whoami                          get current username
    app create <name>               create an application
    apps                            list all applications
    app <name>                      list a single application
    app rm <name>                   remove an application
    app restart <name>              restart an application
    app associate <name>            associate a resin project
    init                            init an application
    devices                         list all devices
    devices supported               list all supported devices
    device rename <name> [newName]  rename a resin device
    device init [device]            initialise a device with resin os
    device <name>                   list a single device
    device rm <name>                remove a device
    device identify <uuid>          identify a device with a UUID
    device await <name>             await for a device to become online
    drives                          list available drives
    note <|note>                    set a device note
    preferences                     open preferences form
    keys                            list all ssh keys
    key add <name> [path]           add a SSH key to resin.io
    key <id>                        list a single ssh key
    key rm <id>                     remove a ssh key
    envs                            list all environment variables
    env add <key> [value]           add an environment variable
    env rename <id> <value>         rename an environment variable
    env rm <id>                     remove an environment variable
    logs <uuid>                     show device logs
    os download <name>              download device OS
    os install <image> [device]     write an operating system image to a device
    examples                        list all example applications
    example clone <id>              clone an example application
    example <id>                    list a single example application
    plugins                         list all plugins
    plugin install <name>           install a plugin
    plugin update <name>            update a plugin
    plugin rm <name>                remove a plugin
    update                          update the resin cli

Global Options:

    --quiet, -q             quiet (no output)
    --project, -j <path>    project path
    --version, -v           output the version number
    --no-color              disable colour highlighting

[~]$ resin app -y rm foo                                                                
ID: 123456789
APP NAME: foo
DEVICE TYPE: raspberry-pi2
GIT REPOSITORY: <redacted>
COMMIT: <redacted>
[~]$ resin app rm -y foo
Application not found: rm
[~]$ resin app rm foo -y
[~]$ # Succeeded.

I'd expect that any of the first 3 possibilities would work, and the final one would fail :)

Doesn't seem to validate user right at the start of the command

Doesn't ask to select an application anymore??? this was due to not being logged in, but it let me get all the way to selecting device type before telling me i needed to be logged in. ( Later discovered I was actually logged in a production account, but endpoint was staging)

resin devices should list all devices

I think it's confusing for resin devices to give an error of You have to specify an application - on first use my assumption is that this would list all devices. This would also be very useful!

cd to associated project folder automatically for the user.

once you have associated your folder to the app, it tells you this:

  • Please type "git push resin master" into your project directory now!
  • it would be better i think if it told you that it was changing directory to the associated location, then changed you to this directory and finally told you to run “git push resin master" command.

Incorrect device instructions after device init.

The physical instructions shown to the user after burning process are incorrect as they are the same instructions from the dashboard, talking about using dd etc. This needs to be fixed in the device-type spec

Folder not created, so was associated to the wrong folder

Folder was not created:

Your device is ready, lets start pushing some code!
? Please choose a directory for your code: ~/Desktop/cli_projects/test
Associating 9july2015 with ~/Desktop/cli_projects/test...
? Are you sure you want to associate /Users/hobochild/Desktop/resin-plugin-watch with 9july2015? Yes
git repository added: [email protected]:shaun/9july2015.git
Resin git remote added: [email protected]:shaun/9july2015.git
Please type "git push resin master" into your project directory now!

I tried to associate a folder that doesn't exist, but instead it just associated my current working directory.

provide a default/suggested folder for quickstart

For the below prompt, it would be nice to have a "default/suggested folder" so we can just hit enter:
something like this perhaps:
? Please choose a directory for your code: (~/resin-projects/myAppName)

obsure wifi passphrase entry.

Not sure if it would be annoying or not, but it is probably good practise to obscure the wifi passphrase when a user is typing it into the command prompt

resin device [device name] does't seem to work

I tried the below, which doesn't seem correct:-

[~]$ resin devices --app foobar                                                                                                                                                                                     
ID    NAME DEVICE TYPE  IS ONLINE APPLICATION NAME STATUS LAST SEEN
12022 one  raspberry-pi false     foobar           Idle            
[~]$ resin device one                                                                                                                                                                                               
Device not found: one

"Try running as sudo" thrown when SD card lock is in place

If the user inserts a card which has the physical lock enabled on it. The CLI tells the user they should try run the command as sudo, even though they have run as sudo.

example:

resin-io:~ hobochild$ sudo resin device init --application 9july2015
? Drive: /dev/disk2 (*8.0 GB) - FDisk_partition_scheme
? This will completely erase /dev/disk2. Are you sure you want to continue? Yes
? Network Type: ethernet
Checking application: 9july2015
Getting device manifest for the application
Fetching application configuration
Associating the device
Configuring device operating system image
The base image was cached to improve initialization time of similar devices
Attempting to write operating system image to drive
You don't have enough privileges to run this operation.
Try running this command again prefixing it with `sudo`.

Interactively tell user to insert SD card

if no SD card is detected, it just exits the "resin quickstart" it should perhaps interactively tell the user to insert their SD card into their Computer and then wait for this to happen... (with some timeout obviously)

resin os install crashes

Throws this:

pablo@pablo-laptop:~/resin/resin-starter-kit-python$ sudo resin os install ../starterpython.img /dev/mmcblk0
? This will completely erase /dev/mmcblk0. Are you sure you want to continue? Yes

/usr/lib/node_modules/resin-cli/node_modules/resin-cli-visuals/build/widgets/progress.js:51
    this.eraseLastLine();
         ^
TypeError: Object #<Through2> has no method 'eraseLastLine'
    at Through2.module.exports.Progress.update (/usr/lib/node_modules/resin-cli/node_modules/resin-cli-visuals/build/widgets/progress.js:51:10)
    at Through2.emit (events.js:95:17)
    at emit (/usr/lib/node_modules/resin-cli/node_modules/progress-stream/index.js:36:6)
    at Through2.write [as _transform] (/usr/lib/node_modules/resin-cli/node_modules/progress-stream/index.js:45:33)
    at Through2.Transform._read (_stream_transform.js:179:10)
    at Through2.Readable.read (_stream_readable.js:340:10)
    at flow (_stream_readable.js:607:52)
    at WriteStream.<anonymous> (_stream_readable.js:591:7)
    at WriteStream.emit (events.js:92:17)
    at onwriteDrain (_stream_writable.js:288:12)
    at afterWrite (_stream_writable.js:276:5)
    at onwrite (_stream_writable.js:269:7)
    at WritableState.onwrite (_stream_writable.js:96:5)
    at fs.js:1694:5
    at Object.wrapper [as oncomplete] (fs.js:521:5)

Progress Bar for Download

Is there a plan or work around for to allow us to see the Download progress? it would improve the user experience quiet a bit to know how its going 👍

Proposal: present a link to the application dashboard while user waits for Download.

It may be nice to present a link in the quickStart CLI which points to the dashboard of the application they are working on, so they can see that the device is in the "connecting.." state on the dashboard. This will allow them to explore the dashboard while they wait for OS download. However, this needs to be thought about in the context of the full user flow and make sure it makes sense.

Improve flow for associating folder in quickStart.

Is there a way we can improve or make clearer what is happening when quickstart asks to associate a folder to the app, it is unclear what format the input requires. Also its unclear if it is relative to root or the current working directory. I have associated my whole Desktop once or twice by mistake 😄

Proposal: suggest/show default file directory for code

When the quick start asks the user to select a directory that they want to associate to the app, it would be nice if the prompt would show a default or suggested file location, so the user could just hit enter and the default would be used.
e.g.:
$ Please select a directory (~/Resin_projects/myAppName):

resin devices is a little unclear

Running resin devices [app name or id] simply returns the original help page.

After discussion it seems this requires -a [app name] --app [app name] or --application [app name], so I think either this should return a specific error messages saying specify application using -a [app name] or equivalent, or the command I mentioned above should also be accepted (which would be my preference overall :)

Hierarchical display of CLI help.

Currently the CLI -h --help command just dumps a fairly long list of commands. It would perhaps to have a more structured list of the commands. Perhaps, more commonly used commands could be listed first. it could also be possible to segment the help into sub help commands. so you could do something like

$ resin --help <topic>

for example heroku -h

Usage: heroku COMMAND [--app APP] [command-specific-options]

Primary help topics, type "heroku help TOPIC" for more details:

  addons    #  manage addon resources
  apps      #  manage apps (create, destroy)
  auth      #  authentication (login, logout)
  config    #  manage app config vars
  domains   #  manage domains
  logs      #  display logs for an app
  ps        #  manage dynos (dynos, workers)
  releases  #  manage app releases
  run       #  run one-off commands (console, rake)
  sharing   #  manage collaborators on an app

Additional topics:

  buildpacks   #  manage the buildpack for an app
  certs        #  manage ssl endpoints for an app
  drains       #  display drains for an app
  features     #  manage optional features
  fork         #  clone an existing app
  git          #  manage git for apps
  help         #  list commands and display help
  keys         #  manage authentication keys
  labs         #  manage optional features
  local        #  run heroku app locally
  maintenance  #  manage maintenance mode for an app
  members      #  manage membership in organization accounts
  orgs         #  manage organization accounts
  pg           #  manage heroku-postgresql databases
  pgbackups    #  manage backups of heroku postgresql databases
  plugins      #  manage plugins to the heroku gem
  redis        #  list redis databases for an app
  regions      #  list available regions
  stack        #  manage the stack for an app
  status       #  check status of heroku platform
  twofactor    #  manage two-factor authentication settings
  update       #  update the heroku client
  version      #  display version

resin CLI seems to delete itself after trying to perform an update

When i ran "resin apps" the cli said it was performing a minor update, this failed and now when i run resin apps, it says command not found.

here is the console log:

resin-io:resin-ftp hobochild$ resin whoami
shaun
resin-io:resin-ftp hobochild$ resin apps
Performing patch update, hold tight...
Command failed: /bin/sh -c npm install --silent --global resin-cli

resin-io:resin-ftp hobochild$ sudo resin apps
Password:
sudo: resin: command not found
resin-io:resin-ftp hobochild$ resin apps
-bash: /usr/local/bin/resin: No such file or directory
resin-io:resin-ftp hobochild$ which resin 
resin-io:resin-ftp hobochild$ 

resin apps not showing online devices

I have an online device, it appears as online using "resin device", but "resin apps" reports no devices online:

pablo@pablo-laptop:~/resin/resin-starter-kit-python$ resin devices -a starterpython
ID    NAME        DEVICE TYPE   IS ONLINE APPLICATION NAME STATUS      LAST SEEN
12218 broken-wave raspberry-pi2 true      starterpython    Downloading          
pablo@pablo-laptop:~/resin/resin-starter-kit-python$ resin apps
ID   APP NAME      DEVICE TYPE      ONLINE DEVICES DEVICES LENGTH
1957 kiosk         raspberry-pi2    0              1             
1894 safebox       raspberry-pi2    0              4             
1973 starterkit    raspberry-pi2    0              1             
1990 starterpython raspberry-pi2    0              1             
1718 test          beaglebone-black 0              0             
1809 wordbomb      raspberry-pi2    0              1             
pablo@pablo-laptop:~/resin/resin-starter-kit-python$ resin apps
ID   APP NAME      DEVICE TYPE      ONLINE DEVICES DEVICES LENGTH
1957 kiosk         raspberry-pi2    0              1             
1894 safebox       raspberry-pi2    0              4             
1973 starterkit    raspberry-pi2    0              1             
1990 starterpython raspberry-pi2    0              1             
1718 test          beaglebone-black 0              0             
1809 wordbomb      raspberry-pi2    0              1             
pablo@pablo-laptop:~/resin/resin-starter-kit-python$ resin devices -a starterpython
ID    NAME        DEVICE TYPE   IS ONLINE APPLICATION NAME STATUS      LAST SEEN
12218 broken-wave raspberry-pi2 true      starterpython    Downloading     

Don't know if it happens always, will try again in a while to see if it changes.

Accept multiple resources in rm commands

Important for scripting - being able to do resin app rm 123 456 789 ... (this is to be able to use xargs without -n 1, also will make it faster as not restarting for each case).

"Last Seen: undefined”

When the device first comes online and the state of the device is reported by the cli in the terminal, it states that the device was "Last Seen: undefined" it maybe be good to have some default value like "not seen yet" or "right now" not sure...

Permissions not automatically elevated on update

resin-io:~ hobochild$ resin -version
Performing minor update, hold tight...
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/resin-cli'
npm ERR!  { [Error: EACCES, unlink '/usr/local/lib/node_modules/resin-cli']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/resin-cli' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 14.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--global" "resin-cli"
npm ERR! cwd /Users/hobochild
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! path /usr/local/lib/node_modules/resin-cli
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/resin-cli'
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/resin-cli'
npm ERR! error rolling back  { [Error: EACCES, unlink '/usr/local/lib/node_modules/resin-cli']
npm ERR! error rolling back   errno: 3,
npm ERR! error rolling back   code: 'EACCES',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/resin-cli' }
npm ERR! not ok code 0

Allow wifi Credentials to be re-configured after first boot.

The new OS images auto mount a config partition that contains a config.json with the network settings. There should be functionality like
$ sudo resin wifi config
which will allow the user to select a SD card or device (edison) and either change the current wifi config or add an additional wifi SSID and Passphrase.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.