mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-07 11:26:41 +00:00
Implement basic documentation generation mechanism
This commit is contained in:
parent
eef26eb67f
commit
6a83a537c7
@ -14,7 +14,7 @@
|
||||
exports.create = {
|
||||
signature: 'app create <name>',
|
||||
description: 'create an application',
|
||||
help: 'Use this command to create a new resin.io application.\n\nYou can specify the application type with the `--type` option.\nOtherwise, an interactive dropdown will be shown for you to select from.\n\nYou can see a list of supported device types with\n $ resin devices supported\n\nExamples:\n $ resin app create MyApp\n $ resin app create MyApp --type raspberry-pi',
|
||||
help: 'Use this command to create a new resin.io application.\n\nYou can specify the application type with the `--type` option.\nOtherwise, an interactive dropdown will be shown for you to select from.\n\nYou can see a list of supported device types with\n\n $ resin devices supported\n\nExamples:\n\n $ resin app create MyApp\n $ resin app create MyApp --type raspberry-pi',
|
||||
options: [
|
||||
{
|
||||
signature: 'type',
|
||||
@ -46,7 +46,7 @@
|
||||
exports.list = {
|
||||
signature: 'apps',
|
||||
description: 'list all applications',
|
||||
help: 'Use this command to list all your applications.\n\nNotice this command only shows the most important bits of information for each app.\nIf you want detailed information, use resin app <id> instead.\n\nExamples:\n $ resin apps',
|
||||
help: 'Use this command to list all your applications.\n\nNotice this command only shows the most important bits of information for each app.\nIf you want detailed information, use resin app <id> instead.\n\nExamples:\n\n $ resin apps',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.models.application.getAll(function(error, applications) {
|
||||
@ -62,7 +62,7 @@
|
||||
exports.info = {
|
||||
signature: 'app <id>',
|
||||
description: 'list a single application',
|
||||
help: 'Use this command to show detailed information for a single application.\n\nExamples:\n $ resin app 91',
|
||||
help: 'Use this command to show detailed information for a single application.\n\nExamples:\n\n $ resin app 91',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.models.application.get(params.id, function(error, application) {
|
||||
@ -78,7 +78,7 @@
|
||||
exports.restart = {
|
||||
signature: 'app restart <id>',
|
||||
description: 'restart an application',
|
||||
help: 'Use this command to restart all devices that belongs to a certain application.\n\nExamples:\n $ resin app restart 91',
|
||||
help: 'Use this command to restart all devices that belongs to a certain application.\n\nExamples:\n\n $ resin app restart 91',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.models.application.restart(params.id, done);
|
||||
@ -88,7 +88,7 @@
|
||||
exports.remove = {
|
||||
signature: 'app rm <id>',
|
||||
description: 'remove an application',
|
||||
help: 'Use this command to remove a resin.io application.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n $ resin app rm 91\n $ resin app rm 91 --yes',
|
||||
help: 'Use this command to remove a resin.io application.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n\n $ resin app rm 91\n $ resin app rm 91 --yes',
|
||||
options: [commandOptions.yes],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
@ -101,7 +101,7 @@
|
||||
exports.init = {
|
||||
signature: 'init <id>',
|
||||
description: 'init an application',
|
||||
help: 'Use this command to associate a local project to an existing resin.io application.\n\nThe application should be a git repository before issuing this command.\nNotice this command adds a `resin` git remote to your application.\n\nExamples:\n $ cd myApp && resin init 91',
|
||||
help: 'Use this command to associate a local project to an existing resin.io application.\n\nThe application should be a git repository before issuing this command.\nNotice this command adds a `resin` git remote to your application.\n\nExamples:\n\n $ cd myApp && resin init 91',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var currentDirectory;
|
||||
|
@ -14,7 +14,7 @@
|
||||
exports.login = {
|
||||
signature: 'login',
|
||||
description: 'login to resin.io',
|
||||
help: 'Use this command to login to your resin.io account.\nYou need to login before you can use most of the commands this tool provides.\n\nYou can pass your credentials as `--username` and `--password` options, or you can omit the\ncredentials, in which case the tool will present you with an interactive login form.\n\nExamples:\n $ resin login --username <username> --password <password>\n $ resin login',
|
||||
help: 'Use this command to login to your resin.io account.\nYou need to login before you can use most of the commands this tool provides.\n\nYou can pass your credentials as `--username` and `--password` options, or you can omit the\ncredentials, in which case the tool will present you with an interactive login form.\n\nExamples:\n\n $ resin login --username <username> --password <password>\n $ resin login',
|
||||
options: [
|
||||
{
|
||||
signature: 'username',
|
||||
@ -56,7 +56,7 @@
|
||||
exports.logout = {
|
||||
signature: 'logout',
|
||||
description: 'logout from resin.io',
|
||||
help: 'Use this command to logout from your resin.io account.o\n\nExamples:\n $ resin logout',
|
||||
help: 'Use this command to logout from your resin.io account.o\n\nExamples:\n\n $ resin logout',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.auth.logout(done);
|
||||
@ -66,7 +66,7 @@
|
||||
exports.signup = {
|
||||
signature: 'signup',
|
||||
description: 'signup to resin.io',
|
||||
help: 'Use this command to signup for a resin.io account.\n\nIf signup is successful, you\'ll be logged in to your new user automatically.\n\nExamples:\n $ resin signup\n Email: me@mycompany.com\n Username: johndoe\n Password: ***********\n\n $ resin signup --email me@mycompany.com --username johndoe --password ***********\n\n $ resin whoami\n johndoe',
|
||||
help: 'Use this command to signup for a resin.io account.\n\nIf signup is successful, you\'ll be logged in to your new user automatically.\n\nExamples:\n\n $ resin signup\n Email: me@mycompany.com\n Username: johndoe\n Password: ***********\n\n $ resin signup --email me@mycompany.com --username johndoe --password ***********\n\n $ resin whoami\n johndoe',
|
||||
options: [
|
||||
{
|
||||
signature: 'email',
|
||||
@ -119,7 +119,7 @@
|
||||
exports.whoami = {
|
||||
signature: 'whoami',
|
||||
description: 'get current username',
|
||||
help: 'Use this command to find out the current logged in username.\n\nExamples:\n $ resin whoami',
|
||||
help: 'Use this command to find out the current logged in username.\n\nExamples:\n\n $ resin whoami',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.auth.whoami(function(error, username) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
exports.list = {
|
||||
signature: 'devices',
|
||||
description: 'list all devices',
|
||||
help: 'Use this command to list all devices that belong to a certain application.\n\nExamples:\n $ resin devices --application 91',
|
||||
help: 'Use this command to list all devices that belong to a certain application.\n\nExamples:\n\n $ resin devices --application 91',
|
||||
options: [commandOptions.application],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
@ -35,7 +35,7 @@
|
||||
exports.info = {
|
||||
signature: 'device <id>',
|
||||
description: 'list a single device',
|
||||
help: 'Use this command to show information about a single device.\n\nExamples:\n $ resin device 317',
|
||||
help: 'Use this command to show information about a single device.\n\nExamples:\n\n $ resin device 317',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.models.device.get(params.id, function(error, device) {
|
||||
@ -51,7 +51,7 @@
|
||||
exports.remove = {
|
||||
signature: 'device rm <id>',
|
||||
description: 'remove a device',
|
||||
help: 'Use this command to remove a device from resin.io.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n $ resin device rm 317\n $ resin device rm 317 --yes',
|
||||
help: 'Use this command to remove a device from resin.io.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n\n $ resin device rm 317\n $ resin device rm 317 --yes',
|
||||
options: [commandOptions.yes],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
@ -64,7 +64,7 @@
|
||||
exports.identify = {
|
||||
signature: 'device identify <uuid>',
|
||||
description: 'identify a device with a UUID',
|
||||
help: 'Use this command to identify a device.\n\nIn the Raspberry Pi, the ACT led is blinked several times.\n\nExamples:\n $ resin device identify 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828',
|
||||
help: 'Use this command to identify a device.\n\nIn the Raspberry Pi, the ACT led is blinked several times.\n\nExamples:\n\n $ resin device identify 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.models.device.identify(params.uuid, done);
|
||||
@ -74,7 +74,7 @@
|
||||
exports.rename = {
|
||||
signature: 'device rename <id> [name]',
|
||||
description: 'rename a resin device',
|
||||
help: 'Use this command to rename a device.\n\nIf you omit the name, you\'ll get asked for it interactively.\n\nExamples:\n $ resin device rename 317 MyPi\n $ resin device rename 317',
|
||||
help: 'Use this command to rename a device.\n\nIf you omit the name, you\'ll get asked for it interactively.\n\nExamples:\n\n $ resin device rename 317 MyPi\n $ resin device rename 317',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return async.waterfall([
|
||||
@ -93,7 +93,7 @@
|
||||
exports.supported = {
|
||||
signature: 'devices supported',
|
||||
description: 'list all supported devices',
|
||||
help: 'Use this command to get the list of all supported devices\n\nExamples:\n $ resin devices supported',
|
||||
help: 'Use this command to get the list of all supported devices\n\nExamples:\n\n $ resin devices supported',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.models.device.getSupportedDeviceTypes(function(error, devices) {
|
||||
@ -109,7 +109,7 @@
|
||||
exports.init = {
|
||||
signature: 'device init [device]',
|
||||
description: 'initialise a device with resin os',
|
||||
help: 'Use this command to download the OS image of a certain application and write it to an SD Card.\n\nNote that this command requires admin privileges.\n\nIf `device` is omitted, you will be prompted to select a device interactively.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nYou can quiet the progress bar by passing the `--quiet` boolean option.\n\nYou may have to unmount the device before attempting this operation.\n\nYou need to configure the network type and other settings:\n\nEthernet:\n You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".\n\nWifi:\n You can setup the device OS to use wifi by setting the `--network` option to "wifi".\n If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.\n\nExamples:\n $ resin device init --application 91 --network ethernet\n $ resin device init /dev/disk2 --application 91 --network wifi --ssid MyNetwork --key secret',
|
||||
help: 'Use this command to download the OS image of a certain application and write it to an SD Card.\n\nNote that this command requires admin privileges.\n\nIf `device` is omitted, you will be prompted to select a device interactively.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nYou can quiet the progress bar by passing the `--quiet` boolean option.\n\nYou may have to unmount the device before attempting this operation.\n\nYou need to configure the network type and other settings:\n\nEthernet:\n You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".\n\nWifi:\n You can setup the device OS to use wifi by setting the `--network` option to "wifi".\n If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.\n\nExamples:\n\n $ resin device init --application 91 --network ethernet\n $ resin device init /dev/disk2 --application 91 --network wifi --ssid MyNetwork --key secret',
|
||||
options: [commandOptions.application, commandOptions.network, commandOptions.wifiSsid, commandOptions.wifiKey],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
exports.list = {
|
||||
signature: 'drives',
|
||||
description: 'list available drives',
|
||||
help: 'Use this command to list all drives that are connected to your machine.\n\nExamples:\n $ resin drives',
|
||||
help: 'Use this command to list all drives that are connected to your machine.\n\nExamples:\n\n $ resin drives',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return drivelist.list(function(error, drives) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
exports.list = {
|
||||
signature: 'envs',
|
||||
description: 'list all environment variables',
|
||||
help: 'Use this command to list all environment variables for a particular application.\nNotice we will support per-device environment variables soon.\n\nThis command lists all custom environment variables set on the devices running\nthe application. If you want to see all environment variables, including private\nones used by resin, use the verbose option.\n\nExample:\n $ resin envs --application 91\n $ resin envs --application 91 --verbose',
|
||||
help: 'Use this command to list all environment variables for a particular application.\nNotice we will support per-device environment variables soon.\n\nThis command lists all custom environment variables set on the devices running\nthe application. If you want to see all environment variables, including private\nones used by resin, use the verbose option.\n\nExample:\n\n $ resin envs --application 91\n $ resin envs --application 91 --verbose',
|
||||
options: [
|
||||
commandOptions.application, {
|
||||
signature: 'verbose',
|
||||
@ -39,7 +39,7 @@
|
||||
exports.remove = {
|
||||
signature: 'env rm <id>',
|
||||
description: 'remove an environment variable',
|
||||
help: 'Use this command to remove an environment variable from an application.\n\nDon\'t remove resin specific variables, as things might not work as expected.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n $ resin env rm 215\n $ resin env rm 215 --yes',
|
||||
help: 'Use this command to remove an environment variable from an application.\n\nDon\'t remove resin specific variables, as things might not work as expected.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n\n $ resin env rm 215\n $ resin env rm 215 --yes',
|
||||
options: [commandOptions.yes],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
@ -52,7 +52,7 @@
|
||||
exports.add = {
|
||||
signature: 'env add <key> [value]',
|
||||
description: 'add an environment variable',
|
||||
help: 'Use this command to add an enviroment variable to an application.\n\nYou need to pass the `--application` option.\n\nIf value is omitted, the tool will attempt to use the variable\'s value\nas defined in your host machine.\n\nIf the value is grabbed from the environment, a warning message will be printed.\nUse `--quiet` to remove it.\n\nExamples:\n $ resin env add EDITOR vim -a 91\n $ resin env add TERM -a 91',
|
||||
help: 'Use this command to add an enviroment variable to an application.\n\nYou need to pass the `--application` option.\n\nIf value is omitted, the tool will attempt to use the variable\'s value\nas defined in your host machine.\n\nIf the value is grabbed from the environment, a warning message will be printed.\nUse `--quiet` to remove it.\n\nExamples:\n\n $ resin env add EDITOR vim -a 91\n $ resin env add TERM -a 91',
|
||||
options: [commandOptions.application],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
@ -71,7 +71,7 @@
|
||||
exports.rename = {
|
||||
signature: 'env rename <id> <value>',
|
||||
description: 'rename an environment variable',
|
||||
help: 'Use this command to rename an enviroment variable from an application.\n\nExamples:\n $ resin env rename 376 emacs',
|
||||
help: 'Use this command to rename an enviroment variable from an application.\n\nExamples:\n\n $ resin env rename 376 emacs',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.models.environmentVariables.update(params.id, params.value, done);
|
||||
|
@ -20,7 +20,7 @@
|
||||
exports.list = {
|
||||
signature: 'examples',
|
||||
description: 'list all example applications',
|
||||
help: 'Use this command to list available example applications from resin.io\n\nExample:\n $ resin examples',
|
||||
help: 'Use this command to list available example applications from resin.io\n\nExample:\n\n $ resin examples',
|
||||
permission: 'user',
|
||||
action: function() {
|
||||
examplesData = _.map(examplesData, function(example, index) {
|
||||
@ -40,7 +40,7 @@
|
||||
exports.info = {
|
||||
signature: 'example <id>',
|
||||
description: 'list a single example application',
|
||||
help: 'Use this command to show information of a single example application\n\nExample:\n $ resin example 3',
|
||||
help: 'Use this command to show information of a single example application\n\nExample:\n\n $ resin example 3',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var example, id;
|
||||
@ -61,7 +61,7 @@
|
||||
exports.clone = {
|
||||
signature: 'example clone <id>',
|
||||
description: 'clone an example application',
|
||||
help: 'Use this command to clone an example application to the current directory\n\nThis command outputs information about the cloning process.\nUse `--quiet` to remove that output.\n\nExample:\n $ resin example clone 3',
|
||||
help: 'Use this command to clone an example application to the current directory\n\nThis command outputs information about the cloning process.\nUse `--quiet` to remove that output.\n\nExample:\n\n $ resin example clone 3',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var example;
|
||||
|
@ -1,5 +1,5 @@
|
||||
(function() {
|
||||
var PADDING_INITIAL, PADDING_MIDDLE, _, addAlias, addOptionPrefix, buildHelpString, buildOptionSignatureHelp, capitano, getCommandHelp, getFieldMaxLength, getOptionHelp, getOptionsParsedSignatures, resin;
|
||||
var PADDING_INITIAL, PADDING_MIDDLE, _, addAlias, addOptionPrefix, buildHelpString, buildOptionSignatureHelp, capitano, command, general, getCommandHelp, getFieldMaxLength, getOptionHelp, getOptionsParsedSignatures, resin;
|
||||
|
||||
_ = require('lodash');
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
return result;
|
||||
};
|
||||
|
||||
exports.general = function() {
|
||||
general = function() {
|
||||
var command, i, j, len, len1, option, optionSignatureMaxLength, options, ref;
|
||||
console.log('Usage: resin [COMMAND] [OPTIONS]\n');
|
||||
console.log('Commands:\n');
|
||||
@ -112,7 +112,7 @@
|
||||
return console.log();
|
||||
};
|
||||
|
||||
exports.command = function(params, options, done) {
|
||||
command = function(params, options, done) {
|
||||
return capitano.state.getMatchCommand(params.command, function(error, command) {
|
||||
var i, len, option, optionSignatureMaxLength;
|
||||
if (error != null) {
|
||||
@ -149,11 +149,12 @@
|
||||
exports.help = {
|
||||
signature: 'help [command...]',
|
||||
description: 'show help',
|
||||
help: 'Get detailed help for an specific command.\n\nExamples:\n\n $ resin help apps\n $ resin help os download',
|
||||
action: function(params, options, done) {
|
||||
if (params.command != null) {
|
||||
return exports.command(params, options, done);
|
||||
return command(params, options, done);
|
||||
} else {
|
||||
return exports.general(params, options, done);
|
||||
return general(params, options, done);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -6,6 +6,7 @@
|
||||
exports.version = {
|
||||
signature: 'version',
|
||||
description: 'output the version number',
|
||||
help: 'Display the Resin CLI, as well as the bundled NodeJS version.',
|
||||
action: function() {
|
||||
console.log(packageJSON.name + ": " + packageJSON.version);
|
||||
return console.log("node: " + process.version);
|
||||
|
@ -20,7 +20,7 @@
|
||||
exports.list = {
|
||||
signature: 'keys',
|
||||
description: 'list all ssh keys',
|
||||
help: 'Use this command to list all your SSH keys.\n\nExamples:\n $ resin keys',
|
||||
help: 'Use this command to list all your SSH keys.\n\nExamples:\n\n $ resin keys',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.models.key.getAll(function(error, keys) {
|
||||
@ -36,7 +36,7 @@
|
||||
exports.info = {
|
||||
signature: 'key <id>',
|
||||
description: 'list a single ssh key',
|
||||
help: 'Use this command to show information about a single SSH key.\n\nExamples:\n $ resin key 17',
|
||||
help: 'Use this command to show information about a single SSH key.\n\nExamples:\n\n $ resin key 17',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return resin.models.key.get(params.id, function(error, key) {
|
||||
@ -55,7 +55,7 @@
|
||||
exports.remove = {
|
||||
signature: 'key rm <id>',
|
||||
description: 'remove a ssh key',
|
||||
help: 'Use this command to remove a SSH key from resin.io.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n $ resin key rm 17\n $ resin key rm 17 --yes',
|
||||
help: 'Use this command to remove a SSH key from resin.io.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n\n $ resin key rm 17\n $ resin key rm 17 --yes',
|
||||
options: [commandOptions.yes],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
@ -68,7 +68,7 @@
|
||||
exports.add = {
|
||||
signature: 'key add <name> [path]',
|
||||
description: 'add a SSH key to resin.io',
|
||||
help: 'Use this command to associate a new SSH key with your account.\n\nIf `path` is omitted, the command will attempt\nto read the SSH key from stdin.\n\nExamples:\n $ resin key add Main ~/.ssh/id_rsa.pub\n $ cat ~/.ssh/id_rsa.pub | resin key add Main',
|
||||
help: 'Use this command to associate a new SSH key with your account.\n\nIf `path` is omitted, the command will attempt\nto read the SSH key from stdin.\n\nExamples:\n\n $ resin key add Main ~/.ssh/id_rsa.pub\n $ cat ~/.ssh/id_rsa.pub | resin key add Main',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return async.waterfall([
|
||||
|
@ -10,7 +10,7 @@
|
||||
exports.logs = {
|
||||
signature: 'logs <uuid>',
|
||||
description: 'show device logs',
|
||||
help: 'Use this command to show logs for a specific device.\n\nBy default, the command prints all log messages and exit.\n\nTo limit the output to the n last lines, use the `--num` option along with a number.\nThis is similar to doing `resin logs <uuid> | tail -n X`.\n\nTo continuously stream output, and see new logs in real time, use the `--tail` option.\n\nNote that for now you need to provide the whole UUID for this command to work correctly,\nand the tool won\'t notice if you\'re using an invalid UUID.\n\nThis is due to some technical limitations that we plan to address soon.\n\nExamples:\n $ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828\n $ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --num 20\n $ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --tail',
|
||||
help: 'Use this command to show logs for a specific device.\n\nBy default, the command prints all log messages and exit.\n\nTo limit the output to the n last lines, use the `--num` option along with a number.\nThis is similar to doing `resin logs <uuid> | tail -n X`.\n\nTo continuously stream output, and see new logs in real time, use the `--tail` option.\n\nNote that for now you need to provide the whole UUID for this command to work correctly,\nand the tool won\'t notice if you\'re using an invalid UUID.\n\nThis is due to some technical limitations that we plan to address soon.\n\nExamples:\n\n $ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828\n $ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --num 20\n $ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --tail',
|
||||
options: [
|
||||
{
|
||||
signature: 'num',
|
||||
|
@ -8,7 +8,7 @@
|
||||
exports.set = {
|
||||
signature: 'note <|note>',
|
||||
description: 'set a device note',
|
||||
help: 'Use this command to set or update a device note.\n\nIf note command isn\'t passed, the tool attempts to read from `stdin`.\n\nTo view the notes, use $ resin device <id>.\n\nExamples:\n $ resin note "My useful note" --device 317\n $ cat note.txt | resin note --device 317',
|
||||
help: 'Use this command to set or update a device note.\n\nIf note command isn\'t passed, the tool attempts to read from `stdin`.\n\nTo view the notes, use $ resin device <id>.\n\nExamples:\n\n $ resin note "My useful note" --device 317\n $ cat note.txt | resin note --device 317',
|
||||
options: [
|
||||
{
|
||||
signature: 'device',
|
||||
|
@ -26,7 +26,7 @@
|
||||
exports.download = {
|
||||
signature: 'os download <id>',
|
||||
description: 'download device OS',
|
||||
help: 'Use this command to download the device OS configured to a specific network.\n\nEthernet:\n You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".\n\nWifi:\n You can setup the device OS to use wifi by setting the `--network` option to "wifi".\n If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.\n\nBy default, this command saved the downloaded image into a resin specific directory.\nYou can save it to a custom location by specifying the `--output` option.\n\nExamples:\n $ resin os download 91 --network ethernet\n $ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123\n $ resin os download 91 --network ethernet --output ~/MyResinOS.zip',
|
||||
help: 'Use this command to download the device OS configured to a specific network.\n\nEthernet:\n You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".\n\nWifi:\n You can setup the device OS to use wifi by setting the `--network` option to "wifi".\n If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.\n\nBy default, this command saved the downloaded image into a resin specific directory.\nYou can save it to a custom location by specifying the `--output` option.\n\nExamples:\n\n $ resin os download 91 --network ethernet\n $ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123\n $ resin os download 91 --network ethernet --output ~/MyResinOS.zip',
|
||||
options: [
|
||||
commandOptions.network, commandOptions.wifiSsid, commandOptions.wifiKey, {
|
||||
signature: 'output',
|
||||
@ -72,7 +72,7 @@
|
||||
exports.install = {
|
||||
signature: 'os install <image> [device]',
|
||||
description: 'write an operating system image to a device',
|
||||
help: 'Use this command to write an operating system image to a device.\n\nNote that this command requires admin privileges.\n\nIf `device` is omitted, you will be prompted to select a device interactively.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nYou can quiet the progress bar by passing the `--quiet` boolean option.\n\nYou may have to unmount the device before attempting this operation.\n\nSee the `drives` command to get a list of all connected devices to your machine and their respective ids.\n\nIn Mac OS X:\n $ sudo diskutil unmountDisk /dev/xxx\n\nIn GNU/Linux:\n $ sudo umount /dev/xxx\n\nExamples:\n $ resin os install rpi.iso /dev/disk2',
|
||||
help: 'Use this command to write an operating system image to a device.\n\nNote that this command requires admin privileges.\n\nIf `device` is omitted, you will be prompted to select a device interactively.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nYou can quiet the progress bar by passing the `--quiet` boolean option.\n\nYou may have to unmount the device before attempting this operation.\n\nSee the `drives` command to get a list of all connected devices to your machine and their respective ids.\n\nIn Mac OS X:\n\n $ sudo diskutil unmountDisk /dev/xxx\n\nIn GNU/Linux:\n\n $ sudo umount /dev/xxx\n\nExamples:\n\n $ resin os install rpi.iso /dev/disk2',
|
||||
options: [commandOptions.yes],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
exports.list = {
|
||||
signature: 'plugins',
|
||||
description: 'list all plugins',
|
||||
help: 'Use this command to list all the installed resin plugins.\n\nExamples:\n $ resin plugins',
|
||||
help: 'Use this command to list all the installed resin plugins.\n\nExamples:\n\n $ resin plugins',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return plugins.list(function(error, resinPlugins) {
|
||||
@ -32,7 +32,7 @@
|
||||
exports.install = {
|
||||
signature: 'plugin install <name>',
|
||||
description: 'install a plugin',
|
||||
help: 'Use this command to install a resin plugin\n\nUse `--quiet` to prevent information logging.\n\nExamples:\n $ resin plugin install hello',
|
||||
help: 'Use this command to install a resin plugin\n\nUse `--quiet` to prevent information logging.\n\nExamples:\n\n $ resin plugin install hello',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return plugins.install(params.name, function(error) {
|
||||
@ -48,7 +48,7 @@
|
||||
exports.update = {
|
||||
signature: 'plugin update <name>',
|
||||
description: 'update a plugin',
|
||||
help: 'Use this command to update a resin plugin\n\nUse `--quiet` to prevent information logging.\n\nExamples:\n $ resin plugin update hello',
|
||||
help: 'Use this command to update a resin plugin\n\nUse `--quiet` to prevent information logging.\n\nExamples:\n\n $ resin plugin update hello',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
return plugins.update(params.name, function(error, version) {
|
||||
@ -64,7 +64,7 @@
|
||||
exports.remove = {
|
||||
signature: 'plugin rm <name>',
|
||||
description: 'remove a plugin',
|
||||
help: 'Use this command to remove a resin.io plugin.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n $ resin plugin rm hello\n $ resin plugin rm hello --yes',
|
||||
help: 'Use this command to remove a resin.io plugin.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nExamples:\n\n $ resin plugin rm hello\n $ resin plugin rm hello --yes',
|
||||
options: [commandOptions.yes],
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
|
@ -10,7 +10,7 @@
|
||||
exports.preferences = {
|
||||
signature: 'preferences',
|
||||
description: 'open preferences form',
|
||||
help: 'Use this command to open the preferences form.\n\nIn the future, we will allow changing all preferences directly from the terminal.\nFor now, we open your default web browser and point it to the web based preferences form.\n\nExamples:\n $ resin preferences',
|
||||
help: 'Use this command to open the preferences form.\n\nIn the future, we will allow changing all preferences directly from the terminal.\nFor now, we open your default web browser and point it to the web based preferences form.\n\nExamples:\n\n $ resin preferences',
|
||||
permission: 'user',
|
||||
action: function() {
|
||||
var absUrl, preferencesUrl;
|
||||
|
21
doc/app/create.md
Normal file
21
doc/app/create.md
Normal file
@ -0,0 +1,21 @@
|
||||
# app create <name>
|
||||
|
||||
Use this command to create a new resin.io application.
|
||||
|
||||
You can specify the application type with the `--type` option.
|
||||
Otherwise, an interactive dropdown will be shown for you to select from.
|
||||
|
||||
You can see a list of supported device types with
|
||||
|
||||
$ resin devices supported
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin app create MyApp
|
||||
$ resin app create MyApp --type raspberry-pi
|
||||
|
||||
## Options
|
||||
|
||||
### --type, -t <type>
|
||||
|
||||
application type
|
7
doc/app/info.md
Normal file
7
doc/app/info.md
Normal file
@ -0,0 +1,7 @@
|
||||
# app <id>
|
||||
|
||||
Use this command to show detailed information for a single application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin app 91
|
10
doc/app/init.md
Normal file
10
doc/app/init.md
Normal file
@ -0,0 +1,10 @@
|
||||
# init <id>
|
||||
|
||||
Use this command to associate a local project to an existing resin.io application.
|
||||
|
||||
The application should be a git repository before issuing this command.
|
||||
Notice this command adds a `resin` git remote to your application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ cd myApp && resin init 91
|
10
doc/app/list.md
Normal file
10
doc/app/list.md
Normal file
@ -0,0 +1,10 @@
|
||||
# apps
|
||||
|
||||
Use this command to list all your applications.
|
||||
|
||||
Notice this command only shows the most important bits of information for each app.
|
||||
If you want detailed information, use resin app <id> instead.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin apps
|
17
doc/app/remove.md
Normal file
17
doc/app/remove.md
Normal file
@ -0,0 +1,17 @@
|
||||
# app rm <id>
|
||||
|
||||
Use this command to remove a resin.io application.
|
||||
|
||||
Notice this command asks for confirmation interactively.
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin app rm 91
|
||||
$ resin app rm 91 --yes
|
||||
|
||||
## Options
|
||||
|
||||
### --yes, -y
|
||||
|
||||
confirm non interactively
|
7
doc/app/restart.md
Normal file
7
doc/app/restart.md
Normal file
@ -0,0 +1,7 @@
|
||||
# app restart <id>
|
||||
|
||||
Use this command to restart all devices that belongs to a certain application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin app restart 91
|
22
doc/auth/login.md
Normal file
22
doc/auth/login.md
Normal file
@ -0,0 +1,22 @@
|
||||
# login
|
||||
|
||||
Use this command to login to your resin.io account.
|
||||
You need to login before you can use most of the commands this tool provides.
|
||||
|
||||
You can pass your credentials as `--username` and `--password` options, or you can omit the
|
||||
credentials, in which case the tool will present you with an interactive login form.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin login --username <username> --password <password>
|
||||
$ resin login
|
||||
|
||||
## Options
|
||||
|
||||
### --username, -u <username>
|
||||
|
||||
user name
|
||||
|
||||
### --password, -p <password>
|
||||
|
||||
user password
|
7
doc/auth/logout.md
Normal file
7
doc/auth/logout.md
Normal file
@ -0,0 +1,7 @@
|
||||
# logout
|
||||
|
||||
Use this command to logout from your resin.io account.o
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin logout
|
31
doc/auth/signup.md
Normal file
31
doc/auth/signup.md
Normal file
@ -0,0 +1,31 @@
|
||||
# signup
|
||||
|
||||
Use this command to signup for a resin.io account.
|
||||
|
||||
If signup is successful, you'll be logged in to your new user automatically.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin signup
|
||||
Email: me@mycompany.com
|
||||
Username: johndoe
|
||||
Password: ***********
|
||||
|
||||
$ resin signup --email me@mycompany.com --username johndoe --password ***********
|
||||
|
||||
$ resin whoami
|
||||
johndoe
|
||||
|
||||
## Options
|
||||
|
||||
### --email, -e <email>
|
||||
|
||||
user email
|
||||
|
||||
### --username, -u <username>
|
||||
|
||||
user name
|
||||
|
||||
### --password, -p <user password>
|
||||
|
||||
user password
|
7
doc/auth/whoami.md
Normal file
7
doc/auth/whoami.md
Normal file
@ -0,0 +1,7 @@
|
||||
# whoami
|
||||
|
||||
Use this command to find out the current logged in username.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin whoami
|
9
doc/device/identify.md
Normal file
9
doc/device/identify.md
Normal file
@ -0,0 +1,9 @@
|
||||
# device identify <uuid>
|
||||
|
||||
Use this command to identify a device.
|
||||
|
||||
In the Raspberry Pi, the ACT led is blinked several times.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device identify 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828
|
7
doc/device/info.md
Normal file
7
doc/device/info.md
Normal file
@ -0,0 +1,7 @@
|
||||
# device <id>
|
||||
|
||||
Use this command to show information about a single device.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device 317
|
46
doc/device/init.md
Normal file
46
doc/device/init.md
Normal file
@ -0,0 +1,46 @@
|
||||
# device init [device]
|
||||
|
||||
Use this command to download the OS image of a certain application and write it to an SD Card.
|
||||
|
||||
Note that this command requires admin privileges.
|
||||
|
||||
If `device` is omitted, you will be prompted to select a device interactively.
|
||||
|
||||
Notice this command asks for confirmation interactively.
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
You can quiet the progress bar by passing the `--quiet` boolean option.
|
||||
|
||||
You may have to unmount the device before attempting this operation.
|
||||
|
||||
You need to configure the network type and other settings:
|
||||
|
||||
Ethernet:
|
||||
You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".
|
||||
|
||||
Wifi:
|
||||
You can setup the device OS to use wifi by setting the `--network` option to "wifi".
|
||||
If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device init --application 91 --network ethernet
|
||||
$ resin device init /dev/disk2 --application 91 --network wifi --ssid MyNetwork --key secret
|
||||
|
||||
## Options
|
||||
|
||||
### --application, --a,app, --a,app <application>
|
||||
|
||||
application id
|
||||
|
||||
### --network, -n <network>
|
||||
|
||||
network type
|
||||
|
||||
### --ssid, -s <ssid>
|
||||
|
||||
wifi ssid, if network is wifi
|
||||
|
||||
### --key, -k <key>
|
||||
|
||||
wifi key, if network is wifi
|
13
doc/device/list.md
Normal file
13
doc/device/list.md
Normal file
@ -0,0 +1,13 @@
|
||||
# devices
|
||||
|
||||
Use this command to list all devices that belong to a certain application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin devices --application 91
|
||||
|
||||
## Options
|
||||
|
||||
### --application, --a,app, --a,app <application>
|
||||
|
||||
application id
|
17
doc/device/remove.md
Normal file
17
doc/device/remove.md
Normal file
@ -0,0 +1,17 @@
|
||||
# device rm <id>
|
||||
|
||||
Use this command to remove a device from resin.io.
|
||||
|
||||
Notice this command asks for confirmation interactively.
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device rm 317
|
||||
$ resin device rm 317 --yes
|
||||
|
||||
## Options
|
||||
|
||||
### --yes, -y
|
||||
|
||||
confirm non interactively
|
10
doc/device/rename.md
Normal file
10
doc/device/rename.md
Normal file
@ -0,0 +1,10 @@
|
||||
# device rename <id> [name]
|
||||
|
||||
Use this command to rename a device.
|
||||
|
||||
If you omit the name, you'll get asked for it interactively.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device rename 317 MyPi
|
||||
$ resin device rename 317
|
7
doc/device/supported.md
Normal file
7
doc/device/supported.md
Normal file
@ -0,0 +1,7 @@
|
||||
# devices supported
|
||||
|
||||
Use this command to get the list of all supported devices
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin devices supported
|
7
doc/drive/list.md
Normal file
7
doc/drive/list.md
Normal file
@ -0,0 +1,7 @@
|
||||
# drives
|
||||
|
||||
Use this command to list all drives that are connected to your machine.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin drives
|
22
doc/environment-variables/add.md
Normal file
22
doc/environment-variables/add.md
Normal file
@ -0,0 +1,22 @@
|
||||
# env add <key> [value]
|
||||
|
||||
Use this command to add an enviroment variable to an application.
|
||||
|
||||
You need to pass the `--application` option.
|
||||
|
||||
If value is omitted, the tool will attempt to use the variable's value
|
||||
as defined in your host machine.
|
||||
|
||||
If the value is grabbed from the environment, a warning message will be printed.
|
||||
Use `--quiet` to remove it.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin env add EDITOR vim -a 91
|
||||
$ resin env add TERM -a 91
|
||||
|
||||
## Options
|
||||
|
||||
### --application, --a,app, --a,app <application>
|
||||
|
||||
application id
|
23
doc/environment-variables/list.md
Normal file
23
doc/environment-variables/list.md
Normal file
@ -0,0 +1,23 @@
|
||||
# envs
|
||||
|
||||
Use this command to list all environment variables for a particular application.
|
||||
Notice we will support per-device environment variables soon.
|
||||
|
||||
This command lists all custom environment variables set on the devices running
|
||||
the application. If you want to see all environment variables, including private
|
||||
ones used by resin, use the verbose option.
|
||||
|
||||
Example:
|
||||
|
||||
$ resin envs --application 91
|
||||
$ resin envs --application 91 --verbose
|
||||
|
||||
## Options
|
||||
|
||||
### --application, --a,app, --a,app <application>
|
||||
|
||||
application id
|
||||
|
||||
### --verbose, -v
|
||||
|
||||
show private environment variables
|
19
doc/environment-variables/remove.md
Normal file
19
doc/environment-variables/remove.md
Normal file
@ -0,0 +1,19 @@
|
||||
# env rm <id>
|
||||
|
||||
Use this command to remove an environment variable from an application.
|
||||
|
||||
Don't remove resin specific variables, as things might not work as expected.
|
||||
|
||||
Notice this command asks for confirmation interactively.
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin env rm 215
|
||||
$ resin env rm 215 --yes
|
||||
|
||||
## Options
|
||||
|
||||
### --yes, -y
|
||||
|
||||
confirm non interactively
|
7
doc/environment-variables/rename.md
Normal file
7
doc/environment-variables/rename.md
Normal file
@ -0,0 +1,7 @@
|
||||
# env rename <id> <value>
|
||||
|
||||
Use this command to rename an enviroment variable from an application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin env rename 376 emacs
|
10
doc/examples/clone.md
Normal file
10
doc/examples/clone.md
Normal file
@ -0,0 +1,10 @@
|
||||
# example clone <id>
|
||||
|
||||
Use this command to clone an example application to the current directory
|
||||
|
||||
This command outputs information about the cloning process.
|
||||
Use `--quiet` to remove that output.
|
||||
|
||||
Example:
|
||||
|
||||
$ resin example clone 3
|
7
doc/examples/info.md
Normal file
7
doc/examples/info.md
Normal file
@ -0,0 +1,7 @@
|
||||
# example <id>
|
||||
|
||||
Use this command to show information of a single example application
|
||||
|
||||
Example:
|
||||
|
||||
$ resin example 3
|
7
doc/examples/list.md
Normal file
7
doc/examples/list.md
Normal file
@ -0,0 +1,7 @@
|
||||
# examples
|
||||
|
||||
Use this command to list available example applications from resin.io
|
||||
|
||||
Example:
|
||||
|
||||
$ resin examples
|
8
doc/help/help.md
Normal file
8
doc/help/help.md
Normal file
@ -0,0 +1,8 @@
|
||||
# help [command...]
|
||||
|
||||
Get detailed help for an specific command.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin help apps
|
||||
$ resin help os download
|
3
doc/info/version.md
Normal file
3
doc/info/version.md
Normal file
@ -0,0 +1,3 @@
|
||||
# version
|
||||
|
||||
Display the Resin CLI, as well as the bundled NodeJS version.
|
11
doc/keys/add.md
Normal file
11
doc/keys/add.md
Normal file
@ -0,0 +1,11 @@
|
||||
# key add <name> [path]
|
||||
|
||||
Use this command to associate a new SSH key with your account.
|
||||
|
||||
If `path` is omitted, the command will attempt
|
||||
to read the SSH key from stdin.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin key add Main ~/.ssh/id_rsa.pub
|
||||
$ cat ~/.ssh/id_rsa.pub | resin key add Main
|
7
doc/keys/info.md
Normal file
7
doc/keys/info.md
Normal file
@ -0,0 +1,7 @@
|
||||
# key <id>
|
||||
|
||||
Use this command to show information about a single SSH key.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin key 17
|
7
doc/keys/list.md
Normal file
7
doc/keys/list.md
Normal file
@ -0,0 +1,7 @@
|
||||
# keys
|
||||
|
||||
Use this command to list all your SSH keys.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin keys
|
17
doc/keys/remove.md
Normal file
17
doc/keys/remove.md
Normal file
@ -0,0 +1,17 @@
|
||||
# key rm <id>
|
||||
|
||||
Use this command to remove a SSH key from resin.io.
|
||||
|
||||
Notice this command asks for confirmation interactively.
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin key rm 17
|
||||
$ resin key rm 17 --yes
|
||||
|
||||
## Options
|
||||
|
||||
### --yes, -y
|
||||
|
||||
confirm non interactively
|
18
doc/notes/set.md
Normal file
18
doc/notes/set.md
Normal file
@ -0,0 +1,18 @@
|
||||
# note <|note>
|
||||
|
||||
Use this command to set or update a device note.
|
||||
|
||||
If note command isn't passed, the tool attempts to read from `stdin`.
|
||||
|
||||
To view the notes, use $ resin device <id>.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin note "My useful note" --device 317
|
||||
$ cat note.txt | resin note --device 317
|
||||
|
||||
## Options
|
||||
|
||||
### --device, --d,dev, --d,dev <device>
|
||||
|
||||
device id
|
37
doc/os/download.md
Normal file
37
doc/os/download.md
Normal file
@ -0,0 +1,37 @@
|
||||
# os download <id>
|
||||
|
||||
Use this command to download the device OS configured to a specific network.
|
||||
|
||||
Ethernet:
|
||||
You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".
|
||||
|
||||
Wifi:
|
||||
You can setup the device OS to use wifi by setting the `--network` option to "wifi".
|
||||
If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.
|
||||
|
||||
By default, this command saved the downloaded image into a resin specific directory.
|
||||
You can save it to a custom location by specifying the `--output` option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin os download 91 --network ethernet
|
||||
$ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123
|
||||
$ resin os download 91 --network ethernet --output ~/MyResinOS.zip
|
||||
|
||||
## Options
|
||||
|
||||
### --network, -n <network>
|
||||
|
||||
network type
|
||||
|
||||
### --ssid, -s <ssid>
|
||||
|
||||
wifi ssid, if network is wifi
|
||||
|
||||
### --key, -k <key>
|
||||
|
||||
wifi key, if network is wifi
|
||||
|
||||
### --output, -o <output>
|
||||
|
||||
output file
|
34
doc/os/install.md
Normal file
34
doc/os/install.md
Normal file
@ -0,0 +1,34 @@
|
||||
# os install <image> [device]
|
||||
|
||||
Use this command to write an operating system image to a device.
|
||||
|
||||
Note that this command requires admin privileges.
|
||||
|
||||
If `device` is omitted, you will be prompted to select a device interactively.
|
||||
|
||||
Notice this command asks for confirmation interactively.
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
You can quiet the progress bar by passing the `--quiet` boolean option.
|
||||
|
||||
You may have to unmount the device before attempting this operation.
|
||||
|
||||
See the `drives` command to get a list of all connected devices to your machine and their respective ids.
|
||||
|
||||
In Mac OS X:
|
||||
|
||||
$ sudo diskutil unmountDisk /dev/xxx
|
||||
|
||||
In GNU/Linux:
|
||||
|
||||
$ sudo umount /dev/xxx
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin os install rpi.iso /dev/disk2
|
||||
|
||||
## Options
|
||||
|
||||
### --yes, -y
|
||||
|
||||
confirm non interactively
|
9
doc/plugin/install.md
Normal file
9
doc/plugin/install.md
Normal file
@ -0,0 +1,9 @@
|
||||
# plugin install <name>
|
||||
|
||||
Use this command to install a resin plugin
|
||||
|
||||
Use `--quiet` to prevent information logging.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin plugin install hello
|
7
doc/plugin/list.md
Normal file
7
doc/plugin/list.md
Normal file
@ -0,0 +1,7 @@
|
||||
# plugins
|
||||
|
||||
Use this command to list all the installed resin plugins.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin plugins
|
17
doc/plugin/remove.md
Normal file
17
doc/plugin/remove.md
Normal file
@ -0,0 +1,17 @@
|
||||
# plugin rm <name>
|
||||
|
||||
Use this command to remove a resin.io plugin.
|
||||
|
||||
Notice this command asks for confirmation interactively.
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin plugin rm hello
|
||||
$ resin plugin rm hello --yes
|
||||
|
||||
## Options
|
||||
|
||||
### --yes, -y
|
||||
|
||||
confirm non interactively
|
9
doc/plugin/update.md
Normal file
9
doc/plugin/update.md
Normal file
@ -0,0 +1,9 @@
|
||||
# plugin update <name>
|
||||
|
||||
Use this command to update a resin plugin
|
||||
|
||||
Use `--quiet` to prevent information logging.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin plugin update hello
|
10
doc/preferences/preferences.md
Normal file
10
doc/preferences/preferences.md
Normal file
@ -0,0 +1,10 @@
|
||||
# preferences
|
||||
|
||||
Use this command to open the preferences form.
|
||||
|
||||
In the future, we will allow changing all preferences directly from the terminal.
|
||||
For now, we open your default web browser and point it to the web based preferences form.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin preferences
|
20
extras/capitano-doc/index.coffee
Normal file
20
extras/capitano-doc/index.coffee
Normal file
@ -0,0 +1,20 @@
|
||||
mkdirp = require('mkdirp')
|
||||
fs = require('fs')
|
||||
path = require('path')
|
||||
capitano = require('capitano')
|
||||
markdown = require('./markdown')
|
||||
|
||||
capitano.command
|
||||
signature: 'markdown <file> <output>'
|
||||
description: 'file to markdown'
|
||||
action: (params, options, done) ->
|
||||
mkdirp.sync(params.output)
|
||||
action = require(params.file)
|
||||
|
||||
for actionName, actionCommand of action
|
||||
output = path.join(params.output, "#{actionName}.md")
|
||||
fs.writeFileSync(output, markdown.command(actionCommand))
|
||||
|
||||
return done()
|
||||
|
||||
capitano.run(process.argv)
|
23
extras/capitano-doc/markdown.coffee
Normal file
23
extras/capitano-doc/markdown.coffee
Normal file
@ -0,0 +1,23 @@
|
||||
_ = require('lodash')
|
||||
utils = require('./utils')
|
||||
|
||||
exports.option = (option) ->
|
||||
result = utils.parseSignature(option)
|
||||
|
||||
exports.command = (command) ->
|
||||
result = """
|
||||
# #{command.signature}
|
||||
|
||||
#{command.help}\n
|
||||
"""
|
||||
|
||||
if not _.isEmpty(command.options)
|
||||
result += '\n## Options'
|
||||
|
||||
for option in command.options
|
||||
result += """
|
||||
\n\n### #{utils.parseSignature(option)}
|
||||
|
||||
#{option.description}
|
||||
"""
|
||||
return result
|
25
extras/capitano-doc/utils.coffee
Normal file
25
extras/capitano-doc/utils.coffee
Normal file
@ -0,0 +1,25 @@
|
||||
_ = require('lodash')
|
||||
|
||||
exports.getOptionPrefix = (signature) ->
|
||||
if signature.length > 1
|
||||
return '--'
|
||||
else
|
||||
return '-'
|
||||
|
||||
exports.getOptionSignature = (signature) ->
|
||||
return "#{exports.getOptionPrefix(signature)}#{signature}"
|
||||
|
||||
exports.parseSignature = (option) ->
|
||||
result = exports.getOptionSignature(option.signature)
|
||||
|
||||
if not _.isEmpty(option.alias)
|
||||
if _.isString(option.alias)
|
||||
result += ", #{exports.getOptionSignature(option.alias)}"
|
||||
else
|
||||
for alias in option.alias
|
||||
result += ", #{exports.getOptionSignature(option.alias)}"
|
||||
|
||||
if option.parameter?
|
||||
result += " <#{option.parameter}>"
|
||||
|
||||
return result
|
@ -14,9 +14,11 @@ exports.create =
|
||||
Otherwise, an interactive dropdown will be shown for you to select from.
|
||||
|
||||
You can see a list of supported device types with
|
||||
|
||||
$ resin devices supported
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin app create MyApp
|
||||
$ resin app create MyApp --type raspberry-pi
|
||||
'''
|
||||
@ -54,6 +56,7 @@ exports.list =
|
||||
If you want detailed information, use resin app <id> instead.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin apps
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -76,6 +79,7 @@ exports.info =
|
||||
Use this command to show detailed information for a single application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin app 91
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -98,6 +102,7 @@ exports.restart =
|
||||
Use this command to restart all devices that belongs to a certain application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin app restart 91
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -114,6 +119,7 @@ exports.remove =
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin app rm 91
|
||||
$ resin app rm 91 --yes
|
||||
'''
|
||||
@ -134,6 +140,7 @@ exports.init =
|
||||
Notice this command adds a `resin` git remote to your application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ cd myApp && resin init 91
|
||||
'''
|
||||
permission: 'user'
|
||||
|
@ -15,6 +15,7 @@ exports.login =
|
||||
credentials, in which case the tool will present you with an interactive login form.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin login --username <username> --password <password>
|
||||
$ resin login
|
||||
'''
|
||||
@ -64,6 +65,7 @@ exports.logout =
|
||||
Use this command to logout from your resin.io account.o
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin logout
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -79,6 +81,7 @@ exports.signup =
|
||||
If signup is successful, you'll be logged in to your new user automatically.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin signup
|
||||
Email: me@mycompany.com
|
||||
Username: johndoe
|
||||
@ -146,6 +149,7 @@ exports.whoami =
|
||||
Use this command to find out the current logged in username.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin whoami
|
||||
'''
|
||||
permission: 'user'
|
||||
|
@ -13,6 +13,7 @@ exports.list =
|
||||
Use this command to list all devices that belong to a certain application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin devices --application 91
|
||||
'''
|
||||
options: [ commandOptions.application ]
|
||||
@ -39,6 +40,7 @@ exports.info =
|
||||
Use this command to show information about a single device.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device 317
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -73,6 +75,7 @@ exports.remove =
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device rm 317
|
||||
$ resin device rm 317 --yes
|
||||
'''
|
||||
@ -92,6 +95,7 @@ exports.identify =
|
||||
In the Raspberry Pi, the ACT led is blinked several times.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device identify 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -107,6 +111,7 @@ exports.rename =
|
||||
If you omit the name, you'll get asked for it interactively.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device rename 317 MyPi
|
||||
$ resin device rename 317
|
||||
'''
|
||||
@ -131,6 +136,7 @@ exports.supported =
|
||||
Use this command to get the list of all supported devices
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin devices supported
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -160,13 +166,14 @@ exports.init =
|
||||
You need to configure the network type and other settings:
|
||||
|
||||
Ethernet:
|
||||
You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".
|
||||
You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".
|
||||
|
||||
Wifi:
|
||||
You can setup the device OS to use wifi by setting the `--network` option to "wifi".
|
||||
If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.
|
||||
You can setup the device OS to use wifi by setting the `--network` option to "wifi".
|
||||
If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin device init --application 91 --network ethernet
|
||||
$ resin device init /dev/disk2 --application 91 --network wifi --ssid MyNetwork --key secret
|
||||
'''
|
||||
|
@ -10,6 +10,7 @@ exports.list =
|
||||
Use this command to list all drives that are connected to your machine.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin drives
|
||||
'''
|
||||
permission: 'user'
|
||||
|
@ -15,6 +15,7 @@ exports.list =
|
||||
ones used by resin, use the verbose option.
|
||||
|
||||
Example:
|
||||
|
||||
$ resin envs --application 91
|
||||
$ resin envs --application 91 --verbose
|
||||
'''
|
||||
@ -56,6 +57,7 @@ exports.remove =
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin env rm 215
|
||||
$ resin env rm 215 --yes
|
||||
'''
|
||||
@ -81,6 +83,7 @@ exports.add =
|
||||
Use `--quiet` to remove it.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin env add EDITOR vim -a 91
|
||||
$ resin env add TERM -a 91
|
||||
'''
|
||||
@ -104,6 +107,7 @@ exports.rename =
|
||||
Use this command to rename an enviroment variable from an application.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin env rename 376 emacs
|
||||
'''
|
||||
permission: 'user'
|
||||
|
@ -14,6 +14,7 @@ exports.list =
|
||||
Use this command to list available example applications from resin.io
|
||||
|
||||
Example:
|
||||
|
||||
$ resin examples
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -40,6 +41,7 @@ exports.info =
|
||||
Use this command to show information of a single example application
|
||||
|
||||
Example:
|
||||
|
||||
$ resin example 3
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -73,6 +75,7 @@ exports.clone =
|
||||
Use `--quiet` to remove that output.
|
||||
|
||||
Example:
|
||||
|
||||
$ resin example clone 3
|
||||
'''
|
||||
permission: 'user'
|
||||
|
@ -60,7 +60,7 @@ getOptionHelp = (option, maxLength) ->
|
||||
result += option.description
|
||||
return result
|
||||
|
||||
exports.general = ->
|
||||
general = ->
|
||||
console.log('Usage: resin [COMMAND] [OPTIONS]\n')
|
||||
console.log('Commands:\n')
|
||||
|
||||
@ -82,7 +82,7 @@ exports.general = ->
|
||||
|
||||
console.log()
|
||||
|
||||
exports.command = (params, options, done) ->
|
||||
command = (params, options, done) ->
|
||||
capitano.state.getMatchCommand params.command, (error, command) ->
|
||||
return done(error) if error?
|
||||
|
||||
@ -116,8 +116,16 @@ exports.command = (params, options, done) ->
|
||||
exports.help =
|
||||
signature: 'help [command...]'
|
||||
description: 'show help'
|
||||
help: '''
|
||||
Get detailed help for an specific command.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin help apps
|
||||
$ resin help os download
|
||||
'''
|
||||
action: (params, options, done) ->
|
||||
if params.command?
|
||||
exports.command(params, options, done)
|
||||
command(params, options, done)
|
||||
else
|
||||
exports.general(params, options, done)
|
||||
general(params, options, done)
|
||||
|
@ -3,6 +3,9 @@ packageJSON = require('../../package.json')
|
||||
exports.version =
|
||||
signature: 'version'
|
||||
description: 'output the version number'
|
||||
help: '''
|
||||
Display the Resin CLI, as well as the bundled NodeJS version.
|
||||
'''
|
||||
action: ->
|
||||
console.log("#{packageJSON.name}: #{packageJSON.version}")
|
||||
console.log("node: #{process.version}")
|
||||
|
@ -14,6 +14,7 @@ exports.list =
|
||||
Use this command to list all your SSH keys.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin keys
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -30,6 +31,7 @@ exports.info =
|
||||
Use this command to show information about a single SSH key.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin key 17
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -53,6 +55,7 @@ exports.remove =
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin key rm 17
|
||||
$ resin key rm 17 --yes
|
||||
'''
|
||||
@ -73,6 +76,7 @@ exports.add =
|
||||
to read the SSH key from stdin.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin key add Main ~/.ssh/id_rsa.pub
|
||||
$ cat ~/.ssh/id_rsa.pub | resin key add Main
|
||||
'''
|
||||
|
@ -22,6 +22,7 @@ exports.logs =
|
||||
This is due to some technical limitations that we plan to address soon.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828
|
||||
$ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --num 20
|
||||
$ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --tail
|
||||
|
@ -12,6 +12,7 @@ exports.set =
|
||||
To view the notes, use $ resin device <id>.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin note "My useful note" --device 317
|
||||
$ cat note.txt | resin note --device 317
|
||||
'''
|
||||
|
@ -27,6 +27,7 @@ exports.download =
|
||||
You can save it to a custom location by specifying the `--output` option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin os download 91 --network ethernet
|
||||
$ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123
|
||||
$ resin os download 91 --network ethernet --output ~/MyResinOS.zip
|
||||
@ -94,12 +95,15 @@ exports.install =
|
||||
See the `drives` command to get a list of all connected devices to your machine and their respective ids.
|
||||
|
||||
In Mac OS X:
|
||||
|
||||
$ sudo diskutil unmountDisk /dev/xxx
|
||||
|
||||
In GNU/Linux:
|
||||
|
||||
$ sudo umount /dev/xxx
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin os install rpi.iso /dev/disk2
|
||||
'''
|
||||
options: [ commandOptions.yes ]
|
||||
|
@ -10,6 +10,7 @@ exports.list =
|
||||
Use this command to list all the installed resin plugins.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin plugins
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -39,6 +40,7 @@ exports.install =
|
||||
Use `--quiet` to prevent information logging.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin plugin install hello
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -57,6 +59,7 @@ exports.update =
|
||||
Use `--quiet` to prevent information logging.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin plugin update hello
|
||||
'''
|
||||
permission: 'user'
|
||||
@ -76,6 +79,7 @@ exports.remove =
|
||||
You can avoid this by passing the `--yes` boolean option.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin plugin rm hello
|
||||
$ resin plugin rm hello --yes
|
||||
'''
|
||||
|
@ -12,6 +12,7 @@ exports.preferences =
|
||||
For now, we open your default web browser and point it to the web based preferences form.
|
||||
|
||||
Examples:
|
||||
|
||||
$ resin preferences
|
||||
'''
|
||||
permission: 'user'
|
||||
|
@ -20,7 +20,8 @@
|
||||
"scripts": {
|
||||
"prepublish": "gulp build",
|
||||
"test": "gult test",
|
||||
"install": "node build/install-node.js bin/node"
|
||||
"install": "node build/install-node.js bin/node",
|
||||
"doc": "./scripts/extract-documentation.sh doc lib/actions"
|
||||
},
|
||||
"keywords": [
|
||||
"resin",
|
||||
@ -40,6 +41,7 @@
|
||||
"gulp-mocha": "~1.1.1",
|
||||
"gulp-shell": "^0.2.11",
|
||||
"gulp-util": "~3.0.1",
|
||||
"mkdirp": "^0.5.0",
|
||||
"mocha": "~2.0.1",
|
||||
"mocha-notifier-reporter": "~0.1.0",
|
||||
"run-sequence": "~1.0.2",
|
||||
|
18
scripts/extract-documentation.sh
Executable file
18
scripts/extract-documentation.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
OUTPUT=$1
|
||||
INPUT=$2
|
||||
|
||||
for file in $INPUT/*.coffee; do
|
||||
|
||||
# Omit this unecessary files
|
||||
if [ `basename "$file"` == 'index.coffee' ] || [ `basename "$file"` == 'command-options.coffee' ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
filename=`basename "${file%.*}"`
|
||||
output=$OUTPUT/$filename
|
||||
mkdir -p $output
|
||||
./node_modules/coffee-script/bin/coffee extras/capitano-doc/index.coffee markdown "$file" "$output"
|
||||
echo "[CapitanoDoc] Processed $file to $output"
|
||||
done
|
Loading…
x
Reference in New Issue
Block a user