Termo is a simple terminal emulator that can be used to create a terminal-like interface on your website. It is inspired by the terminal emulator in stripe.dev. It is an wrapper on top of xterm.js.
Check out the
demo and documentation.
github
Include the following script tag in your HTML file.
<script src="https://cdn.jsdelivr.net/gh/rajnandan1/termo/dist/termo.min.js"></script>
Create a new instance of Termo by passing an object .
const myTermo = new termo({ title: 'Termo', welcomeMessage: 'Welcome to Termo', commands: [ { command: 'hello', description: 'Says hello', action: async (terminal, args) => terminal.write('\r\nHello! ' + args.join(' ')), }, ], }); myTermo.create(); myTermo.show();
The above is the detailed content of Built a cli for browser. For more information, please follow other related articles on the PHP Chinese website!