/github-vsc

🐙 Launch VSCode dev environment in your browser.

Primary LanguageTypeScript

This project may violate GitHub Actions usage policy, so I'm going to archive the repo soon. Please consider using other alternatives. Thanks.

GitHub VSC

Launch VSCode dev environment in your browser. For free.

How?

Change github to github-vsc in the URL and press Enter.

E.g. github.com/gao-sun/eul -> github-vsc.com/gao-sun/eul

Live Demo

Highlights

🔑 Simple. Just need a PAT for everything.

⚡ Super fast. Get your dev environment ready in up to 10s.

🔌 Flexible. Available for private repos and self-hosted runners.

📝 Cozy. Can only be an online editor without remote session.

Start a Remote Session for Dev

  1. Activate the 6th tab with GitHub logo in the side bar.
  2. Setup your PAT with repo access for forking the runner repo and repo checkout inside workflow runs.
  3. Choose the nearest runner server and your preferred OS, then click "Start Session".

preview-remote-session

Port Forwarding

For safety concerns, port forwarding is disabled by default. Enable with simple one-click and you can access the local port with HTTP reqeists via https://[session-id].runner-[location].github-vsc.com. See the tutorial here.

Is It Free?

TL;DR: YES.

  • 6 hours per session with PAT.
  • 72 hours with self-hosted runners.

Why 6 Hours?

For GitHub-hosted runners, quote from the Usage Limit section in the official docs:

Each job in a workflow can run for up to 6 hours of execution time.

Which means the runner job will be killed after you reach that limit. Also you may notice:

You can execute up to 1000 API requests in an hour across all actions within a repository.

We're enforcing WebSocket for data transmission inside the job so it'll be OK for casual development.

Why 72 Hours?

Unfortunately, self-hosted runners also have a Usage Limit on the total run time of workflow itself (i.e. 72 hours), and the 1,000 API requests limit also applies.

Any Method to Get Rid of All These Limitations?

Yes. But there's no one-line script yet. The basic concept is to setup fully controlled runner client and trigger client deployment by API hook/network event. Feel free to open an issue if you are interested.

Is It Safe?

Data Storage

We'll NOT transmit or store any of your credentials (for now it's PAT) or data to the cloud. You credentials will be saved inside your browser and used for GitHub official API requests and Actions setup. The repo access inside workflow is enabled by the official create or update a repository secret REST API.

Remote Session

Your connection is always under a secure protocol (HTTPS/WSS) and all session IDs are generated by the random algorithm with an extremely small collision probability. Quote from the collision calculator:

With the speed of 1000 IDs per second, ~21 million years needed, in order to have a 1% probability of at least one collision.

Treat your session ID as credentials.

Burn after Use

Thanks to the nature of GitHub Actions, there's no need to worry about setup and disposal. Your dev environment will be cleaned up as soon as you terminate the session from here or cancel the workflow run.

Online Editor

If you'd like to just do some quick editing, then no need for starting a remote session. Go ahead to make some changes, and you're ready to commit changes to the branch directly or open a pull request based on your access to the repo. Learn more about the online editor.

Specifications

Click here to see VM hardwares for GitHub-hosted runners. You can also find supported softwares within that page.

Runner servers are not hosted by GitHub. The bill sends to me. :-) They are hosted in Microsoft Azure since it's backing GitHub Actions as well.

I Know There's One More Question...

Compare to the officially provided GitHub Codespaces:

GitHub VSC GitHub Codespaces
Type Open-Source Project Developed by GitHub
Pricing Free From $0.085/hr to $0.339/hr, with additional monthly storage costs. Learn more
OS Ubuntu, macOS Ubuntu
Private Deployment Available N/A
VSCode Extension Built-in Support marketplace
Code Navigation Not Yet ✔️

Engineering

See explanation.

Try It Locally

Make sure you are prepared for the same prerequisites as Code - OSS.

# in ./
# install deps
yarn
# clone and build Code - OSS
yarn build-vsc
# happy hacking on https://localhost:8080
yarn dev

To debug remote session, please see github-vsc-runner.

Credits

Heavily inspired by github1s, edited vscode compiling part from vscode-web, and derivated FileSystem implementation from vscode-web-playground.

Also exported the beautiful One Dark theme from vscode-theme-onedark.