https://github.com/bfontaine/gosh
Simple shell written in Go
https://github.com/bfontaine/gosh
cli go shell
Last synced: about 1 year ago
JSON representation
Simple shell written in Go
- Host: GitHub
- URL: https://github.com/bfontaine/gosh
- Owner: bfontaine
- License: mit
- Created: 2015-02-28T09:10:13.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-03T13:01:49.000Z (over 11 years ago)
- Last Synced: 2025-03-23T23:43:40.529Z (over 1 year ago)
- Topics: cli, go, shell
- Language: Go
- Homepage:
- Size: 160 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gosh!
[](https://travis-ci.org/bfontaine/gosh)
[](https://coveralls.io/r/bfontaine/gosh?branch=master)
**Gosh** is a simple shell written in Go.
## Install
go install github.com/bfontaine/gosh
### Dependencies
* Go 1.2 or higher
* Readline
## Usage
gosh
You’ll get a prompt, from which you can execute commands like in every other
shell. Use `^D` or `exit` to exit it.
## Features
Just a basic REPL, right now.
Gosh doesn’t support quotes, escaping and wildcards, nor any loop or
conditional constructions.
### Builtin commands
* `alias L=V`: add an alias `L` to `V`. `V` can be any command, even with
spaces or weird characters. Aliases can’t be recursive.
* `cd `: change the current directory (can contain spaces)
* `echo ...`: print stuff. You can insert environment variables with `$var` or
`${var}`
* `quit`, `exit`, `^D`: exit the shell
### `~/.goshrc`
If a `~/.goshrc` file exists, Gosh reads it and executes it line-by-line as if
it were given on the prompt.
You can use it for common aliases, e.g.:
```sh
alias ll=ls -l
alias la=ls -la
```
### Options
Gosh currently supports the following options:
* `-debug`: show all errors
* `-trace`: show all lines are they are executed, both from the `~/.goshrc` and
the interactive session
Use `gosh -h` for more info.
### Editor support
* Vim: [vim-gosh](https://github.com/bfontaine/vim-gosh)