Giter VIP home page Giter VIP logo

cli-engine's Introduction

This project has been renamed oclif.

cli-engine's People

Contributors

amerine avatar appleton avatar caseywatts avatar fivetanley avatar greenkeeper[bot] avatar jdx avatar jkutner avatar joshwlewis avatar jsullivan avatar karatecowboy avatar matthew-andrews avatar mnoble avatar owenthereal avatar pmuens avatar rasphilco avatar raulb avatar ryanbrainard avatar sammorrowdrums avatar svc-scm avatar tcrayford avatar ys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli-engine's Issues

follow docopt

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

linked plugins refresh every run

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)

performance

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

`run` appears to fail with `Invalid listen argument: [object Object]`

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

heroku client bugs and missing features

as part of this, the functionality to make multiple requests to fill up content with range headers needs to be ported

  • range headers
  • 2fa retry

cli-engine-command

  • HEROKU_DEBUG=1 no longer dumps the response body
  • HEROKU_DEBUG_HEADERS=1 PR
  • HEROKU_DEBUG & HEROKU_DEBUG_HEADERS does not dump response body & headers

cli-engine-heroku

  • HEROKU_HOST does not allow api.heroku.com override (in Heroku)
  • HEROKU_HOST with alternate port would not be respected
  • HEROKU_HTTP_PROXY_HOST (maybe)
  • HEROKU_HTTP_PROXY_PORT (maybe)
  • HEROKU_HTTP_PROXY_AUTH (maybe)
  • partial (to disable fetching all pages)
  • support both auth and token
  • auth options should not prepend : but token should

http-call

  • parseJSON (to disable JSON parsing) (maybe)
  • rejectUnauthorized
  • remove null | undefined headers
  • request signature does not match
return heroku.request({
  path: `/apps/${app}/sni-endpoints`,
  headers: {'Accept': 'application/vnd.heroku+json; version=3.sni_ssl_cert'}
})
  • addhandleFailure & handleResponse method (we override handleFailure to do 2fa)
  • missing json: false request body serialization disabling
  • conditionally add displaying of POST body
  • set Content-length to zero when no body
  • add timeout to options (maybe)
  • add middleware functionality
  • does not handle response code 304
  • add logger to options (maybe)
  • return {} if body is empty (maybe)
  • add parseJSON option & always json parse? (maybe)
  • missing verb instance methods with paths - new Heroku('https://api.heroku.com').get('/apps')
  • do not retry 400 level errors

TODO

  • range headers
  • 2fa retry

2fa prompt not working

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:

heroku git:remote broken

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

issue updating to 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

error No lockfile in this directory

~ $ 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  

"Perhaps you meant" output is duplicated

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.

addons --help displaying plugin errors

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

Some thoughts on cleaning up engine => engine-command interaction

  • Pass engine into engine command rather than requiring ../package.json in engine-command
  • Move the legacy command wrapping down into engine-command
  • Move Topic.help into cli-engine, so it has all help logic (or vice-versa)
  • Should $ heroku display help or a welcome screen? We got rid of welcome screen it seems

improved command loading

Command 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.

dist-tag support

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.

  • allow installing a plugin via a specific dist-tag
  • record in plugins.json (or somewhere) which dist-tag was used to install the plugin
  • (using above) on plugins:update, update to the latest version of dist-tag, not latest latest version like it does today
  • show current dist-tag on heroku plugins

unauthorized trap not working bug

rbriggs@ebriggs-ltm [09:39:37] [~/src/github.com/heroku/cli] [v6]
-> % heroku apps     
 ▸    Invalid credentials provided.
Enter your Heroku credentials:
Email: %

`heroku pipelines` is not found

$ 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
[...]

Cancelling during `plugins:install` does not clean up lock file

-> % 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'

.usage not working

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

`heroku update v6` causes fork bombs

-> % 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.