Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dragonxdev/amcsh

A high-performance Unix shell designed for speed
https://github.com/dragonxdev/amcsh

cli high-performance unix

Last synced: 11 days ago
JSON representation

A high-performance Unix shell designed for speed

Awesome Lists containing this project

README

        

# ๐Ÿš€ amcsh - Advanced Modern C Shell

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)]()
[![C Version](https://img.shields.io/badge/C-C11-orange.svg)]()
[![Platform](https://img.shields.io/badge/platform-macOS%20|%20Linux-lightgrey.svg)]()



amcsh Logo

*A high-performance, modern shell written in C with focus on speed and efficiency* ๐Ÿƒโ€โ™‚๏ธ๐Ÿ’จ

## โœจ Features

- ๐Ÿš„ **High Performance**: Uses `posix_spawn` instead of traditional `fork/exec`
- ๐Ÿงต **Parallel Execution**: Built-in thread pool for concurrent operations
- ๐Ÿ”„ **Smart Caching**: Optimized command caching with LRU eviction
- ๐ŸŽฏ **Job Control**: Full job control with background process support
- ๐Ÿ” **Tab Completion**: Intelligent command completion using trie data structure
- ๐Ÿ“œ **History Management**: Efficient command history with search capabilities
- ๐Ÿ”ง **Built-in Commands**: Optimized built-in commands for common operations

## ๐ŸŽฏ Performance

AMCSH is designed with performance in mind:

- โšก๏ธ **Fast Process Creation**: Up to 30% faster than traditional shells
- ๐Ÿ“Š **Memory Efficient**: Optimized memory usage with smart data structures
- ๐Ÿ”„ **Quick Command Lookup**: O(1) command resolution with hash-based cache
- ๐Ÿงต **Parallel Operations**: Asynchronous execution of shell operations

## ๐Ÿš€ Getting Started

### Prerequisites

```bash
# Install CMake (macOS)
brew install cmake

# Install CMake (Ubuntu/Debian)
sudo apt-get install cmake
```

### Building from Source

```bash
# Clone the repository
git clone https://github.com/yourusername/amcsh.git
cd amcsh

# Create build directory
mkdir build && cd build

# Build
cmake ..
make

# Run AMCSH
./amcsh
```

## ๐Ÿ’ก Usage

### Basic Commands

```bash
# Change directory
cd /path/to/directory

# List jobs
jobs

# Background processes
command &

# Bring job to foreground
fg %1

# Send job to background
bg %1
```

### Advanced Features

```bash
# Command history search
ctrl-r

# Tab completion
command

# Process substitution
command $(another_command)

# I/O redirection
command > output.txt 2> error.log
```

## ๐Ÿ— Architecture

AMCSH is built with a modular architecture:

```
amcsh/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ main.c # Main shell loop
โ”‚ โ”œโ”€โ”€ executor.c # Command execution
โ”‚ โ”œโ”€โ”€ parser.c # Command parsing
โ”‚ โ”œโ”€โ”€ builtins.c # Built-in commands
โ”‚ โ”œโ”€โ”€ completion.c # Tab completion
โ”‚ โ”œโ”€โ”€ history.c # History management
โ”‚ โ”œโ”€โ”€ job_control.c # Job control
โ”‚ โ”œโ”€โ”€ thread_pool.c # Thread pool
โ”‚ โ””โ”€โ”€ cmd_cache.c # Command cache
โ”œโ”€โ”€ include/
โ”‚ โ”œโ”€โ”€ amcsh.h # Main header
โ”‚ โ””โ”€โ”€ parser.h # Parser definitions
โ”œโ”€โ”€ assets/
โ”‚ โ””โ”€โ”€ images/ # Logo and images
โ””โ”€โ”€ build/ # Build artifacts
```

## ๐Ÿ”ง Configuration

AMCSH can be configured through environment variables:

| Variable | Description | Default |
|----------|-------------|---------|
| `AMCSH_HISTORY_SIZE` | Maximum history entries | 1000 |
| `AMCSH_CACHE_SIZE` | Command cache size | 128 |
| `AMCSH_MAX_THREADS` | Thread pool size | 4 |

## ๐Ÿค Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'feat: Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a PR

## ๐Ÿ“ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ‘ฅ Authors

- Amaar - *Initial work* - [GitHub Profile](https://github.com/dragonxdev)

## ๐Ÿ™ Acknowledgments

- Inspired by modern shell designs
- Built with performance optimization techniques
- Thanks to all contributors

---


Made by Amaar :)