azukiapp/azk

'azk open' command suggestion

Closed this issue · 1 comments

It turns out that sometimes we lose main application address from sight in terminal window if we run commands like azk start && azk logs --follow and forget the -o parameter.

It would be an easy way to open main app's address directly in browser by just typing azk open [system] with [system] being optional.

I think it is a good point and can be achieved with the following steps:

  • Create a controller in src/cmds/open.js. Something similar to src/cmds/info.js;
  • Add an entry for the command and it's documentation in shared/locales/usage-en-US.txt;
  • Connect your route in src/cli/index.js:29;
  • Implement OpenController controller for:
    • Ask for Azkfile.js system's informations, similar to src/cmds/info.js
    • Select default system (Manifest class has ways to get it)
    • Verify for system execution status. src/cmds/status.js has references on how to;
    • Finally open the address in browser and in this case src/cmds/start.js is also a good reference on how to;