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

Additional commands on the Gitpod CLI #800

Closed
alesanchezr opened this issue Sep 19, 2019 · 28 comments
Closed

Additional commands on the Gitpod CLI #800

alesanchezr opened this issue Sep 19, 2019 · 28 comments
Labels
component: gp cli meta: never-stale This issue can never become stale meta: stale This issue/PR is stale and will be closed soon type: feature request New feature or request

Comments

@alesanchezr
Copy link

Hello, I'm building an exercise framework on top of gitpod, So far I manage to create a beta version but I would be able to improve it better I you guys could incorporate the following to the Gitpod CLI:

  1. $ gp close I'm already using gp open a lot, but I need to close the exercise filles when opening another exercise, otherwise the amount of files being edited grow to fast and becomes difficult to work with.
  2. $ gp user get the current github username
  3. $ gp file-opened get the current file where the cursor is focused.
  4. $ gp prompt <dom-selector> alert or prompt the user with a message pointing to a particular DOM element inside gitpod (or in the center of the screen).

Here you can see the progress so far: https://gitpod.io/#https://github.com/4GeeksAcademy/html-exercises

@alesanchezr
Copy link
Author

Also, what would be the best way to check if gitpod is running on debug mode? I want to make sure students are using it during the exercises.

@svenefftinge
Copy link
Member

gitpod is running on debug mode

What do you mean by this?

@svenefftinge
Copy link
Member

$ gp prompt alert or prompt the user with a message pointing to a particular DOM element inside gitpod (or in the center of the screen).

Could you elaborate a bit what this functionality is? Usually the GP cli is an interface to existsing functionality in gitpod from the command line. We don't have this functionality at the moment, do we?

@jankeromnes jankeromnes added the type: feature request New feature or request label Sep 23, 2019
@alesanchezr
Copy link
Author

gitpod is running on debug mode

What do you mean by this?

I want to be able to know if you are running your code using the play button on the debugger tool using a configuration pre-established on the launch.json file. Maybe there is no need for any extra development on your side and I can review certain env variables or ports opened.

@alesanchezr
Copy link
Author

$ gp prompt alert or prompt the user with a message pointing to a particular DOM element inside gitpod (or in the center of the screen).

Could you elaborate a bit what this functionality is? Usually the GP cli is an interface to existing functionality in Gitpod from the command line. We don't have this functionality at the moment, do we?

This is the least important of the features right now, the idea is to be able to show a help modal window with a message, similar to the one Gitpod shows at the beginning when it is your first time using it.

I want to do this because sometimes when the students run the exercises for the first time, they don't notice that the instructions are on the right side of the screen (preview). I want to open a modal in the center of the screen to make sure I have their attention.

@alesanchezr
Copy link
Author

@jankeromnes can I you guys do the $ gp close at least? That is the one that bothers students the most right now. We are starting to release/use the first 3 exercises:

HTML: https://github.com/4GeeksAcademy/html-exercises
CSS: https://github.com/4GeeksAcademy/css-exercises
React.js: https://github.com/4GeeksAcademy/react-exercises
Bootstrap: https://github.com/4GeeksAcademy/bootstrap-exercises

@jankeromnes
Copy link
Contributor

@alesanchezr I guess gp close file.txt would search for any open editors showing file.txt, and close them?

@32leaves How complicated would this be to implement? I took at look at the gp code, but didn't find an easy way to query Theia's currently open editors.

@alesanchezr
Copy link
Author

Maybe a flag on the $ gp open that closes any other open file? Or maby a "close all" command?

@alesanchezr
Copy link
Author

@jankeromnes is it possible to add a command to save the current opened file?

The problem is that when doing the exercises students for get to save before running the code, I would like to implement some king of "autosave" or saving the file before trying to test/run the code.

Do you have the code for the gitpod-cli open sourced? Maybe I can contribute to it under your lidership.

@svenefftinge
Copy link
Member

You can enable autosave in the preferences.

echo '{ "editor.autoSave": "on" }' > .theia/settings.json

@alesanchezr
Copy link
Author

Oh perfect.

@Kreyren
Copy link

Kreyren commented Feb 18, 2020

Is .theia/settings.json now recognized per repository?

i'm still using /worspace/reponame/.vscode/settings.json and i hate it

@svenefftinge
Copy link
Member

you can use either .theia or .vscode. .theia has priority.

@alesanchezr
Copy link
Author

Ok so I have aded autosave to all exercises, I also added video introduction and tutorials for some of them but I'm still missing something, I beta-test the exercise engine with students every day and I think I need a way to open a modal, is there any way? Some if the exercises like the React.js ones are getting some traction, ~40 likes in github already!

I need the modal because its the only way to welcome the user and grab their attention, explain the basic steps to complete the exerises.

@svenefftinge
Copy link
Member

I believe fo such scenarios it would be better to go with a VS Code extension. There you can send messages: https://code.visualstudio.com/api/references/vscode-api#MessageOptions

@hahnakane
Copy link

hahnakane commented Apr 27, 2020

I agree that gp close would be a very useful command to have, especially for automation purposes.

@Kreyren
Copy link

Kreyren commented Apr 27, 2020

See also #1403

@Kreyren
Copy link

Kreyren commented Apr 27, 2020

Also would be nice to have gp's source ^-^

@JesterOrNot
Copy link
Contributor

I will see if I can implement some of these.

@JesterOrNot
Copy link
Contributor

Also, @alesanchezr, to be clear for the gp prompt command you just want it to spawn a modal correct?

@alesanchezr
Copy link
Author

alesanchezr commented Aug 4, 2020

Yeah @JesterOrNot just to be able to grab the user attention and show an introductory message.
I think Gitpod already has a similar modal window when you open your first workspace for the first time ever, it shows you like the basics on how to use the Gitpod worspace.

@JesterOrNot
Copy link
Contributor

JesterOrNot commented Aug 4, 2020

Also, you said dom-selector how would that work? Would something like gp prompt <message_string> work where the modal would display the message_string?

@alesanchezr
Copy link
Author

The dom-selector you can forget, it's an overkill and I was able to replicate something like that inside the preview area.

The gp promt <message> works, but can it accept markdown or HTML? Because I wanted to show a message with some explanation not just like a js classic alert.

@svenefftinge
Copy link
Member

@alesanchezr did you try a vs code extension as I proposed in #800 (comment)
Ideally, I don't want to bloat the gp command with stuff that is not used often and can be solved differently.

@alesanchezr
Copy link
Author

alesanchezr commented Aug 10, 2020

@svenefftinge I know, its just that most people doing our tutorials are first-time Gitpod users and they don't event know what an extension is, we mostly target junior devs learning code (for now) with little or no previous experience.

Eventually we will develop the extension when we start focusing in more experience users as well.

@apolopena
Copy link

apolopena commented Feb 9, 2021

gp close and gp close-all would really help alot. Could we still get these two? gp close-all is not mandatory unless it would be a lot faster than gp-close when working with a large group of files.
I would be happy to open a separate feature request for this.

@akosyakov
Copy link
Member

akosyakov commented Feb 10, 2021

For Code we are going to provide an option to execute any IDE command in the current window: #3166 It should be enough to close the currently opened editor.

I am not sure about baking IDE specific commands like gp close and gp close-all in gp itself.

@stale
Copy link

stale bot commented Mar 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Mar 16, 2021
@jankeromnes jankeromnes added the meta: never-stale This issue can never become stale label Mar 17, 2021
@stale stale bot closed this as completed Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: gp cli meta: never-stale This issue can never become stale meta: stale This issue/PR is stale and will be closed soon type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants