JsOS-CLI
Command line tools for JsOS
.
Installation
npm i -g jsos-cli
Usage
USAGE: jsos <command> [<args>] Commands: start Quickly start JsOS in VM using current directory watch Watch current directory and automatically restart VM pack Package specified directory into ramdisk bundle run Run JsOS in VM using specified ramdisk bundle show Print VM output or log mkimg Easily create a disk image for use with JsOS mkiso Easily create a bootable ISO image help Print this usage help
Getting Started
To setup a project simply clone JsOS
repository
git clone https://github.com/JsOS-Team/JsOScd JsOSnpm i
Run project in QEMU VM:
jsos start
Or let it watch directory for changes and restart QEMU automatically:
jsos watch
Commands
start
, watch
and run
commands are very similar and have pretty much the same list of arguments. They all launch JsOS in the QEMU VM.
USAGE: jsos start [<args>] Arguments: --net Enable network --netdump Save network activity to a file --kvm Enable Linux KVM --pcspk Enable PCSpeaker emulation
pack
packages directory into ramdisk/initrd bundle. This is useful if you'd like to ship compiled bundle somewhere and don't want to run it locally.
USAGE: jsos pack [<args>] <directory> <directory> Directory to package Arguments: --list-files List packaged files only --ignore Add file ignore pattern --entry Set entry point import/require string --add-dir Add a directory into the package
mkimg
creates a FAT disk image for use with JsOS. On some systems, you may need to use root/administrator privileges. Depends on qemu-img on all platforms, hdiutil and diskutil on macOS (builtin), losetup and mkfs.msdos on Linux (included on most distributions), and diskpart on Windows (bulitin).
USAGE: jsos mkimg [<args>] <filename>
Environment Variables
While there is a proposal to add envirionment variables from the command line, there is currently no officially supported process for passing them into a runtime instance. However, there is a work around that will allow the passing of Kernel Command Line arguments instead.
jsos run --append <your env args> initrd
To access this variable in your code use the following:
const wholeString = const arrayOfArguments = wholestring.split;arrayOfArguments[i]; // where i is the index of your argument in the array
Completion
Enables tab-completion for all commands.
jsos completion >> ~/.bashrcjsos completion >> ~/.zshrc
License
Apache License, Version 2.0