{"id":28958684,"url":"https://github.com/ericwq/aprilsh","last_synced_at":"2025-06-23T23:02:15.305Z","repository":{"id":38320246,"uuid":"480222068","full_name":"ericwq/aprilsh","owner":"ericwq","description":"remote shell support intermittent or mobile network.","archived":false,"fork":false,"pushed_at":"2024-05-28T09:52:49.000Z","size":2782,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-29T04:08:27.814Z","etag":null,"topics":["golang","remote","shell","udp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericwq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-11T04:09:10.000Z","updated_at":"2024-07-01T05:20:20.143Z","dependencies_parsed_at":"2023-12-25T01:38:13.498Z","dependency_job_id":"3b1571b2-39c2-4ab3-9630-6aa1d8156c87","html_url":"https://github.com/ericwq/aprilsh","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"purl":"pkg:github/ericwq/aprilsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericwq%2Faprilsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericwq%2Faprilsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericwq%2Faprilsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericwq%2Faprilsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericwq","download_url":"https://codeload.github.com/ericwq/aprilsh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericwq%2Faprilsh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261571302,"owners_count":23178762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","remote","shell","udp"],"created_at":"2025-06-23T23:01:39.125Z","updated_at":"2025-06-23T23:02:15.295Z","avatar_url":"https://github.com/ericwq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"img/aprilsh-avatar.png\" alt=\"image\" width=\"150\"/\u003e\nAprilsh: remote shell support intermittent or mobile network. Inspired by [mosh](https://mosh.org/) and [zutty](https://github.com/tomscii/zutty). aprilsh is a remote shell based on UDP, authenticate user via openssh.\n\n## Installation\n\n#### Requirement\n\n- [open-ssh](https://www.openssh.com/) is a must requirement, sshd is required to perform user authentication.\n- [ncurses and terminfo](https://invisible-island.net/ncurses/) is a must requirement.\n- [systmd](https://systemd.io/) is required by redhat linux family (fedora, centos, redhat).\n- [openrc](https://github.com/OpenRC/openrc) is required by alpine linux.\n- [utmps](https://skarnet.org/software/utmps/) is required by alpine linux.\n- [logrotate](https://github.com/logrotate/logrotate) is a optional requirement by alpine.\n- [locale support](https://git.adelielinux.org/adelie/musl-locales/-/wikis/home) is a build requirement.\n\nIf you prefer to build aprilsh manually, please refer to [this document](doc/install-alpine.md)\n\n\u003cdetails\u003e\n\u003csummary\u003eAlpine linux\u003c/summary\u003e\n\nBefore start apshd, you need to make sure you can ssh login to the target server, please refer to [this doc](doc/ssh-openrc.md) to setup a ssh enabled docker container. Refer to [build doc](doc/build.md) to know how to build apk packages and private repositories.\n\n```sh\n# add testing repositories\necho \"https://dl-cdn.alpinelinux.org/alpine/edge/testing\" \u003e\u003e /etc/apk/repositories\n# update repositories metadata\napk update\n# install client and server\napk add aprilsh\n```\n\u003c!-- Note: aprilsh is still waiting for aports approval. For now please use the following private repository. The private repository only provide `x86_64` packages.  --\u003e\n\u003c!----\u003e\n\u003c!-- ```sh --\u003e\n\u003c!-- # add public key --\u003e\n\u003c!-- wget -P /etc/apk/keys/ https://ericwq.github.io/alpine/packager-663ebf9b.rsa.pub --\u003e\n\u003c!-- # add private repository --\u003e\n\u003c!-- echo \"https://ericwq.github.io/alpine/v3.19/testing\" \u003e\u003e /etc/apk/repositories --\u003e\n\u003c!-- # update repositories metadata --\u003e\n\u003c!-- apk update --\u003e\n\u003c!-- # install client and server --\u003e\n\u003c!-- apk add aprilsh --\u003e\n\u003c!-- ``` --\u003e\n\nNow you can ssh login to the server, it's time to start apshd server and login with apsh.\n\n```sh\n# start apshd server\nrc-service apshd start\n# apsh login with port mapping\napsh -m 100 eric@localhost:8022\n# apsh login without port mapping\napsh eric@localhost\n```\n\nAfter apsh login, you connection to the remote server is provided by aprilsh.\n\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFedora, CentOS, Redhat linux\u003c/summary\u003e\n\nBefore start apshd, you need to make sure you can ssh login to the target server, please refer to [this doc](doc/ssh-systemd.md) to setup a ssh enabled docker container.\n\nNote: This is a private yum/dnf repositories, it only provides `x86_64` packages. Refer to [rpms doc](https://codeberg.org/ericwq/rpms#build-rpm-packages) to understand how to build rpm packages and dnf repositories.\n\n```sh\n# import public key to rpm DB\nrpm --import https://ericwq.codeberg.page/RPM-GPG-KEY-wangqi\n# add new repo to dnf repository\ndnf config-manager --add-repo https://ericwq.codeberg.page/aprilsh.repo\n# install client and server\ndnf install -y aprilsh\n```\n\nNow you can ssh login to the server, it's time to start apshd service and login with apsh.\n\n```sh\nsudo systemctl start apshd.service      # start apshd service\nsudo journalctl -f -u apshd.service     # keep reading the latest apshd.service log\napsh -m 100 packager@localhost:8022     # apsh login to server\napsh packager@localhost                 # apsh login without port mapping\n```\n\nAfter apsh login, you connection to the remote server is provided by aprilsh.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eMacOS\u003c/summary\u003e\n\nRun the following command to install aprilsh client for macOS.\n\n```sh\nbrew tap ericwq/utils                   # add tap to homebrew\nbrew install aprilsh                    # only install aprilsh client\n```\n\nAfter apsh login, you connection to the remote server is provided by aprilsh.\n\nRefer to [homebrew doc](https://github.com/ericwq/homebrew-utils) to know how to create homebrew package and tap.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eValidate installation\u003c/summary\u003e\n\nby default apshd listen on udp localhost:8100.\n\n```txt\nopenrc-nvide:~# netstat -lup\nActive Internet connections (only servers)\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name\nudp        0      0 localhost:8100          0.0.0.0:*                           45561/apshd\nopenrc-nvide:~#\n```\n\nnow login to the system with apsh (aprilsh client), note the `motd`(welcome message) depends on your linux system.\n\n```txt\nqiwang@Qi15Pro client % apsh ide@localhost\nopenrc-nvide:0.10.2\n\nLua, C/C++ and Golang Integrated Development Environment.\nPowered by neovim, luals, gopls and clangd.\nide@openrc-nvide:~ $\n```\n\nif you login on two terminals, on the server, there will be two server processes serve the clients. the following shows `apshd` serve two clients. one is`:8101`, the other is ':8102'\n\n```txt\nopenrc:~# netstat -lp\nActive Internet connections (only servers)\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name\ntcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN      225/sshd [listener]\ntcp        0      0 :::ssh                  :::*                    LISTEN      225/sshd [listener]\nudp        0      0 localhost:8100          0.0.0.0:*                           45561/apshd\nudp        0      0 :::8101                 :::*                                45647/apshd\nudp        0      0 :::8102                 :::*                                45612/apshd\nActive UNIX domain sockets (only servers)\nProto RefCnt Flags       Type       State         I-Node PID/Program name    Path\nunix  2      [ ACC ]     STREAM     LISTENING     872486 159/s6-ipcserverd   /run/utmps/.btmpd-socket\nunix  2      [ ACC ]     STREAM     LISTENING     869747 253/s6-ipcserverd   /run/utmps/.utmpd-socket\nunix  2      [ ACC ]     STREAM     LISTENING     866239 281/s6-ipcserverd   /run/utmps/.wtmpd-socket\nopenrc-nvide:~#\n```\n\n\u003c/details\u003e\n\n## Motivation\n\n[openSSH](https://www.openssh.com/) is excellent. While `mosh` provides better keystroke prediction/latency and is capable of handle WiFi/cellular mobile network roaming. But `mosh` project is not active anymore and no release [sine 2017](https://github.com/mobile-shell/mosh/issues/1115). Such a good project like `mosh` should keeps developing.\n\nAfter read through `mosh` source code, I decide to rewrite it with golang. Go is my first choice because the C++ syntax is too complex. Go also has excellent support for UTF-8 and multithreaded programming. The last reason: go compiler is faster than c++ compiler.\n\nThere are several rules for this project:\n\n- Keep base design of `mosh`: `SSP`, UDP, keystroke prediction.\n- Use 3rd party library as less as possible to keep it clean.\n\nThere are also some goals for this project:\n\n- Full UTF-8 support, including [emoji and flag](https://unicode.org/emoji/charts/emoji-list.html) support.\n- Support terminal 24bit color.\n- Upgrade to [proto3](https://developers.google.com/protocol-buffers/docs/proto3)\n- Use terminfo database for better compatibility.\n- Prove golang is a good choice for terminal developing.\n\nThe project name `Aprilsh` is derived from `April+sh`. This project started in shanghai April 2022, and it's a remote shell. Use the above command to add musl locales support and utmps support for alpine. Note alpine only support UTF-8 charmap.\n\n## Improvement\n\n- prediction engine evaluate based on both user input response and server side timeout\n- prediction engine support chinese character\n- support [XTGETTCAP](https://github.com/ericwq/aprilsh/issues/88), [SGR 1006](https://github.com/ericwq/aprilsh/issues/91), [synchronized output](https://github.com/ericwq/aprilsh/issues/89), [OSC 8](https://github.com/ericwq/aprilsh/issues/87), [CSI u](https://github.com/ericwq/aprilsh/issues/74)\n- support htop arrow key (mosh has a bug)\n- support large volumes of output generated from terminal application (mosh has a bug)\n- plan to support [terminal query across multi-terminal emulator](https://github.com/ericwq/aprilsh/issues/95)\n\n## Architecture\n\n![aprilsh.svg](img/aprilsh.svg)\n\n- The green part is provided by the system/terminal emulator. Such as [alacritty](https://alacritty.org/) or [kitty](https://sw.kovidgoyal.net/kitty/).\n- The cyan part is provided by `Aprilsh`.\n- The yellow part is our target terminal application. In the above diagram it's `neovim`.\n- Actually the yellow part can be any terminal based application: [emcas](https://www.gnu.org/software/emacs/), [neovim](https://neovim.io/), [htop](https://htop.dev/), etc.\n- The rest part is provided by the system.\n\nSet `GOFLAGS=\"-tags=utmps\" APRILSH_APSHD_PATH=~/.local/bin/apshd` before nvim.\n\n## Changelog\n\nReady for early access. Check [here](doc/changelog.md) for history detail.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericwq%2Faprilsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericwq%2Faprilsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericwq%2Faprilsh/lists"}