{"action":"created","issue":{"url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/563","repository_url":"https://api.github.com/repos/mesosphere/dcos-cli","labels_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/563/labels{/name}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/563/comments","events_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/563/events","html_url":"https://github.com/mesosphere/dcos-cli/issues/563","id":147256173,"number":563,"title":"Accept stdin for options file content on \"dcos package install\"","user":{"login":"nickbp","id":35933,"avatar_url":"https://avatars.githubusercontent.com/u/35933?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbp","html_url":"https://github.com/nickbp","followers_url":"https://api.github.com/users/nickbp/followers","following_url":"https://api.github.com/users/nickbp/following{/other_user}","gists_url":"https://api.github.com/users/nickbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbp/subscriptions","organizations_url":"https://api.github.com/users/nickbp/orgs","repos_url":"https://api.github.com/users/nickbp/repos","events_url":"https://api.github.com/users/nickbp/events{/privacy}","received_events_url":"https://api.github.com/users/nickbp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-10T19:38:05Z","updated_at":"2016-04-12T00:46:43Z","closed_at":null,"body":"There's been a couple scenarios where it'd be nice if 'package install' with custom configuration could be done in a single line, without requiring a json file on disk:\r\n- Framework tests need to jump through hoops whenever installing the framework:\r\n  1. create a temp file\r\n  2. run 'dcos package install --options=tempfile'\r\n  3. remove the temp file (occasionally end up with leftover temp files lying around if test is aborted)\r\n- Examples in READMEs need to give multiple steps, eg \"write this data to a file, THEN run dcos package install against the file you just created\". As with the test scenario, users end up with misc json files to be cleaned up.\r\n\r\n_[there must be a better way!](https://i.imgur.com/ZOUJfzl.gif)_\r\n\r\n---\r\n\r\nPlease answer the following questions before submitting your issue. Thanks!\r\n\r\n### What version of the DCOS CLI are you using (`dcos --version`)?\r\nSNAPSHOT\r\n\r\n### What version of DCOS are you using?\r\ntesting/continuous\r\n\r\n### What operating system and version are you using?\r\nUbuntu 15.10\r\n\r\n### What did you do? If possible please provide a recipe for reproducing.\r\n`echo '{ \"brokers\": { \"count\": 3, \"mem\": 2048, \"disk\": 5000 } }' | dcos package install kafka`\r\n\r\nAlternates?:\r\n- `echo '{ \"brokers\": { \"count\": 3, \"mem\": 2048, \"disk\": 5000 } }' | dcos package install kafka --`\r\n- `echo '{ \"brokers\": { \"count\": 3, \"mem\": 2048, \"disk\": 5000 } }' | dcos package install kafka --options`\r\n- `echo '{ \"brokers\": { \"count\": 3, \"mem\": 2048, \"disk\": 5000 } }' | dcos package install kafka --options=stdin`\r\n\r\n### What did you expect to see?\r\nInstall Kafka using the provided json config sent to stdin\r\n\r\n### What did you see instead?\r\nInstall Kafka using default config"},"comment":{"url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/comments/208647709","html_url":"https://github.com/mesosphere/dcos-cli/issues/563#issuecomment-208647709","issue_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/563","id":208647709,"user":{"login":"nickbp","id":35933,"avatar_url":"https://avatars.githubusercontent.com/u/35933?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbp","html_url":"https://github.com/nickbp","followers_url":"https://api.github.com/users/nickbp/followers","following_url":"https://api.github.com/users/nickbp/following{/other_user}","gists_url":"https://api.github.com/users/nickbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbp/subscriptions","organizations_url":"https://api.github.com/users/nickbp/orgs","repos_url":"https://api.github.com/users/nickbp/repos","events_url":"https://api.github.com/users/nickbp/events{/privacy}","received_events_url":"https://api.github.com/users/nickbp/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T00:46:43Z","updated_at":"2016-04-12T00:46:43Z","body":"I could see the new Universe UI someday accepting JSON-format data for the config when installing a package, similar to how Marathon now has support for creating a task using the raw JSON task definition. Given this, it feels like having the CLI stick to JSON format would be useful.\r\n\r\nGood point about the additional prompts. I think some combination of these approaches could be used depending on the situation:\r\n\r\n- If an auth challenge (username/pw) is triggered when the user is piping in a config, options could be:\r\n  - Require the user to retry the command with additional arguments? But this implies adding the auth arguments everywhere, which I assume isn't feasible.\r\n  - Maybe just error out, saying that an auth needs to be performed via a non-piped command before the piped version of the command will work. This is pretty unintuitive, though, and may be more difficult to write a script for.\r\n  - Another option could be to error out and point the user to an explicit 'auth' command. This separate command would only be returned for piped commands, while the current in-command prompt that we use today could continue being used for non-piped commands. The dedicated command would also be convenient for script (just call 'auth' once before doing a bunch of other interaction).\r\n\r\n- If a yes/no prompt (or some other confirmation) is required when the user is piping in a config, options could be:\r\n  - Error out, require them to specify '--yes' as an argument when piping?\r\n  - Automatically assume 'yes' when a config is being piped? The piping of an explicit config would somewhat imply that the user is pretty certain about what they want to do, but this may be unintuitive."}}