An interactive command line that allows you to explore me as a person and my interests. The infrastructure is modular so feel free to fork the project and make your own version.
- draggable window
- customizable, modular commands
- responsive
- autocompletion for commands
- autocompletion for paths
- the last commands are saved (reachable via
ArrowUp
,ArrowDown
) - cross-browser compatible
- 🌐 Modular - Create your own command in seconds by adding it to the
structure
object - 🐆 Fast – Save time. Don't start from scratch. Contribute and let others profit too!
- 🌸 Beautiful – Use the wonderful layout which is easy customizable and will fit all your needs.
How do I adjust this to my needs?
fs.activeDirectory
: Path – returns the absolute and current pathfs.displayPath
: string – the string displayed in green in the terminalfs.pathPrefix
: string – a string which is prepended before the absolute (fs.activeDirectory
) path
In init.ts
Commands.add(
'commandName', //! case-sensitive
(path: Path, args: string[]): string => {
// path - active directory
// args[0] - command
// args[1..] - first, second, ... argument and so on
return 'this is an <b>html</b> string which will be written to the stdout.';
},
'a short description of your command' // (optional) description of your command
)
In init.ts
fs.addCustom(
'foldername', // name
{ // content
meta: { // every object needs meta object
type: 'folder' // the type is always required!
// the meta object not be visible to the user
// so you can store additional information about the
// files/folder here
},
'subfolder': {
meta: { ... }
},
// styling is done via inline-styles or the `styles.css` file
'filename.ending': 'also a <em>html-string!</em>',
'downloadableFile': {
meta: {
type: 'download'
},
link: './path/to/downloadableFile.exe'
// the cat command downloads files automatically
// (my cv.pdf for reference)
}
},
new Path(['path', 'where', 'it', 'should', 'be', 'stored']) // note: the path must already be there
)
- create a new
filename.ts
insrc/
- in
webpack.config.js
add'./src/filename.ts'
to the entry array - Paste this into
filename.ts
. Use the following snippet so you have access to all of the important functions and variables:
import {Helper} from './core'
import {Commands, fs, domCmd} from './init'
/* Start your new project here */
- If you have noticed an issue or bug report it here.
- Contributors and maintainers always welcome!
- If you have used this project for your project, let me know :)
- Share your contributions so others can profit too.
- clean up the code
- rewrite the autocomplete method for the sake of performance
- split the code into multiple files
- fully document the code
- add the ability to create files via
echo
ornano
command- save files created by the user in local storage.
- use webpack
- fix the last commands issue (Arrow Up should always work)