Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Hyper CLI to open multiple windows and tabs with configuration #462

Open
zanedev opened this issue Jul 27, 2016 · 46 comments
Open

Use Hyper CLI to open multiple windows and tabs with configuration #462

zanedev opened this issue Jul 27, 2016 · 46 comments
Labels
⌨️ CLI tool Issue or PR related to CLI tool good first issue Issue is good for Hyper newcomers help wanted Contributions wanted towards the issue 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper

Comments

@zanedev
Copy link

zanedev commented Jul 27, 2016

It could be nice to launch HyperTerm with a few tabs and run a few scripts in each one automatically. Like a project configuration. Is that possible now?

@timneutkens
Copy link
Member

timneutkens commented Jul 27, 2016

It's not build into hyperterm at the moment. You could write a plugin for it though 👍
You mean kind of like iTerm2's profiles right?

@zanedev
Copy link
Author

zanedev commented Jul 27, 2016

Maybe even simpler, rather than full fledged profiles at first. Like the ability to launch a command to a new tab in the current window. I imagine it would be reused as a command line launcher in general but maybe if it's called from hyperterm it launches a new tab, if it's called outside hyperterm it launches hyperterm with that command. The hyperterm app doesn't seem to accept command line arguments currently as far as I can tell...

Sure it would be fun! I've never worked with electron but would like to get into it. Any ideas to point in the right direction would help.

@timneutkens
Copy link
Member

Hmm that would be a cool idea.. like a echo 'example' | hyperterm which opens a new tab and executes the command passed in. Same goes for hyperterm "echo 'example'"
Maybe if you're a little crazy you could hook into that and add the hyperhyper command which does the same with this soundbit https://www.youtube.com/watch?v=F7aKqJsuPDg 😂 😂
echo 'example' | hyperhyper

@zanedev
Copy link
Author

zanedev commented Jul 27, 2016

I imagine it would need to be like textmate or webstorm where we'd bundle a separate command line tools binary/script that can be optionally installed in the path. Or maybe that's overkill it could be simpler to just pass params to the app living in Applications.

@timothyis timothyis added the 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper label Jul 27, 2016
@austin-guevara
Copy link

austin-guevara commented Nov 8, 2016

Hey, guys – any update to this in Hyper? I was hoping for something even as simple as the ability to open Hyper.app from the command line. Not necessary pass a command into it.

Is that possible? I know you can just run:
open "/Applications/Hyper.app"

But that launches a new instance every time. Instead, is there a way to have it launch and open a new instance if it's not already running (and only launch a new window if it is already running)?

@thrkmmr
Copy link

thrkmmr commented Dec 13, 2016

At work we use scripts to open new tabs in Konsole that SSH into the various servers we deploy and test on (about a 100 different servers). The background colors (actually the profiles) are different for different environment types. For example:

konsole --new-tab --profile Test -e ssh someserver.ourdomain.com

If this was possible in Hyper I would switch.

@ilkka
Copy link

ilkka commented Feb 11, 2017

I noticed that one can run /Application/Hyper.app/Contents/MacOS/Hyper /path/to/directory to open a new instance of the app, with the given path as the working directory, but that's as far as it goes. Also it shows up in alt-tab etc. as a separate app which is not very handy.

@rmwaite
Copy link

rmwaite commented Feb 22, 2017

The trouble with passing a directory or command to the executable on the command line is that new windows created from that session seem to "inherit" those properties. So for example, if you open a window using /Application/Hyper.app/Contents/MacOS/Hyper /path/to/directory and then create a new window, it will also open in that directory. The Windows alt-tab and macOS dock will see this instance as a different application if Hyper was already running with no (or different) arguments. I'm unfamiliar with Electron or the Hyper code to see if this is something that can be fixed - such that different instances launched with different command line arguments are grouped together as the same application. I also think it is worth considering a separate command line utility with the ability to hook into the running app the create new windows and run commands, etc - but again, I'm not familiar enough with the technologies here to know if this is naive.

@borela
Copy link

borela commented Apr 29, 2017

Having a .hyperproj file to launch pre configured tabs would be extremely useful, any progress on this?

@ppot
Copy link
Contributor

ppot commented Apr 29, 2017

This is in my long task list to enable profile accessibility!

@dsturm
Copy link

dsturm commented May 5, 2017

There is a typo in @ilkka and @richardwaite comments: it is /Applications/Hyper.app/Contents/MacOS/Hyper /path/to/directory. That is quite handy if you want to open hyper over GitKraken.

@albinekb
Copy link
Contributor

albinekb commented May 5, 2017

@borela that seems perfect for a plugin!

@chabou chabou added 🔌 Type: Plugin Request Issue is a plugin request for Hyper 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper and removed 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper 🔌 Type: Plugin Request Issue is a plugin request for Hyper labels May 5, 2017
@tkodev
Copy link

tkodev commented Sep 6, 2017

Would enable many use cases: such as allowing sftp programs to launch hyper for SSH, a support for a myriad of "cd_to" like tools (that also work from any application), etc.

I'm a little surprised that hyper doesn't support any command line arguments - since it's application can be categorized as command line tool (to some extent) !

Alternatively I could just fork and make my own hyper version, but I would love official update support :(

@chabou
Copy link
Collaborator

chabou commented Sep 6, 2017

Indeed you could just fork and make your own hyper version...
...and make a PR to have this in an official update 😄

@Royedc4
Copy link

Royedc4 commented Sep 8, 2017

@richardwaite @dsturm @ilkka Thanks
/Applications/Hyper.app/Contents/MacOS/Hyper /path/to/directory Works as expected.

@jacquescrocker
Copy link

jacquescrocker commented Apr 21, 2018

New tab support would be great, along with kicking off a command to start. I have this scripted out (via applescript) in Terminal.app. But its ugly. I'd want to run a script called "dev/start" in my project that looks something like this:

#!/usr/bin/env bash

hyper --tab --title "Server" --script "cd $HOME/myProject/server && bundle exec rails s"
hyper --tab --title "Console" --script "cd $HOME/myProject/server && bundle exec rails c"
hyper --tab --title "Specs" --script "cd $HOME/myProject/server && bundle exec guard"
hyper --tab --title "Frontend" --script "cd $HOME/myProject/frontend && bundle exec middleman start"

That would open up 4 tabs automatically, name them, and then kick off a script for each

I'm totally open to alternative ways of doing it also. But the end result should be 4 named tabs with 4 different processes.

Thanks!

@timothyis timothyis reopened this Apr 22, 2018
@timothyis
Copy link
Contributor

Woops, I didn't totally understand the issue 🙈

I'll change the title to be more accurate to the new hyper CLI 👌

@timothyis timothyis added help wanted Contributions wanted towards the issue good first issue Issue is good for Hyper newcomers ⌨️ CLI tool Issue or PR related to CLI tool labels Apr 22, 2018
@timothyis timothyis changed the title Launch from command line? Use Hyper CLI to open multiple windows and tabs with configuration Apr 22, 2018
@timothyis timothyis mentioned this issue Apr 23, 2018
2 tasks
@elijahgagne
Copy link

I feel compelled to write in to describe my use case for this functionality. I currently have PowerShell functions that open new tabs in ConEmu and establish new ssh.exe, mysql, psql (Postgres), sqlcmd (SQL Server), sqlplus (Oracle), and other connections. In my PowerShell profile, I also have a function that reads in all the servers and databases from a CMDB at startup and creates aliases for them. That allows me to start typing the name of a system, tab complete it, press enter, and get a new tab with an SSH, database, or other connection, etc.

If the hyper cli gets a function that lets me create tabs from the command line and I can use arbitrary shells with hyper, then I think a lot of SysAdmin/DBA types would be interested in hyper.

@volumetric
Copy link

New tab support would be great, along with kicking off a command to start. I have this scripted out (via applescript) in Terminal.app. But its ugly. I'd want to run a script called "dev/start" in my project that looks something like this:

#!/usr/bin/env bash

hyper --tab --title "Server" --script "cd $HOME/myProject/server && bundle exec rails s"
hyper --tab --title "Console" --script "cd $HOME/myProject/server && bundle exec rails c"
hyper --tab --title "Specs" --script "cd $HOME/myProject/server && bundle exec guard"
hyper --tab --title "Frontend" --script "cd $HOME/myProject/frontend && bundle exec middleman start"

That would open up 4 tabs automatically, name them, and then kick off a script for each

I'm totally open to alternative ways of doing it also. But the end result should be 4 named tabs with 4 different processes.

Thanks!

This is totally what I am looking for. Guake Terminal has something very similar to this and I have a terminal starter script that i run after system start. This is very helpful and preps your terminal session for your work.

@dewetblomerus
Copy link

Working on micro-services I sometimes have 4 different servers to start before testing my code. Just telling them all to start in different tabs would be amazing!

@zerdos
Copy link

zerdos commented Oct 6, 2018

@dewetblomerus, take a look on this:
https://github.com/zerdos/modern-web-app-skeleton/blob/master/.hyperlayout

@pcnate
Copy link

pcnate commented Nov 2, 2018

New tab support would be great, along with kicking off a command to start. I have this scripted out (via applescript) in Terminal.app. But its ugly. I'd want to run a script called "dev/start" in my project that looks something like this:

#!/usr/bin/env bash

hyper --tab --title "Server" --script "cd $HOME/myProject/server && bundle exec rails s"
hyper --tab --title "Console" --script "cd $HOME/myProject/server && bundle exec rails c"
hyper --tab --title "Specs" --script "cd $HOME/myProject/server && bundle exec guard"
hyper --tab --title "Frontend" --script "cd $HOME/myProject/frontend && bundle exec middleman start"

That would open up 4 tabs automatically, name them, and then kick off a script for each

I'm totally open to alternative ways of doing it also. But the end result should be 4 named tabs with 4 different processes.

Thanks!

I would expect that with electron being slow to startup, there would be a need for some launcher app to track these and wait until the GUI app fully executes

@lou-bi
Copy link

lou-bi commented Nov 9, 2018

I would like to try writing this plugin. Does the api provide the necessary to hook such option on start, or is a fork required ?

@Circuit8
Copy link

Circuit8 commented Nov 14, 2018

I'd definitely love to see this feature come to life 👍, I really love Hyper and this would bring it to perfection for me

@taylorjdawson
Copy link

Curious about the answer to @BonLouis's comment, as well as, justification/reasoning on why this should be a plugin instead of a built in feature? Are enough of the hyper internals exposed for this to be a plugin? Thanks!

@chabou
Copy link
Collaborator

chabou commented Jan 21, 2019

I think that Hyperlayout plugin does exactly what you want :)

@taylorjdawson
Copy link

Hmm interesting seems to do what everyone is asking for? What's missing from the Hyperlayout plugin that doesn't resolve this issue?

@pcnate
Copy link

pcnate commented Jan 21, 2019

Interesting. I'll have to try that out later on

@elijahgagne
Copy link

elijahgagne commented Jan 21, 2019

Some things I'd like that might not be included in the Hyperlayout plugin are:

  1. Ability to create a layout that uses different shells (e.g. PowerShell, Bash, cmd.exe)
  2. Ability to create a layout by passing parameters (without creating/editing a file)

To elaborate on (2), for example, I'd create a Bash or PowerShell function that takes a parameter for the server name. When the function is called, it creates a new tab, runs ssh, and passes in all the relevant paraments to connect to a server. It seems that hyperlayout could do this, but would require creating files. I wouldn't want to do this, especially because the files might contain credentials.

I only skimmed Hyperlayout so I could have easily missed that it covers 1 and/or 2.

@chabou
Copy link
Collaborator

chabou commented Jan 22, 2019

1 I think this feature can be added to Hyperlayout
2 We need to add ability to Hyper to pass CLI args to plugins.

I really don't think it should be a core feature but Hyper should definitely make this feature possible with plugins.

@pcnate
Copy link

pcnate commented Jan 24, 2019

hyperlayout is currently not maintained and doesn't work for me on Win 10. There is a hyperlayout2 on npm but it didn't seem to work either.

@Luiggi370z
Copy link

Hi,
I had the same issue in windows 10, so after some research within the code, it looks like there is an issue with the reading of the hyperlayout file and at the end the data contains some ansi codes.

So I made some modifications, in the file index.js at line 160, I applied a stringify to the data and then clean all the ansi codes and json strings, then parse into an obj pass it in line 163.

After that it works fine :)

@taylorjdawson
Copy link

@Luiggi370z maybe you should submit a PR!

@pcnate
Copy link

pcnate commented Jan 25, 2019

@taylorjdawson https://github.com/timolins/hyperlayout/#this-repo-is-currently-unmaintained

There are open PRs and an old commit history
image

@taylorjdawson
Copy link

@pcnate commit to the hyperlayout2 one maybe?

@pcnate
Copy link

pcnate commented Jan 26, 2019

Tried that one. It seems to require the original be installed

@kanavpruthi
Copy link

Is this issue still open? I am a first time contributor here.

@yuis-ice
Copy link

yuis-ice commented Mar 6, 2021

Still opening?

@samuelneff
Copy link

@pcnate Fork a hyperlayout3 :)

@2-X
Copy link

2-X commented Mar 7, 2022

I would also really like this feature and the ability to auto-populate a command without executing it

I have a bunch of data scrapers that I run at work and want to open 6 windows so I can run them all and debug them each individually and re-run them. Also would be good for demos

@chabou
Copy link
Collaborator

chabou commented Mar 8, 2022

hyper-broadcast can help (even if this it not exactly what you want)

@LabhanshAgrawal
Copy link
Collaborator

I'm planning to basically rewrite the cli and add support for arguments and such to be passed to hyper. But it will take some time as I'm caught up with work etc. Thanks for everyone's patience.

@chabou
Copy link
Collaborator

chabou commented Mar 8, 2022

Great news @LabhanshAgrawal! Thank you for your hard work 🙏

@rubenhak
Copy link

I'd love to see a way to reopen a layout. This would be super helpful when working with microservices.

@Solaris17
Copy link

Curious if this ever made it? I was looking for a way to auto open a tab and run a command just this morning. For context, at work we ssh to bastion hosts. It would be nice to have this automatically kick off in another tab when I open hyper.

@Vortigern-The-Grey
Copy link

This still in the works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌨️ CLI tool Issue or PR related to CLI tool good first issue Issue is good for Hyper newcomers help wanted Contributions wanted towards the issue 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper
Projects
None yet
Development

No branches or pull requests