This project has been renamed oclif.
heroku / cli-engine Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://github.com/oclif/oclif
License: ISC License
Home Page: https://github.com/oclif/oclif
License: ISC License
This project has been renamed oclif.
it would be really cool if we could be docopt compatible with our help generation: http://docopt.org
it may involve significant changes to the flags/args, or maybe just edits to the help generation
it seems that linked plugins refresh on every execution for some reason:
env HEROKU_DEBUG=1 run members:add [email protected] -r admin --org ff
updating cache for /Users/dickeyxxx/src/github.com/heroku/heroku-orgs
Clearing cache for /Users/dickeyxxx/src/github.com/heroku/heroku-orgs
updating cache for /Users/dickeyxxx/src/github.com/heroku/heroku-orgs
--> GET /organizations/ff
<-- 404 Not Found
<-- {"resource":"organization","id":"not_found","message":"Couldn't find that organization."}
▸ Couldn't find that organization.
Error: Expected response to be successful, got 404
at Request.handleFailure (/Users/dickeyxxx/src/github.com/heroku/heroku-orgs/node_modules/heroku-client/lib/request.js:241:11)
at concat.then (/Users/dickeyxxx/src/github.com/heroku/heroku-orgs/node_modules/heroku-client/lib/request.js:135:16)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
v6 seems to be 100ms slower with heroku auth:token
(a command that doesn't hit the API) we should do some perf work to find out why, possibly using time-require
I'm on V6 heroku-cli/6.4.6-e6a8ec6 v6 (darwin-x64) node-v7.7.2
Output without debug (first time had duplicate statements, second time not). Assorted data redacted:
$ heroku run rake db:migrate -a my-app
Running rake db:migrate on ⬢ my-app... ⣷
Running rake db:migrate on ⬢ my-app... starting, run.9061 (Private-M)
▸ Warning: Dynos can take up to a few minutes to be provisioned in Private Spaces.
▸ Invalid listen argument: [object Object]
➜ ~/…/addons.heroku.com $ heroku run rake db:migrate -a my-app
Running rake db:migrate on ⬢ my-app... starting, run.1914 (Private-M)
▸ Warning: Dynos can take up to a few minutes to be provisioned in Private Spaces.
▸ Invalid listen argument: [object Object]
Output with debug:
$ HEROKU_DEBUG=1 heroku run bash -a my-app
Exiting with code: 0
--> POST /apps/my-app/dynos
--> {"command":"bash","attach":true,"env":{"TERM":"xterm-256color","COLUMNS":254,"LINES":61}}
Running bash on ⬢ my-app... ⣯
▸ Warning: Dynos can take up to a few minutes to be provisioned in Private Spaces.
<-- 201 Created
<-- {"attach_url":"https://user-UUID:[email protected]/session/session-UUID","command":"bash","created_at":"0001-01-01T00:00:00Z","id":"7a8891c3-8026-4d63-b85c-c71f531ea049","name":"run.2182","app":{"id":"app-UUID","name":"my-app"},"release":{"id":"release-UUID","version":556},"size":"Private-M","state":"provisioning","type":"run","updated_at":"0001-⡿1-01T00:00:00Z"}
--> GET /apps/my-app/dynos/run.2182
<-- 404 Not Found ⣾
<-- {"resource":"dyno","id":"not_found"⣾"message":"Couldn't find that dyno."}
--> GET /apps/my-app/dynos/run.2182
<-- 200 OK
Running bash on ⬢ my-app... starting, run.2182 (Private-M)
▸ Warning: Dynos can take up to a few minutes to be provisioned in Private Spaces.
Error: Invalid listen argument: [object Object]
at Server.listen (net.js:1418:9)
at ClientRequest.r.on (/Users/aunger/.local/share/heroku-cli/cli/node_modules/heroku-run/lib/dyno.js:155:11)
at emitThree (events.js:116:13)
at ClientRequest.emit (events.js:197:7)
at TLSSocket.socketOnData (_http_client.js:443:11)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:176:18)
at TLSSocket.Readable.push (_stream_readable.js:134:10)
at TLSWrap.onread (net.js:563:20)
Exiting with code: 1
as part of this, the functionality to make multiple requests to fill up content with range headers needs to be ported
api.heroku.com
override (in Heroku
)auth
and token
auth
options should not prepend :
but token
shouldreturn heroku.request({
path: `/apps/${app}/sni-endpoints`,
headers: {'Accept': 'application/vnd.heroku+json; version=3.sni_ssl_cert'}
})
handleFailure
& handleResponse
method (we override handleFailure to do 2fa)json: false
request body serialization disablingContent-length
to zero when no bodytimeout
to options (maybe)304
logger
to options (maybe){}
if body is empty (maybe)parseJSON
option & always json parse? (maybe)new Heroku('https://api.heroku.com').get('/apps')
reproduction steps:
2fa prompt for paranoid apps seems to just exit with code 0 for some reason:
heroku config:add UPDATE_HASH=foo -a paranoidapp
Setting UPDATE_HASH and restarting ⬢ toolbelt... !
Two-factor code:
because of the cli.exit and https://github.com/heroku/heroku-local/blob/master/commands/start.js#L24 not returning a promise
Have not investigated, but likely due to context
not being backwards compatible
-> % ./bin/run git:remote -a rbriggs-sushi
set git remote heroku to https://undefined/rbriggs-sushi.gi
we need a way to migrate from v5 symlinked and user plugins into v6
What is happening here is the 5.x release successfully updates to v6 (probably), but it then tries to update the plugins and fails there.
$ heroku update v6
heroku-cli: Updating to 5.99.0-9069be3... (v6) 2.07 MB/2.07 MB
heroku-cli: Updating heroku-redis... !
▸ module.js:442
▸ throw err;
▸ ^
▸
▸ Error: Cannot find module '/Users/mgauger/.local/share/heroku/cli/lib/npm/cli.js'
▸ at Function.Module._resolveFilename (module.js:440:15)
▸ at Function.Module._load (module.js:388:25)
▸ at Module.runMain (module.js:575:10)
▸ at run (node.js:348:7)
▸ at startup (node.js:140:9)
▸ at node.js:463:3
heroku-cli: Updating heroku-sudo... !
▸ module.js:442
▸ throw err;
▸ ^
▸
▸ Error: Cannot find module '/Users/mgauger/.local/share/heroku/cli/lib/npm/cli.js'
▸ at Function.Module._resolveFilename (module.js:440:15)
▸ at Function.Module._load (module.js:388:25)
▸ at Module.runMain (module.js:575:10)
▸ at run (node.js:348:7)
▸ at startup (node.js:140:9)
▸ at node.js:463:3
heroku-cli: Updating heroku-cli-static... !
▸ module.js:442
▸ throw err;
▸ ^
▸
▸ Error: Cannot find module '/Users/mgauger/.local/share/heroku/cli/lib/npm/cli.js'
▸ at Function.Module._resolveFilename (module.js:440:15)
▸ at Function.Module._load (module.js:388:25)
▸ at Module.runMain (module.js:575:10)
▸ at run (node.js:348:7)
▸ at startup (node.js:140:9)
▸ at node.js:463:3
heroku-cli: Updating heroku-event-log... !
▸ module.js:442
▸ throw err;
▸ ^
▸
▸ Error: Cannot find module '/Users/mgauger/.local/share/heroku/cli/lib/npm/cli.js'
▸ at Function.Module._resolveFilename (module.js:440:15)
▸ at Function.Module._load (module.js:388:25)
▸ at Module.runMain (module.js:575:10)
▸ at run (node.js:348:7)
▸ at startup (node.js:140:9)
▸ at node.js:463:3
heroku-cli: Updating heroku-cli-oauth... !
▸ module.js:442
▸ throw err;
▸ ^
▸
▸ Error: Cannot find module '/Users/mgauger/.local/share/heroku/cli/lib/npm/cli.js'
▸ at Function.Module._resolveFilename (module.js:440:15)
▸ at Function.Module._load (module.js:388:25)
▸ at Module.runMain (module.js:575:10)
▸ at run (node.js:348:7)
▸ at startup (node.js:140:9)
▸ at node.js:463:3
heroku-cli: Updating heroku-api-plugin... !
▸ module.js:442
▸ throw err;
▸ ^
▸
▸ Error: Cannot find module '/Users/mgauger/.local/share/heroku/cli/lib/npm/cli.js'
▸ at Function.Module._resolveFilename (module.js:440:15)
▸ at Function.Module._load (module.js:388:25)
▸ at Module.runMain (module.js:575:10)
▸ at run (node.js:348:7)
▸ at startup (node.js:140:9)
▸ at node.js:463:3
heroku-cli: Updating heroku-splunk... !
▸ module.js:442
▸ throw err;
▸ ^
▸
▸ Error: Cannot find module '/Users/mgauger/.local/share/heroku/cli/lib/npm/cli.js'
▸ at Function.Module._resolveFilename (module.js:440:15)
▸ at Function.Module._load (module.js:388:25)
▸ at Module.runMain (module.js:575:10)
▸ at run (node.js:348:7)
▸ at startup (node.js:140:9)
▸ at node.js:463:3
heroku-cli: Updating plugins... done
heroku members:add [email protected] --help
I think it would be best to build the windows installer on appveyor. We could follow almost everything that the yarn installer does here: https://github.com/yarnpkg/yarn/blob/d4370f815157ced77afbc75e2f2572a2c120647f/appveyor.yml#L19
this might be tricky to reimplement
$ heroku apps:destroy -c myapp
otherwise it will try to prompt when installing a bad tag, for example
~ $ heroku version
heroku-cli/6.4.9-9ff89cd beta (darwin-x64) node-v7.9.0
~ $ heroku plugins
heroku-accounts 1.1.1
heroku-api-plugin 1.1.0
heroku-connect-plugin 0.3.4
heroku-event-log 0.2.10
heroku-pg-extras 1.0.11
heroku-pg-pgcli 1.0.3
heroku-repo 1.0.4
heroku-slugs 1.0.3
heroku-sudo 4.4.8
~ $ heroku update
heroku-cli: Updating CLI... already on latest version: 6.4.9-9ff89cd
heroku-cli: Updating plugins... !
▸ 1: Command failed: /Users/randerton/.local/share/heroku/client/node_modules/yarn/bin/yarn upgrade
▸ error No lockfile in this directory. Run `yarn install` to generate one.
▸ yarn upgrade v0.23.2
▸
~ $ HEROKU_DEBUG=1 heroku plugins:update
Executing /Users/randerton/.local/share/heroku/cli/bin/heroku
heroku-cli: Updating plugins...
/Users/randerton/.local/share/heroku/plugins: /Users/randerton/.local/share/heroku/client/node_modules/yarn/bin/yarn upgrade
yarn upgrade v0.23.2
error No lockfile in this directory. Run `yarn install` to generate one.
Error: Command failed: /Users/randerton/.local/share/heroku/client/node_modules/yarn/bin/yarn upgrade
at Promise.all.then.arr (/Users/randerton/.local/share/heroku/client/node_modules/execa/index.js:210:11)
at process._tickCallback (internal/process/next_tick.js:109:7)
Exiting with code: 1
I think this is new with V6?
$ heroku app:info -a my-app
▸ app:info is not a heroku command.
▸ Perhaps you meant apps:info
▸ Run heroku help for a list of available commands.
! `app:info` is not a heroku command.
! Perhaps you meant `pg:info`.
! See `heroku help` for a list of available commands.
gposter-ltm1:api gposter$ heroku addons --help
▸ error reading plugin heroku-sudo command has no topic
▸ error reading plugin heroku-orgs command has no topic
the app mixin is missing the functionality for reading the git remotes
../package.json
in engine-commandcli-engine
, so it has all help logic (or vice-versa)$ heroku
display help or a welcome screen? We got rid of welcome screen it seemsCommand loading could be improved in 2 ways. First, every plugin has to manually require each command or otherwise do something involving klaw
to find every .js file in the commands directory. This is unneeded boilerplate I think we could do with out for either scenario.
Also, right now when a plugin is loaded it must require()
every command in the plugin. Ideally we could instead use some kind of introspection to find all the commands in a plugin that follow a convention (sort of like how rails files work).
So if you had commands such as (the babel-generated) ./lib/commands/foo/bar.js
it shouldn't have to be referenced in an index file. The CLI could list out all the js files under lib/commands
. Then during plugin loading we could just require the command about to be run, not all the commands in the CLI improving load times.
we're missing dist-tag functionality from v5. I've added #25 that starts adding this back in, but will need quite a bit more work to be complete.
plugins:update
, update to the latest version of dist-tag, not latest latest
version like it does todayheroku plugins
this works, but could be improved I think
rbriggs@ebriggs-ltm [09:39:37] [~/src/github.com/heroku/cli] [v6]
-> % heroku apps
▸ Invalid credentials provided.
Enter your Heroku credentials:
Email: %
$ heroku pipelines
▸ pipelines is not a heroku command.
▸ Perhaps you meant pg:links
▸ Run heroku help for a list of available commands.
! `pipelines` is not a heroku command.
! See `heroku help` for a list of available commands.
$ heroku help
Usage: heroku COMMAND [--app APP] [command-specific-options]
Help topics, type heroku help TOPIC for more details:
[...]
pipelines # manage collections of apps in pipelines
[...]
-> % heroku plugins:install heroku-foo
Installing dependencies for /Users/rbriggs/src/github.com/heroku/heroku-apps... done
^C% rbriggs@ebriggs-ltm [10:07:59] [~/src/github.com/heroku/cli-engine] [only-cache-plugins-once]
-> % heroku plugins:install heroku-foo
▸ 'ENOENT': ENOENT: no such file or directory, open '/Users/rbriggs/Library/Caches/heroku-cli/plugins.lock.writer/pid'
-> % heroku apps:info --foobar
▸ Error: Unexpected flag --foobar
but now --foobar
is interpreted as an argument
-> % ./bin/run apps:info --foobar
▸ Couldn't find that app.
$ heroku plugins:install foiewjweljwlekfwelfjk
in v5 a command could specify a custom 'usage' text that would be display on the topics index:
in heroku-apps/commands/apps/create.js:
module.exports = {
// code
usage: '--foo --bar --baz --bak --foobarbazbak --extra-long'
}
instead of the defaults, but this doesn't seem to work:
heroku help apps
heroku apps commands: (heroku help apps:COMMAND for details)
apps # list your apps
apps:create [APP] (CUSTOM USAGE SHOULD BE HERE) # create a new app
apps:destroy [APP] # permanently destroy an app
apps:errors # view app errors
apps:favorites # list favorited apps
v5 does this correctly.
Also doesn't seem to show up under heroku help apps:create
we're missing at least linux-arm, freebsd and openbsd (maybe others as well)
Line 112 in 7c3f815
-> % rm -rf ~/.local/share/heroku*
rbriggs@ebriggs-ltm [13:55:37] [~/src/github.com/heroku/webhooks-state] [master]
-> % heroku update
heroku-cli: Updating to 5.8.1-a65ca6f... 15.6 MB/15.6 MB
heroku-cli: Updating plugins... done
rbriggs@ebriggs-ltm [13:56:09] [~/src/github.com/heroku/webhooks-state] [master]
-> % heroku whoami
[email protected]
rbriggs@ebriggs-ltm [13:56:15] [~/src/github.com/heroku/webhooks-state] [master]
-> % heroku update v6
heroku-cli: Updating plugins... done
heroku-cli: Updating to 5.99.0-7eac144... (v6) 2.07 MB/2.07 MB
rbriggs@ebriggs-ltm [13:56:27] [~/src/github.com/heroku/webhooks-state] [master]
-> % heroku whoami
▸ fork/exec /Users/rbriggs/.local/share/heroku/cli/bin/heroku: resource temporarily unavailable
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.