balena-io / balena-cli Goto Github PK
View Code? Open in Web Editor NEWThe official balena CLI tool.
License: Apache License 2.0
The official balena CLI tool.
License: Apache License 2.0
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 :)
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 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)
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!
Currently when you create an application you have the option to create an Edison (or unsupported) device type, but you can not flash it using the cli. These options should be hidden from the user.
Maybe good to inform user that the OS download has been cached for future <device_type> projects, just so that they know that is happening and that creating new devices will be quicker.
once you have associated your folder to the app, it tells you this:
Could be cool to allow the quickstart to remember wifi credentials similar to the way the browser does, as it gets annoying entering this everytime (i am lazy)
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
Hi I'm logging in successfully but then it says I can't run any commands cause I am not logged in.
Successfully logged in as: craig
➜ ~ resin drives
You have to log in
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.
Notice this is not necessary in Windows, and we should prevent having native dependencies in other OSes.
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)
Currently on SD card device types are supported. So Intel Edison can't be flashed using the CLI.
Improve this sentence
? What'll be the name of the application? --> Choose a Name for your New Application...
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
Should tell me the app name isnt unique before it asks me about the device type
resin-io:Desktop hobochild$ resin app create myApp
? Select a type: Raspberry Pi
Request error: Application name must be unique
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
It should throw an error saying "Missing note" or similar.
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`.
It maybe be nice if the resin whoami
returns username<[email protected]>
if the email is available, this just helps to better identify the account, especially if the user has more than 1 account.
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)
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)
Look in to either using bmaptool or a similar strategy to improve writing speed of SD cards.
when downloads happens in quickstart, current text is:
Configuring device operating system image
possibly change to or include this line as well Downloading device operating system
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 👍
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.
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 😄
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):
Currently the SD card writing progress is imported in seconds,
Writing Device OS [======= ] 29% eta 531s
but it may be more user friendly to report this in minutes instead.
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 :)
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
From @lorenzo-stoakes.
A flag to prevent y/n questions, e.g. --noconfirm.
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$
when waiting for a device, it would be better to have a nice ascii art animated spinner instead of just printing the line: Polling device network status:
checkout here http://stackoverflow.com/questions/2685435/cooler-ascii-spinners
In the Configuring device operating system image
step it would probably be good to have a random spinner, while the download happens. Also indicate that this step may take a minute or two.
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.
If I run resin logs whatever
(sic), it just hangs there. It would be nice to have an error message like "Device doesn't exist".
From @lorenzo-stoakes.
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).
These are quite standard options for command line tools. We should support them.
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...
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
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.
It does print all log messages, but then a Ctrl-C is needed to stop it.
$ resin devices
ID NAME DEVICE TYPE IS ONLINE APPLICATION NAME STATUS LAST SEEN
13010 Pi1 raspberry-pi false Idle
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.