hsh
Version, currently master branch1 version
- master branchlatestJul 14, 2025
github.com/harishtpj/hsh
A simple portable shell
Installation
# Add this to your shard.yml
dependencies:
hsh:
github: harishtpj/hsh
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.16.3- License
- MIT
- Author
- Harish Kumar
- Target
hshfrom src/hsh.cr
Dependencies
Runtime Dependencies
- reply*github: I3oris/reply
- phreak*github: shinzlet/phreak
- shellwords*github: szTheory/shellwords-crystal
README
hsh
A simple, portable shell written in Crystal with cross-platform compatibility for Linux and Windows.
Features
- ๐ Cross-platform support: Works on both Linux and Windows
- ๐ Path completion: Intelligent path completion for enhanced productivity
- ๐ง Built-in commands: Supports essential commands like
lsand more - ๐ Crystal-powered: Built with Crystal for performance and reliability
- ๐ฏ Minimal compatibility: Designed to work seamlessly across different operating systems
Installation
Prerequisites
- Crystal language (>= 1.16.3)
Building from Source
git clone https://github.com/harishtpj/hsh.git
cd hsh
shards install
crystal build src/hsh.cr
Running
./hsh
Usage
Once you start hsh, you'll be presented with an interactive shell prompt. The shell supports:
Built-in Commands
ls- List directory contents- Standard shell navigation and file operations
- Cross-platform path handling
Path Completion
Press Tab to auto-complete file and directory paths. The completion system works intelligently across both Linux and Windows path formats.
Example Session
hsh> ls
[directory contents]
hsh> cd /path/to/directory
hsh> ls *.cr
[Crystal files]
Development
Project Structure
src/
โโโ hsh.cr # Main entry point
โโโ hsh/
โ โโโ builtins/ # Built-in commands
โ โ โโโ ls.cr # ls command implementation
โ โโโ errors.cr # Error handling
โ โโโ executor.cr # Command execution
โ โโโ helpers.cr # Utility functions
โ โโโ repl.cr # Read-Eval-Print Loop
โ โโโ version.cr # Version information
โโโ spec/ # Test files
Dependencies
shellwords- Shell word parsingreply- REPL functionalityphreak- Additional shell utilities
Running Tests
crystal spec
Development Setup
-
Install dependencies:
shards install -
Run in development mode:
crystal run src/hsh.cr -
Build for production:
crystal build --release src/hsh.cr
Roadmap
Current Features (v0.1.0)
- โ Basic shell functionality
- โ Path completion
- โ Cross-platform compatibility (Linux/Windows)
- โ
Built-in
lscommand
Planned Features
- ๐ Enhanced built-in commands:
cat,cd,mkdir,rm,cp,mv - ๐ Improved path completion: Better fuzzy matching and context awareness
- ๐ User-friendly features:
- Command history
- Syntax highlighting
- Better error messages
- Configuration file support
- ๐ Advanced features:
- Job control
- Environment variable management
- Script execution
- Pipe and redirection support
Contributing
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
How to Contribute
- Fork it (https://github.com/harishtpj/hsh/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Areas for Contribution
- Adding new built-in commands
- Improving path completion algorithms
- Enhancing cross-platform compatibility
- Writing tests and documentation
- Performance optimizations
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributors
- Harish Kumar - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Jul 14, 2025
- Crystal
>= 1.16.3- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/harishtpj/hsh
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1