Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrcyjanek/gosh
Golang shell, to be used as an executable or as embedded shell.
https://github.com/mrcyjanek/gosh
Last synced: about 2 months ago
JSON representation
Golang shell, to be used as an executable or as embedded shell.
- Host: GitHub
- URL: https://github.com/mrcyjanek/gosh
- Owner: MrCyjaneK
- Created: 2021-05-16T13:23:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-14T09:32:18.000Z (over 3 years ago)
- Last Synced: 2024-10-12T01:37:11.661Z (2 months ago)
- Language: Go
- Homepage:
- Size: 43.9 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gosh
[![Build Status](https://ci.mrcyjanek.net/badge/8fba18c1?branch=master)](https://ci.mrcyjanek.net/repos/365)
Simple shell written in golang.
To start an interactive shell you can do:
```go
package mainimport (
"os"gosh "git.mrcyjanek.net/mrcyjanek/gosh/_core"
)func main() {
gosh.Start(os.Stdin, os.Stdout, os.Stderr)
}
```Every command runs in separated environment (changing path in one command doesn't change it for rest). That's why `cd` is part of `_core/`, and `echo` is not. I think that this is a good idea... But I'm not sure (yet), about that.
Currently only basics work `cd`, `ls`, `cat`, `printenv`, nothing that could be actually used, no `;`, `|`, `&&`, `&` and even no external command execution. Nothing.
If you need only one command, for example `ls`, you can include only it in your project [check source](https://git.mrcyjanek.net/mrcyjanek/gosh/src/branch/master/ls/main.go).
Exit codes support is provided.
I'll try to stay as close as possible to `sh`.