blinksh / blink

Blink Mobile Shell for iOS (Mosh based)
https://blink.sh
GNU General Public License v3.0
6.19k stars 577 forks source link
ios ipad ipados mobile mosh scp sftp-client shell swift terminal vscode

Blink Shell for iOS

Do Blink! Blink is the first professional, desktop-grade terminal for iOS that leverages the support of Mosh and SSH. Thus, we can unequivocally guarantee stable connections, lightning-fast speeds, and full configurations. It can and should be your all-day-long tool.

We did not create another terminal to fix your website on the go. Blink was built as a professional grade product from the onset. We started by analyzing what the must-haves were and we ended up grounding Blink on these three concepts:

But, Blink is much more. Please read on:

For more information, please visit Blink Shell.

Additions:

Blink also contains a set of shell utilities, so you can add / remove files, list them, etc.

Specifically, the commands available (as of now) are:

All these commands are inside the ios_system.framework (precompiled, for facility). If you want to edit the source (to add more commands), see: https://github.com/holzschu/ios_system.

curl opens access to file transfers to and from your iPad (ftp, http, scp, sftp...). It uses the key management of BLINKSHELL (the keys you created with "config"). You can also specify keys with a path:

curl scp://host.name.edu/filename -o filename --key $SHARED/id_rsa --pass MyPassword 

You can also use the scp and sftp commands:

scp user@host.name.edu:filename . 
sftp localFilename user@host.name.edu:~/ 

scp and sftp are implemented through curl, by rewriting the arguments to follow the curl syntax. Pro: lighter implementation, smaller memory cost, less likely to have function name collisions. Con: some switches might not have exactly the same meaning.

Environment variables

In iOS, because of sandbox restrictions, you cannot write in the ~ directory, only in ~/Documents/, ~/Library/ and ~/tmp. Most Unix programs assume the configuration files are in $HOME. So either you redefine $HOME to ~/Documents/ or you set configuration variables (using setenv) to some other place.

I do this in Blink, inside the MCPSession.m file. The following variables are defined:

setenv PATH = $PATH:~/Library/bin:~/Documents/bin
setenv PYTHONHOME = $HOME/Library/
setenv SSH_HOME = $HOME/Documents/
setenv CURL_HOME = $HOME/Documents/
setenv HGRCPATH = $HOME/Documents/.hgrc/
setenv SSL_CERT_FILE = $HOME/Documents/cacert.pem

If you want to change them permanently, it's probably best to edit MCPSession.m.

Obtaining Blink

Blink is available now on the AppStore. Check it out!

If you would like to participate on its development, we would love to have you on board! There are two ways to collaborate with the project: you can download and build Blink yourself, or you can request an invitation to help us test future versions (on the raw branch). If you want to participate on the testing, follow and tweet us @BlinkShell about your usage scenarios. Invitations will be sent out in waves, please be patient if you do not receive yours immediately.

Bugs should be reported here on GitHub. If you have any questions or want to make sure we do not miss on an interesting feature, please send your suggestions to our Twitter account @BlinkShell. We would love to discuss them with you! Please do not use Twitter to report bugs.

We can't wait to receive your valuable feedback. Enjoy!

Build

CI

We made a ton easier to build and install Blink yourself on your iOS devices through XCode. We provide a precompiled package with all the libraries for the master branch. Here are the steps:

  1. Check xcode-select -p is pointing to Xcode.app (/Applications/Xcode.app/Contents/Developer) not command tools.

  2. Run the following command:

    git clone --recursive https://github.com/blinksh/blink.git && \
    cd blink && ./get_frameworks.sh && ./get_resources.sh && \
    rm -rf Blink.xcodeproj/project.xcworkspace/xcshareddata/
  3. Change developer ids

cp template_setup.xcconfig developer_setup.xcconfig

edit developer_setup.xcconfig (change apple developer id etc).

  1. Open the project in XCode

3a. If you want to build without iCloud, Push Notificationa and/or Keychain sharing, Before doing anything else, go into the capabilities for the project and turn off Push Notifications, iCloud, and Keychain Sharing

  1. Connect the device you want to build for and select it in Product -> Destination
  2. Build and run on the device

This will download Blink and the associated frameworks: libssh2, OpenSSL, libmoshios, protobuf and ios_system.

Although this is the quickest method to get you up and running, if you would like to compile all libraries and resources yourself, refer to the BUILD.md file. Please let us know if you find any issues. Blink is a complex project with multiple low level dependencies and we are still looking for ways to simplify and automate the full compilation process.

Using Blink

Our UI is very straightforward and optimizes the experience on touch devices for the really important part, the terminal. You will jump right into a very simple shell, so you will know what to do. Here are a few more tricks:

Changelog

View all changes

Attributions