UNDER DEVELOPMENT & EXPERIMENTAL - USE AT YOUR OWN RISK
Crystal Lang Package Manager — a modern, user-friendly package manager for Crystal projects.
- Simple commands for common package tasks (init, add, install, update, search, exec, binstubs).
- GitHub integration with common shard repo inference for quick adds.
- Development dependencies via --dev kept separate from runtime dependencies.
- Built-in shard search helper for quick discovery.
- Project initialization with a sensible shard.yml scaffold.
- Command execution passthrough within project context.
# clone meld repo
git clone https://github.com/cmittal790/meld.git
cd meld
# install shards
crystal run src/meld.cr -- install
# generate meld executable
crystal build src/meld.cr -o bin/meld# Add the bin directory to your PATH (temporary for this shell):
export PATH=$PATH:/path/to/meld/bin
# Create a symlink into a directory already in PATH
# User-level (no sudo), common on Linux:
mkdir -p ~/.local/bin # usually you'll have this directory already, but create it in case if you don't
ln -sf "$PWD/bin/meld" "$HOME/.local/bin/meld"
# Ensure ~/.local/bin is in PATH (persist for bash)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
# For zsh users
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
# Verify
which meld && meld --versionStart a new Crystal project.
crystal init app | lib <project_name>
# optional as `crystal init` has already created shards.yml file. note - `meld init` does not overwrite already existing shards.yml, but you can for sure delete it and run
meld initThis creates a shard.yml file with:
- Project metadata template.
- Crystal version requirement.
- License and author fields.
- Main executable target.
Current syntax (no positional version; flags only):
- add [-v | -b | -t | -c ] [--dev].
Examples:
- Add latest (unpinned):
meld add kemal- Add with version selector:
meld add kemal -v "~> 1.0.0"- Add as development dependency:
meld add spec --dev
meld add ameba -v "~> 1.4.0" --dev- Add from specific GitHub repository:
meld add my_shard -v "github:username/repository"- Add from Git URL:
meld add my_shard -v "git:https://github.com/username/repo.git"Notes:
- If no selector flag (-v/-b/-t/-c) is given, the dependency is added unpinned poiting to git repo head (no version/branch/tag/commit line).
- Only meld help shows help; subcommands don’t treat “help” specially.
- Install all dependencies:
meld install- Update all dependencies:
meld update- Update a specific dependency:
meld update kemal- Search by keyword:
meld search "web framework"
meld search database
meld search testing- Run tests:
meld exec "crystal spec"- Build project:
meld exec "crystal build src/my_project.cr"- Run application:
meld exec "crystal run src/my_project.cr"- Run code analysis:
meld exec "ameba"- Generate executable wrappers:
meld binstubs kemal# Initialize project
meld init
# Add web framework and dependencies
meld add kemal
meld add pg
meld add jwt
# Add development tools
meld add spec --dev
meld add ameba -v "~> 1.6.4" --dev
meld add webmock --dev
# Install everything
meld install# Initialize project
meld init
# Add ORM and database driver
meld add jennifer
meld add pg
# Add development dependencies
meld add spec --dev
meld install# Run tests
meld exec "crystal spec"
# Run static analysis
meld exec "ameba"
# Run specific test file
meld exec "crystal spec spec/models/user_spec.cr"Built-in hints for popular Crystal shards:
- Web: kemal, lucky, amber, marten.
- Database: pg, mysql, sqlite3, redis.
- ORMs: jennifer, clear, granite.
- Dev tools: spec, ameba, webmock.
- Utilities: crest, jwt, colorize, hardware.
| Command | Description | Example |
|---|---|---|
| init | Initialize new project | meld init |
| add [-v | -b | -t |
| search | Search for shards | meld search "web framework" |
| install | Install dependencies | meld install |
| update [shard] | Update dependencies | meld update kemal |
| exec | Execute command | meld exec "crystal spec" |
| binstubs | Generate binstubs | meld binstubs kemal |
| help [command] | Show help | meld help add |
- Crystal >= 1.17.1
- Shards package manager
# Clone the repository
git clone https://github.com/cmittal790/meld.git
cd meld
# Install dependencies
shards install
# Build the project
crystal build src/meld.cr -o bin/meld
# Run tests
crystal specsrc/
├── meld.cr # Main entry point
├── meld/
│ ├── cli.cr # Command-line interface
│ └── project.cr # Project management logic
spec/ # Test files
shard.yml # Project dependencies
# Run all tests
crystal spec
# Run specific test file
crystal spec spec/meld/cli_spec.cr
# Run with coverage
crystal spec --coverage- Fork it (https://github.com/cmittal790/meld/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
- Write tests for new features
- Follow Crystal coding conventions
- Update documentation for new commands
- Add new shards to the local database when appropriate
- Ensure backwards compatibility
This project is licensed under the AGPL-3 License. See LICENSE file for details.
- Chetan Mittal - creator and maintainer
- Meld install script
- Global package install e.g.
meld install -g morten - Remove packages (prunes from
libfolder too) e.g.meld remove kemal - Meld self updater e.g.
meld self update - Advanced search filters
- Configuration file support
- Package registry and integration
- Dependency resolution improvements