{"id":24475031,"url":"https://github.com/mitchpaulus/mshell","last_synced_at":"2026-04-10T23:05:03.694Z","repository":{"id":255732010,"uuid":"853495215","full_name":"mitchpaulus/mshell","owner":"mitchpaulus","description":"Experimental Concatenative Shell-like Scripting Language","archived":false,"fork":false,"pushed_at":"2025-03-02T20:55:54.000Z","size":7619,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T21:31:40.492Z","etag":null,"topics":["concatenative-language","glue-code","golang","programming-language","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitchpaulus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-06T19:14:25.000Z","updated_at":"2025-03-02T20:55:58.000Z","dependencies_parsed_at":"2024-12-03T16:27:20.146Z","dependency_job_id":"81396cd3-757f-49dc-8eb4-8488e6a3e3ca","html_url":"https://github.com/mitchpaulus/mshell","commit_stats":null,"previous_names":["mitchpaulus/mshell"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchpaulus%2Fmshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchpaulus%2Fmshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchpaulus%2Fmshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchpaulus%2Fmshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitchpaulus","download_url":"https://codeload.github.com/mitchpaulus/mshell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243602237,"owners_count":20317592,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concatenative-language","glue-code","golang","programming-language","shell-script"],"created_at":"2025-01-21T09:11:59.647Z","updated_at":"2026-04-10T23:05:03.681Z","avatar_url":"https://github.com/mitchpaulus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `mshell`\n\n\u003e [!WARNING]\n\u003e This is still very much an experiment.\n\u003e I still am changing significant parts of the syntax and semantics.\n\u003e At this point, this repository has fewer than 10 stars, so I will be operating as if I am the only user.\n\u003e If you are using it, have feedback, or just want to say hello, you can email [mshell-feedback@mitchellt.com](mailto:mshell-feedback@mitchellt.com) or use the GitHub discussions.\n\n`mshell` is my personal scripting language, meant to replace short shell scripts (\u003c ~100 LOC) and other shell one-liners.\nA concatenative language is a good fit for this purpose, as it allows for easy composition of simple functions and pipelines.\n\nThe goal is to provide most of the simple Gnu utilities as part of the language,\nwhile making calls to external programs and pipelines simple and easy.\n\nFuture goals are to even add some type safety.\n\n# Documentation\n\nThe beginnings of some documentation are for now located [here](https://mitchellt.com/msh/basics.html).\n\n# Installation\n\n`mshell` is compiled to a single executable binary, so installation is straightforward.\nFirst, download the executable from the [GitHub releases page](https://github.com/mitchpaulus/mshell/releases/latest).\nThe assets are tar.gz files, so you would unpack them with:\n\n```sh\ntar -xvf linux_amd64.tar.gz\n```\n\nPut that file in a directory that is in your `$PATH` and make sure it is marked as executable on Linux.\n\nThe other file to copy is the standard library, which is included in the release, or is at `lib/std.msh` in this repo.\nFor `msh v0.13.0`, put it at `${XDG_DATA_HOME:-$HOME/.local/share}/msh/v0.13.0/std.msh` on Linux/macOS\nor `%LOCALAPPDATA%\\msh\\v0.13.0\\std.msh` on Windows.\nAlso create `${XDG_CONFIG_HOME:-$HOME/.config}/msh/v0.13.0/init.msh` on Linux/macOS\nor `%LOCALAPPDATA%\\msh\\v0.13.0\\init.msh` on Windows.\nThat init file is required for scripts that declare `VER \"v0.13.0\"`, but it is optional for interactive use and scripts without `VER`.\nFor one-off overrides, `MSHSTDLIB` and `MSHINIT` can point to exact startup files for interactive use and scripts without `VER`.\nScripts with `VER \"vX.Y.Z\"` always use the startup files for `vX.Y.Z`.\n\nAn example install script is at [install.sh](https://github.com/mitchpaulus/mshell/blob/main/install.sh) in this repository.\n\n# Examples\n\nBest way to understand purpose and syntax of `mshell` is to see it in action.\nI have ported over many of personal scripts that used to be done with `sh` or Python in my personal dotfiles.\nTake a look through this [script directory](https://github.com/mitchpaulus/dotfiles/tree/master/scripts) and you'll find many real life examples.\n\nOtherwise, there are some other examples [here](https://mitchellt.com/msh/examples.html)\n\nHere are some examples.\n\n*Better Awk One-liners*. Examples from the `awk` book, translated to `mshell`. You can run these examples like:\n\n```sh\nmsh file_with_contents.msh \u003c input_file_to_process.txt\nawk -f file_with_contents.awk \u003c input_file_to_process.txt\n# OR (using 1st example)\nmsh -c 'sl len wl' \u003c input_file_to_process.txt\nawk 'END { print NR }' \u003c input_file_to_process.txt\n```\n\nThese examples assume the standard library is installed in the normal startup location for your current `msh` version.\n\n\n*Simpler execution of common shell idioms*\n\n| Objective | `sh` | `mshell` |\n|-----------|-----|----------|\n| Print the number of files in the current directory | `ls \\| wc -l`                                                | `\"*\" glob len wl` |\n| `find`/`xargs`                                     |  `find . -t x -name '*.sh' -print0 \\|  xargs -0 mycommand`   | `[mycommand [find . -t x -name \"*.sh\"]]o;` |\n| `head` | `head -n 10` | `sl :10 uw` |\n| `tail` | `tail -n 10` | `sl :-10 uw` |\n| `wc` | `wc -l` | `sl len wl` |\n| `grep` | `grep 'pattern'` | `sl (\"pattern\" in) filter uw` |\n| `cut` | `cut -d ';' -f 2` | `sl (\";\" split :1: wl) each` |\n\n# Editor Support\n\n- VS Code extension is available on the Marketplace: [`MitchellPaulus.mshell`](https://marketplace.visualstudio.com/items?itemName=MitchellPaulus.mshell).\n- Sublime Text syntax highlighting is available in [`sublime/msh.sublime-syntax`](https://github.com/mitchpaulus/mshell/tree/main/sublime/msh.sublime-syntax).\n- Notepad++ light and dark user-defined language files are available in [`Notepad++/`](https://github.com/mitchpaulus/mshell/tree/main/Notepad++).\n- Vim/Neovim syntax highlighting is available via [`mshell-vim`](https://github.com/mitchpaulus/mshell-vim).\n- A language server is bundled with the CLI, providing builtin hover information, completion on `@` variables, and scope-aware variable renaming.\n\n\n# TODO\n\n- Job control. We don't have CTRL-z or `bg`/`fg` functionality right now.\n- User defined abbreviations (like fish). Right now you get my hard-coded ones, sorry.\n- Type checking.\n- Improved error messages.\n\n# References/Inspirations\n\n- [Nushell](https://www.nushell.sh/)\n- [Elvish](https://elv.sh/)\n- [fish](https://fishshell.com/)\n- [Porth](https://gitlab.com/tsoding/porth)\n- [Factor](https://factorcode.org/)\n- [`dt`](https://dt.plumbing/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchpaulus%2Fmshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitchpaulus%2Fmshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchpaulus%2Fmshell/lists"}