https://github.com/sahil101/sahil101-codecrafters-shell-go
This is a command line tool
https://github.com/sahil101/sahil101-codecrafters-shell-go
bash cli commands go parser
Last synced: 2 months ago
JSON representation
This is a command line tool
- Host: GitHub
- URL: https://github.com/sahil101/sahil101-codecrafters-shell-go
- Owner: sahil101
- Created: 2025-02-26T17:55:44.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-27T18:25:57.000Z (over 1 year ago)
- Last Synced: 2025-02-28T00:32:52.132Z (over 1 year ago)
- Topics: bash, cli, commands, go, parser
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MyShell
MyShell is a simple command-line shell implemented in Go. It supports basic shell commands such as `echo`, `exit`, `type`, `pwd`, and `cd`. The shell reads user input, parses commands, and executes them accordingly.
## Features
- **Built-in Commands**:
- `echo`: Prints the provided arguments to the standard output.
- `exit`: Exits the shell.
- `type`: Displays whether the command is a built-in or its path if it's an executable.
- `pwd`: Prints the current working directory.
- `cd`: Changes the current directory.
- **Command Execution**: Executes external commands and captures their output.
## Installation
To install MyShell, clone the repository and build the project:
```bash
git clone https://github.com/sahil101/sahil101-codecrafters-shell-go.git
cd sahil101-codecrafters-shell-go
go build -o myshell cmd/myshell/main.go
```
## Usage
Run the shell by executing the following command:
```bash
cd /tmp/
./myshell
```
Once the shell is running, you can enter commands. For example:
```bash
$ echo Hello, World!
Hello, World!
$ pwd
/Users/yourusername/Desktop
$ cd /path/to/directory
$ type echo
echo is a shell builtin
```
## Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or features you'd like to add.
## License
This project is licensed under the MIT License.