MCPcopy Index your code
hub / github.com/Property404/its-a-unix-system

github.com/Property404/its-a-unix-system @0.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.1.2 ↗ · + Follow
266 symbols 589 edges 57 files 32 documented · 12% updated 16mo ago0.1.2 · 2024-11-09★ 431 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

It's a Unix System! I know this!

WebAssembly Unix terminal built with 🦀Rust🦀

Features

  • Essential Unix commands (sh, ls, cp, mv, cat, cowsay, etc)
  • Basic Vi implementation
  • Pipes and file redirect
  • Variables and subshells
  • File system via rust-vfs
  • Basic scripting support (try sh example.sh)
  • GNU Readline-like features (key bindings, history, tab-complete)
  • ANSI escape code support, including some colors

Known bugs

  • Running foo=bar echo ${foo} will print foo's old value
  • [ cannot compare multiword values because of how variable substition works
  • No emoji support in vi

Example

$ fortune -s | cowsay
 _____________________________________
< Your mother is disappointed in you. >
 -------------------------------------
         \    ^__^
          \   (oo)\_______
              (__)\       )\/\
                  ||----w |
                  ||     ||
$ # We also have file redirect
$ echo "Wow what a great fortune" > file
$ # We could do `cat file` as well
$ cat < file
Wow what a great fortune

Building and Serving for Development

  • cargo install wasm-pack
  • wasm-pack build --dev
  • cd www
  • npm install
  • npm run start

App will be served on port 8080

Building for Release

  • cargo install wasm-pack
  • wasm-pack build --no-default-features
  • cd www
  • npm install
  • npm run build

Build will be in www/dist/

License

MIT

Extension points exported contracts — how you extend this code

History (Interface)
This trait indicates that a struct can record or retrieve command history. [2 implementers]
src/programs/common/readline.rs
TerminalWriter (Interface)
(no doc) [4 implementers]
src/streams/output_stream.rs
Device (Interface)
(no doc) [1 implementers]
src/filesystem/dev.rs
TerminalReader (Interface)
(no doc) [4 implementers]
src/streams/input_stream.rs

Core symbols most depended-on inside this repo

push
called by 53
src/filesystem/multi.rs
get_path
called by 49
src/filesystem/multi.rs
is_empty
called by 35
src/programs/common/extendable_iterator.rs
expect
called by 28
tests/mod.rs
run
called by 25
tests/mod.rs
open_file
called by 22
src/filesystem/dev.rs
to_bytes
called by 19
src/ansi_codes.rs
exists
called by 17
src/filesystem/dev.rs

Shape

Method 98
Function 96
Class 54
Enum 14
Interface 4

Languages

Rust95%
TypeScript5%

Modules by API surface

src/streams/input_stream.rs19 symbols
src/programs/sh.rs19 symbols
src/streams/output_stream.rs18 symbols
src/filesystem/multi.rs15 symbols
src/filesystem/dev.rs14 symbols
src/streams/standard_streams.rs13 symbols
www/term.js12 symbols
src/programs/common/readline.rs11 symbols
src/filesystem/mod.rs9 symbols
src/streams/pipe.rs8 symbols
src/programs/common/shell_commands.rs8 symbols
src/programs/common/extendable_iterator.rs8 symbols

For agents

$ claude mcp add its-a-unix-system \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact