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

cli documentation #427

Open
syco opened this issue Jan 22, 2025 · 9 comments
Open

cli documentation #427

syco opened this issue Jan 22, 2025 · 9 comments

Comments

@syco
Copy link

syco commented Jan 22, 2025

Hi,

I was digging around and found this command: /mnt/data/opt/xpipe-14.1.1/cli/bin/xpipe terminal-launch --port 21721 --request 9dcdf372-7cd2-4a3c-bbc2-c704287a0f69

but where do I get the request uuid? I had a look at both the cli and the http api, but I can't figure out this bit.

Thanks

@crschnick
Copy link
Member

That is an internal command used by xpipe to open a session in your terminal process.

If you want to do something similar through the api, you can look into this

/connection/terminal:

@syco
Copy link
Author

syco commented Jan 22, 2025

I saw that, but it opens the terminal for me.
I want to generate the exec file to run manually after I open the terminal myself.

@crschnick
Copy link
Member

So you want to be able to specify what commands to run when the terminal is opened from the API? There are custom terminal command connections for this, but these are only fixed. If you really want to execute a script that is not fixed and instead supplied via the API, I would have to implement that. But I should be able to do that

@syco
Copy link
Author

syco commented Jan 22, 2025

Not sure what you mean with that.

this is the output of ps faux after using xpipe as intended:

syco      183527  0.0  0.0   7972  5548 ?        Ss   14:08   0:00  |   \_ bash
syco      234863  2.5  0.2 573012 74076 ?        Sl   15:57   0:00  |   |   \_ /usr/bin/python /usr/bin/terminator -e /tmp/exec-998130745.sh -T nama-lan --new-tab
syco      234875  0.0  0.0   7456  5184 pts/6    Ss   15:57   0:00  |   |       \_ bash /tmp/exec-998130745.sh
syco      234897  0.4  0.0  10120  8084 pts/6    S+   15:57   0:00  |   |           \_ bash --rcfile /tmp/exec-2046016163.sh
syco      234918  0.8  0.0  16140 10388 pts/6    S+   15:57   0:00  |   |               \_ ssh -oNumberOfPasswordPrompts=3 syco@192.168.10.4 -p 22 -oStrictHostKeyChecking=accept-new -tt -oNoHostAuthenticationForLocalhost=yes -i /home/syco/.ssh/id_rsa -oIdentitiesOnly=yes

What I want to achieve is a different workflow, where:

  1. I first open the terminal
  2. do a command that creates /tmp/exec-998130745.sh
  3. execute /tmp/exec-998130745.sh in the terminal I have already opened

I thought xpipe terminal-launch was what I need, but that doesn't use the connection uuid, but rather a launch request uuid.

Why I need this is because I want to create aliases that open the ssh connections in that terminal where they are executed instead of opening a new one.
This way I can ssh to my remote pc, where I know I left xpipe running and I can then jump to another server using these aliases.

@crschnick
Copy link
Member

In general, the xpipe terminal-launch is not intended to be called by anyone else than xpipe itself. It's only a mechanism to launch scripts in a terminal session.

So just that I understand this correctly, you just want to open a terminal session and also run certain alias commands in that so you have access to them in that session?

@syco
Copy link
Author

syco commented Jan 22, 2025

No,
I want to use xpipe from the command line and open a SSH connection configured in xpipe in that console without opening a new terminal.

@crschnick
Copy link
Member

Ohh I see. So right now this isn't possible because xpipe does, depending on the terminal and connection, perform various adjustments with the scripts and launch parameters. It's not just a simple task of generating and running a script, there is a lot of adjustments going on in the background to make it work everywhere.

It would be pretty difficult to implement something like this. Launching the connection from xpipe itself is the best that it can do right now.

@syco
Copy link
Author

syco commented Jan 22, 2025 via email

@crschnick
Copy link
Member

crschnick commented Jan 22, 2025

No there isn't one right now.

The reason this is locked down behind these request ids is to prevent other applications from having access to your connections. That way, another application can't just connect to a server without you explicitly initiating that. These request ids are generated randomly by xpipe to ensure that all launch requests were made by you in xpipe itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants