{"action":"created","comment":{"url":"https://api.github.com/repos/resin-io/resin-cli/pulls/comments/201982784","pull_request_review_id":136587248,"id":201982784,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTk4Mjc4NA==","diff_hunk":"@@ -1129,22 +1136,29 @@ show advanced commands\n \n Use this command to generate a config.json for a device or application.\n \n+Calling this command without --version is not recommended, and may fail in\n+future releases if the OS version cannot be inferred.\n+\n This is interactive by default, but you can do this automatically without interactivity\n by specifying an option for each question on the command line, if you know the questions\n that will be asked for the relevant device type.\n \n Examples:\n \n-\t$ resin config generate --device 7cf02a6\n-\t$ resin config generate --device 7cf02a6 --generate-device-api-key\n-\t$ resin config generate --device 7cf02a6 --device-api-key <existingDeviceKey>\n-\t$ resin config generate --device 7cf02a6 --output config.json\n-\t$ resin config generate --app MyApp\n-\t$ resin config generate --app MyApp --output config.json\n-\t$ resin config generate --app MyApp --network wifi --wifiSsid mySsid --wifiKey abcdefgh --appUpdatePollInterval 1\n+\t$ resin config generate --device 7cf02a6 --version 2.12.7\n+\t$ resin config generate --device 7cf02a6 --version 2.12.7 --generate-device-api-key\n+\t$ resin config generate --device 7cf02a6 --version 2.12.7 --device-api-key <existingDeviceKey>\n+\t$ resin config generate --device 7cf02a6 --version 2.12.7 --output config.json\n+\t$ resin config generate --app MyApp --version 2.12.7\n+\t$ resin config generate --app MyApp --version 2.12.7 --output config.json\n+\t$ resin config generate --app MyApp --version 2.12.7 --network wifi --wifiSsid mySsid --wifiKey abcdefgh --appUpdatePollInterval 1\n \n ### Options\n \n+#### --version &#60;version&#62;\n+\n+a ResinOS version","path":"doc/cli.markdown","position":68,"original_position":68,"commit_id":"743dc88db8f5a5856d3fd323c464e9656a0656f6","original_commit_id":"ecaca9ad03f08256d44dd4c13f136cb25a5534b7","user":{"login":"pimterry","id":1526883,"node_id":"MDQ6VXNlcjE1MjY4ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/1526883?v=4","gravatar_id":"","url":"https://api.github.com/users/pimterry","html_url":"https://github.com/pimterry","followers_url":"https://api.github.com/users/pimterry/followers","following_url":"https://api.github.com/users/pimterry/following{/other_user}","gists_url":"https://api.github.com/users/pimterry/gists{/gist_id}","starred_url":"https://api.github.com/users/pimterry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pimterry/subscriptions","organizations_url":"https://api.github.com/users/pimterry/orgs","repos_url":"https://api.github.com/users/pimterry/repos","events_url":"https://api.github.com/users/pimterry/events{/privacy}","received_events_url":"https://api.github.com/users/pimterry/received_events","type":"User","site_admin":false},"body":"I've left this as is - for whatever reason, all of the option descriptions everywhere start lowercase, and I'd rather leave it consistent for now.","created_at":"2018-07-12T10:15:48Z","updated_at":"2018-07-12T10:15:49Z","html_url":"https://github.com/resin-io/resin-cli/pull/923#discussion_r201982784","pull_request_url":"https://api.github.com/repos/resin-io/resin-cli/pulls/923","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/resin-io/resin-cli/pulls/comments/201982784"},"html":{"href":"https://github.com/resin-io/resin-cli/pull/923#discussion_r201982784"},"pull_request":{"href":"https://api.github.com/repos/resin-io/resin-cli/pulls/923"}},"in_reply_to_id":201879515},"pull_request":{"url":"https://api.github.com/repos/resin-io/resin-cli/pulls/923","id":200822972,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwODIyOTcy","html_url":"https://github.com/resin-io/resin-cli/pull/923","diff_url":"https://github.com/resin-io/resin-cli/pull/923.diff","patch_url":"https://github.com/resin-io/resin-cli/pull/923.patch","issue_url":"https://api.github.com/repos/resin-io/resin-cli/issues/923","number":923,"state":"open","locked":false,"title":"Update OS & config actions to the MC SDK, and add a --version option","user":{"login":"pimterry","id":1526883,"node_id":"MDQ6VXNlcjE1MjY4ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/1526883?v=4","gravatar_id":"","url":"https://api.github.com/users/pimterry","html_url":"https://github.com/pimterry","followers_url":"https://api.github.com/users/pimterry/followers","following_url":"https://api.github.com/users/pimterry/following{/other_user}","gists_url":"https://api.github.com/users/pimterry/gists{/gist_id}","starred_url":"https://api.github.com/users/pimterry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pimterry/subscriptions","organizations_url":"https://api.github.com/users/pimterry/orgs","repos_url":"https://api.github.com/users/pimterry/repos","events_url":"https://api.github.com/users/pimterry/events{/privacy}","received_events_url":"https://api.github.com/users/pimterry/received_events","type":"User","site_admin":false},"body":"Updating this in advance of the full MC update as there's a specific user request for it: #915. Sadly that alone doesn't actually work with named api keys, as it tries to configure by generating a (deprecated) user api key by default, and named api keys don't have permissions for that.\r\n\r\nThus, this PR also adds a `--version` parameter, and ensures that the correct keys are used for all modern versions, which are available when using the CLI with api keys. Some discussion: https://www.flowdock.com/app/rulemotion/resin-frontend/threads/L0654dpqwkQP_6aR1QerYRO47RO.\r\n\r\nIn future, we'll start autodetecting the OS version where possible (i.e. at least for ResinOS >= 2.9.7), and erroring if we can't autodetect and no `--version` is provided. For now though, existing behaviour remains, and `--version` is only strongly recommended.\r\n\r\nChange-Type: patch","created_at":"2018-07-11T20:55:29Z","updated_at":"2018-07-12T10:15:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3d5a33b63a69751abb9f2b9d69a5246755e181c5","assignee":null,"assignees":[],"requested_reviewers":[{"login":"thgreasi","id":1295829,"node_id":"MDQ6VXNlcjEyOTU4Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/1295829?v=4","gravatar_id":"","url":"https://api.github.com/users/thgreasi","html_url":"https://github.com/thgreasi","followers_url":"https://api.github.com/users/thgreasi/followers","following_url":"https://api.github.com/users/thgreasi/following{/other_user}","gists_url":"https://api.github.com/users/thgreasi/gists{/gist_id}","starred_url":"https://api.github.com/users/thgreasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thgreasi/subscriptions","organizations_url":"https://api.github.com/users/thgreasi/orgs","repos_url":"https://api.github.com/users/thgreasi/repos","events_url":"https://api.github.com/users/thgreasi/events{/privacy}","received_events_url":"https://api.github.com/users/thgreasi/received_events","type":"User","site_admin":false},{"login":"shaunmulligan","id":3915043,"node_id":"MDQ6VXNlcjM5MTUwNDM=","avatar_url":"https://avatars1.githubusercontent.com/u/3915043?v=4","gravatar_id":"","url":"https://api.github.com/users/shaunmulligan","html_url":"https://github.com/shaunmulligan","followers_url":"https://api.github.com/users/shaunmulligan/followers","following_url":"https://api.github.com/users/shaunmulligan/following{/other_user}","gists_url":"https://api.github.com/users/shaunmulligan/gists{/gist_id}","starred_url":"https://api.github.com/users/shaunmulligan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaunmulligan/subscriptions","organizations_url":"https://api.github.com/users/shaunmulligan/orgs","repos_url":"https://api.github.com/users/shaunmulligan/repos","events_url":"https://api.github.com/users/shaunmulligan/events{/privacy}","received_events_url":"https://api.github.com/users/shaunmulligan/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/resin-io/resin-cli/pulls/923/commits","review_comments_url":"https://api.github.com/repos/resin-io/resin-cli/pulls/923/comments","review_comment_url":"https://api.github.com/repos/resin-io/resin-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/resin-io/resin-cli/issues/923/comments","statuses_url":"https://api.github.com/repos/resin-io/resin-cli/statuses/743dc88db8f5a5856d3fd323c464e9656a0656f6","head":{"label":"resin-io:update-os-actions-sdk","ref":"update-os-actions-sdk","sha":"743dc88db8f5a5856d3fd323c464e9656a0656f6","user":{"login":"resin-io","id":6157842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTc4NDI=","avatar_url":"https://avatars1.githubusercontent.com/u/6157842?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"repo":{"id":31549380,"node_id":"MDEwOlJlcG9zaXRvcnkzMTU0OTM4MA==","name":"resin-cli","full_name":"resin-io/resin-cli","owner":{"login":"resin-io","id":6157842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTc4NDI=","avatar_url":"https://avatars1.githubusercontent.com/u/6157842?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io/resin-cli","description":"The official resin.io CLI tool.","fork":false,"url":"https://api.github.com/repos/resin-io/resin-cli","forks_url":"https://api.github.com/repos/resin-io/resin-cli/forks","keys_url":"https://api.github.com/repos/resin-io/resin-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io/resin-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io/resin-cli/teams","hooks_url":"https://api.github.com/repos/resin-io/resin-cli/hooks","issue_events_url":"https://api.github.com/repos/resin-io/resin-cli/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io/resin-cli/events","assignees_url":"https://api.github.com/repos/resin-io/resin-cli/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io/resin-cli/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io/resin-cli/tags","blobs_url":"https://api.github.com/repos/resin-io/resin-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io/resin-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io/resin-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io/resin-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io/resin-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io/resin-cli/languages","stargazers_url":"https://api.github.com/repos/resin-io/resin-cli/stargazers","contributors_url":"https://api.github.com/repos/resin-io/resin-cli/contributors","subscribers_url":"https://api.github.com/repos/resin-io/resin-cli/subscribers","subscription_url":"https://api.github.com/repos/resin-io/resin-cli/subscription","commits_url":"https://api.github.com/repos/resin-io/resin-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io/resin-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io/resin-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io/resin-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io/resin-cli/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io/resin-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io/resin-cli/merges","archive_url":"https://api.github.com/repos/resin-io/resin-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io/resin-cli/downloads","issues_url":"https://api.github.com/repos/resin-io/resin-cli/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io/resin-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io/resin-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io/resin-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io/resin-cli/labels{/name}","releases_url":"https://api.github.com/repos/resin-io/resin-cli/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io/resin-cli/deployments","created_at":"2015-03-02T16:18:03Z","updated_at":"2018-07-11T04:28:30Z","pushed_at":"2018-07-12T10:13:53Z","git_url":"git://github.com/resin-io/resin-cli.git","ssh_url":"git@github.com:resin-io/resin-cli.git","clone_url":"https://github.com/resin-io/resin-cli.git","svn_url":"https://github.com/resin-io/resin-cli","homepage":"","size":2500,"stargazers_count":70,"watchers_count":70,"language":"CoffeeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":156,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":15,"open_issues":156,"watchers":70,"default_branch":"master"}},"base":{"label":"resin-io:master","ref":"master","sha":"10a9840b34e4dc64ce1672adcbf928af9407879c","user":{"login":"resin-io","id":6157842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTc4NDI=","avatar_url":"https://avatars1.githubusercontent.com/u/6157842?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"repo":{"id":31549380,"node_id":"MDEwOlJlcG9zaXRvcnkzMTU0OTM4MA==","name":"resin-cli","full_name":"resin-io/resin-cli","owner":{"login":"resin-io","id":6157842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTc4NDI=","avatar_url":"https://avatars1.githubusercontent.com/u/6157842?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io/resin-cli","description":"The official resin.io CLI tool.","fork":false,"url":"https://api.github.com/repos/resin-io/resin-cli","forks_url":"https://api.github.com/repos/resin-io/resin-cli/forks","keys_url":"https://api.github.com/repos/resin-io/resin-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io/resin-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io/resin-cli/teams","hooks_url":"https://api.github.com/repos/resin-io/resin-cli/hooks","issue_events_url":"https://api.github.com/repos/resin-io/resin-cli/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io/resin-cli/events","assignees_url":"https://api.github.com/repos/resin-io/resin-cli/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io/resin-cli/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io/resin-cli/tags","blobs_url":"https://api.github.com/repos/resin-io/resin-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io/resin-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io/resin-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io/resin-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io/resin-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io/resin-cli/languages","stargazers_url":"https://api.github.com/repos/resin-io/resin-cli/stargazers","contributors_url":"https://api.github.com/repos/resin-io/resin-cli/contributors","subscribers_url":"https://api.github.com/repos/resin-io/resin-cli/subscribers","subscription_url":"https://api.github.com/repos/resin-io/resin-cli/subscription","commits_url":"https://api.github.com/repos/resin-io/resin-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io/resin-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io/resin-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io/resin-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io/resin-cli/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io/resin-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io/resin-cli/merges","archive_url":"https://api.github.com/repos/resin-io/resin-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io/resin-cli/downloads","issues_url":"https://api.github.com/repos/resin-io/resin-cli/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io/resin-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io/resin-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io/resin-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io/resin-cli/labels{/name}","releases_url":"https://api.github.com/repos/resin-io/resin-cli/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io/resin-cli/deployments","created_at":"2015-03-02T16:18:03Z","updated_at":"2018-07-11T04:28:30Z","pushed_at":"2018-07-12T10:13:53Z","git_url":"git://github.com/resin-io/resin-cli.git","ssh_url":"git@github.com:resin-io/resin-cli.git","clone_url":"https://github.com/resin-io/resin-cli.git","svn_url":"https://github.com/resin-io/resin-cli","homepage":"","size":2500,"stargazers_count":70,"watchers_count":70,"language":"CoffeeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":156,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":15,"open_issues":156,"watchers":70,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/resin-io/resin-cli/pulls/923"},"html":{"href":"https://github.com/resin-io/resin-cli/pull/923"},"issue":{"href":"https://api.github.com/repos/resin-io/resin-cli/issues/923"},"comments":{"href":"https://api.github.com/repos/resin-io/resin-cli/issues/923/comments"},"review_comments":{"href":"https://api.github.com/repos/resin-io/resin-cli/pulls/923/comments"},"review_comment":{"href":"https://api.github.com/repos/resin-io/resin-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/resin-io/resin-cli/pulls/923/commits"},"statuses":{"href":"https://api.github.com/repos/resin-io/resin-cli/statuses/743dc88db8f5a5856d3fd323c464e9656a0656f6"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"pimterry"}}