heroku / heroku-cli-util Goto Github PK
View Code? Open in Web Editor NEWUtilities for CLI plugins
License: ISC License
Utilities for CLI plugins
License: ISC License
Would be really nice to support defaults like:
cli.prompt(`Email`, {default: '[email protected]'});
Which would output:
Email? [[email protected]]:
The command list printing code at run.js line 12 tries to print a shortHelp
property from the command object, but neither of the example plugins provides such a string, and heroku-cli
's Command struct doesn't have such a field. If I had to guess, I'd say that this project should use the description
field instead, but it's possible that I've misunderstood the meaning of the various help-related keys, or that shortHelp
is correct and everything else should be updated instead.
Since this morning i'm getting this error:
2016/04/08 09:38:28 truncating error log...
2016/04/08 09:38:28 cleaning up tmp dirs...
2016/04/08 09:38:28 heroku-cli: Installing core plugins...
2016/04/08 09:38:28 open /var/lib/buildkite-agent/.heroku/config.json: no such file or directory
2016/04/08 09:39:02 done
2016/04/08 09:39:02 open /var/lib/buildkite-agent/.heroku/config.json: no such file or directory
2016/04/08 09:39:02 open /var/lib/buildkite-agent/.heroku/config.json: no such file or directory
2016/04/08 09:39:04 TypeError: Cannot assign to read only property 'has256' of false
at findBestHerokuColor (/var/lib/buildkite-agent/.heroku/node_modules/heroku-run/node_modules/heroku-cli-util/lib/spinner.js:9:19)
at new Spinner (/var/lib/buildkite-agent/.heroku/node_modules/heroku-run/node_modules/heroku-cli-util/lib/spinner.js:28:23)
at Run.updateStatus (/var/lib/buildkite-agent/.heroku/node_modules/heroku-run/commands/run.js:41:22)
at Run.<anonymous> (/var/lib/buildkite-agent/.heroku/node_modules/heroku-run/commands/run.js:21:12)
at next (native)
at onFulfilled (/var/lib/buildkite-agent/.heroku/node_modules/co/index.js:65:19)
at _fulfilled (/var/lib/buildkite-agent/.heroku/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/var/lib/buildkite-agent/.heroku/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/var/lib/buildkite-agent/.heroku/node_modules/q/q.js:796:13)
at /var/lib/buildkite-agent/.heroku/node_modules/q/q.js:604:44
This may be connected to your latest changed @dickeyxxx . Do you have any idea what went wrong?
Idea for new functionality for errors. Using restify-errors as inspiration, we could have a Heroku error type to generate custom errors.
Property ideas:
Several plugins have virtually the same download.js script:
https://github.com/heroku/heroku-pg/blob/1cb7c2a997b73a1427dc880e56e5de4c2459c763/lib/download.js
https://github.com/heroku/heroku-slugs/blob/cc45bfbe618c4b6e8aa33d505512184440fe18c4/lib/download.js
https://github.com/heroku/heroku-repo/blob/3e7167d79ca06f8be9cc4b084f7ca03d5adaee46/lib/download.js
It would be good to factor that out to a common helper somewhere :-)
I think it would be useful, especially for slow commands like heroku addons
and heroku dashboard
if the CLI cached some common requests.
heroku-client
already supports caching, we could store them in XDG_CACHE_HOME/heroku
, so this change wouldn't be hard.
There may be some security (not serious ones, the .netrc
file is already on disk) and disk space implications of caching everything indiscriminately, so a whitelist of only items we want to cache is important here. We probably want to chmod the files down to 0600 as well.
This depends on the result of heroku/node-heroku-client#66 I think. I want to make sure we get the caching right before just slapping this in.
Hi there!
I was reading through some docs and noticed they've changed a lot since I wrote my plugin last year. The biggest difference is the introduction of cli-engine-heroku
, heavily featured in the intro article. Looks pretty slick!
I'd love to see some documentation on future plans for the modules (is cli-util
getting deprecated in favor of cli-engine
?). For instance, if I was starting a new module today, which should I use? Is it worth updating an existing plugin with the new modules? If it's not right now (docs not ready, whatever), is there a planned point where that's the recommended action?
Related, the in the code
link in this section is 404.
The ruby CLI has nice functions for printing an object including a header and indenting. e.g.
=== example
Source type: github
Source repo: heroku/example
Staging: example-staging
Production: example
example-admin
Flow: example-staging --> example, example-admin
It would be great to have that in here so we have consistent output. Likewise for tables.
Need to explore more, but:
$ heroku local:run bin/rails -v
[OKAY] Loaded ENV .env File as KEY=VALUE Format
Could not find i18n-0.7.0 in any of the sources
Run `bundle install` to install missing gems.
TypeError: Cannot read property 'body' of undefined
at getErrorMessage (/Users/user/src/github.com/heroku/heroku-local/node_modules/heroku-cli-util/lib/errors.js:33:10)
at error (/Users/user/src/github.com/heroku/heroku-local/node_modules/heroku-cli-util/lib/errors.js:53:30)
at handleErr (/Users/user/src/github.com/heroku/heroku-local/node_modules/heroku-cli-util/lib/errors.js:100:23)
at process._tickCallback (internal/process/next_tick.js:109:7)
@dickeyxxx @mikehale pointed out that when he was doing heroku config
on a 2fa app, it would prompt over an over, until he ran heroku apps:info
after which heroku config
stopped prompting. He was wondering the difference and it comes down to preAuth being set in apps:info. Besides performance, is there a reason that preAuth behavior is not the default. Having this behavior appear & disappear does seem inconsistent.
heroku-cli-util/lib/command.js
Line 102 in 4c1a8f9
Hey guys! The when I require the module, I'm getting what looks like a syntax error?
% node
> let cli = require('heroku-cli-util')
/Users/david/projects/heroku-config/node_modules/heroku-cli-util/lib/action.js:16
if (options.then) [options, promise] = [{}, options]
^^^^^^^^^^^^^^^^^^
ReferenceError: Invalid left-hand side in assignment
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (/Users/david/projects/heroku-config/node_modules/heroku-cli-util/index.js:11:18)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
Versions
Node: 5.7.1
heroku-cli-util: 6.0.13
For now I'll just downgrade, but I thought it's something you might be interested in. Thanks!
Edit: The last version without this error is 6.0.3
.
Should add cli.stdout cli.stderr that we can pipe to that also capture output for testing
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.