https://github.com/jkbkupczyk/shell-go
A minimal POSIX-compliant shell implemented in Go.
https://github.com/jkbkupczyk/shell-go
codecrafters codecrafters-shell golang shell
Last synced: 4 months ago
JSON representation
A minimal POSIX-compliant shell implemented in Go.
- Host: GitHub
- URL: https://github.com/jkbkupczyk/shell-go
- Owner: jkbkupczyk
- Created: 2025-02-02T21:30:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-12T21:41:15.000Z (over 1 year ago)
- Last Synced: 2025-02-12T22:32:06.414Z (over 1 year ago)
- Topics: codecrafters, codecrafters-shell, golang, shell
- Language: Go
- Homepage: https://app.codecrafters.io/courses/shell/overview
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# shell-go
A minimal POSIX compliant shell, implemented in Go, that's capable of interpreting
shell commands, running external programs and builtin commands like:
echo, type, pwd, cd and more. Includes stdout and stderr redirection and autocompletion.
**Note**: This project is a part of ["Build Your Own Shell"](https://app.codecrafters.io/courses/shell/overview) from [codecrafters.io](https://codecrafters.io).
## Features
- REPL
- running builtin commands [exit, echo, type, pwd, cd]
- running external program with arguments
- support for non quoted, single quoted, double quoted arguments
- stdout and stder redirection
- stdout and stderr appending
- autocompletion
- signal handling (`Ctrl+C`, `Ctl+D`)
## Installation
Before you do any of the steps below, make sure you have [Golang](https://go.dev) installed.
1. Clone the repo
```sh
git clone https://github.com/jkbkupczyk/shell-go.git
```
2. Build and run
```sh
go build -o bin/myshell ./cmd/myshell/.
./bin/myshell
```
3. Run tests (optional!)
```sh
go test -v -timeout 30s ./...
```
You can also use [Make](https://www.gnu.org/software/make) commands: `run` - for building and running application and `test` for running tests - see [Makefile](Makefile).
## Roadmap / TODOs
- more tests
- refactors, fixes
- piping
- history
- variable interpolation
- job control
- new functionalities (reference [Bash Reference Manual](https://www.gnu.org/software/bash/manual/bash.html))
## Contributing
Feel free to create issues or submit pull requests!