"The computer can be used as a tool to liberate and protect people, rather than to control them." -Hal Finney
A developer-friendly ecosystem of apps designed to build a crypto-focused web-based operating system. The goal is for the entire system to run within any modern browser, while having the capability to connect to backend systems for more features.
The project is still very young, and proper documentation and organization is Coming Soon™.
- Features
- Alpha Footage
- Disclaimer
- User Quickstart
- Developer Quickstart
- Scripting
- Kernel Interface
- App Structure
- TODO
- Further Documentation
- Web-based terminal with xterm.js
- Web3 wallet integration with web3 and ethers.js
- Fully in-browser filesystem with BrowserFS
- Sexy dialogs with sweetalert2
- Slick windowing system with WinBox
- Developer-friendly: apps are just HTML/CSS/JS
- Optional desktop environment
Here's a quick video showcasing a few of the features: web3os alpha demo
This project is still considered to be in an alpha state. All apps run in the same context and can access every other app, as well as the entire browserfs.
Do not rely on it to keep anything safe, and never paste commands you don't understand. Anywhere, ever.
- Visit https://web3os.sh
- Type
help - Type
ls /bin - Edit a file:
edit /tmp/test.txt - Launch the desktop:
desktop - Launch the file explorer:
files - Launch a browser:
www https://instacalc.com - Show your ETH address:
account - Check native coin balance:
account balance - Check token balance:
account balance USDC - Learn more about commands:
help command - Run the screensaver:
screensaver - 🎉 Fire the Confetti Gun:
confetti
git clone git@github.com:web3os-org/kernel.git
cd kernel
yarn # or npm install
yarn start # or npm startFrom here, simply connect to https://localhost:8080 and accept the self-signed certificate warning.
Web3os scripts (.sh) are a simple line-by-line execution, while Javascript (.js) offers far more power.
To run a web3os script: sh /path/to/script.sh
- Or from an app:
window.kernel.executeScript('/path/to/script.sh')
To run a Javascript script: eval /path/to/script.js
- Or from an app:
window.kernel.execute('eval /path/to/script.js')
This (and everything else) is subject to change before version 1.0.
Also, expect undocumented methods.
window.kernel.bin { name: app }
- Contains all apps registered in the kernel
- e.g.,
window.kernel.bin.desktop.run()
window.kernel.wallet.web3 :Web3Provider
- The web3 provider setup with the
accountcommand
window.kernel.wallet.account { address: '0x..', chainId: 1 }
- You may also interact directly with the account app.
- e.g.,
window.kernel.bin.account.connect()
- e.g.,
window.kernel.dialog ({ ...sweetalert2options })
- Convenience method to create a sweetalert2 dialog with appropriate defaults
- e.g.,
window.kernel.dialog({ title: 'Are you sure?', text: 'Scary stuff!', icon: 'warning' })
window.kernel.set ('namespace', 'key', :any)
- Sets a value in the kernel "memory" - persists in localStorage
- e.g.,
window.kernel.set('user', 'name', 'hosk') - e.g.,
window.kernel.set('myapp', 'theme', { color: 'rebeccapurple' })
window.kernel.get ('namespace', 'key')
- Gets a value from the kernel "memory" - loaded from localStorage
- e.g.,
window.kernel.get('user', 'name') - e.g.,
const { color } = window.kernel.get('myapp', 'theme')
Developers should be able to create apps in any way they like, with as few requirements as possible. Remember, your app is simply running in a browser - you have access to everything that any other script does.
Here is the structure of a very minimal app:
export const name = 'myapp'
export const version = '0.1.0'
export const description = 'My application'
export const help = `
Myapp enables developers to Do An App!
Usage: myapp <options> Run myapp with some options!
`
export async function run (terminal, context) {
console.log(terminal) // the xterm.js terminal in which your app is running
console.log(context) // the plain string of arguments passed to your app
terminal.log('Thanks for checking out myapp!')
terminal.log(context)
}A good example of a more full-featured app can be found in src/bin/confetti/index.js.
- There's a lot to do 😅
- Decoupling of built-in apps into their own packages
- Finish the packaging system to be able to install apps
- Some apps are really just placeholders and don't yet have full functionality
- Adding more things to this list
Further documentation will soon be available at https://docs.web3os.sh