doual
v2.0.0
Published
DouAl - Alias management tool for Unix-like systems (MacOS, Linux)
Readme
DouAL - Dynamic Alias Manager
A powerful command-line tool for managing shell aliases with support for package-based distribution through GitHub repositories.
Features
- Local Alias Management: Create, update, and remove custom shell aliases
- Package System: Install pre-configured alias packages from GitHub repositories
- Bucket Management: Add and manage GitHub repositories as package sources
- Cross-Shell Support: Automatically integrates with your shell configuration
- Smart Conflict Resolution: Handles alias conflicts intelligently
- Search & Discovery: Find packages across all configured buckets
Installation
# Fast installaton (npmjs package)
npm i -g doual
# Manual installation
git clone https://github.com/douxxtech/doual
cd doual
npm i
npm linkQuick Start
# Add a package bucket
dal bucket add douxxtech/dal-bucket
# Search for available packages
dal search
# Install a package
dal install git-shortcuts
# List installed packages
dal list --packages
# Create a custom alias
dal create "ls -la" ll
# Remove an alias
dal remove llCommands
Local Alias Management
Create Alias
dal create <command> <alias> [options]Create or update a local shell alias.
Options:
-a, --args <arguments>: Additional arguments for the command-r, --root <true|false>: Run command as root (default: false)
Examples:
# Simple alias
dal create "ls -la" ll
# Alias with arguments
dal create "docker ps" dps -a "-a --format table"
# Alias requiring root privileges
dal create "systemctl restart" srestart -r trueRemove Alias
dal remove <alias>Remove a local alias with confirmation prompt.
List Aliases
dal list [options]Display all configured aliases.
Options:
-p, --packages: Show only installed packages
Bucket Management
Add Bucket
dal bucket add <user/repo>Add a GitHub repository as a package source.
Example:
dal bucket add douxxtech/dal-bucketRemove Bucket
dal bucket remove <user/repo>Remove a configured bucket.
List Buckets
dal bucket listDisplay all configured buckets with package counts.
Refresh Bucket
dal bucket refresh <user/repo>Update package list from a specific bucket.
Package Management
Install Package
dal install <package> [options]Install a package from configured buckets.
Options:
-b, --bucket <bucket>: Install from specific bucket-f, --force: Force overwrite existing aliases
Examples:
# Install from any bucket
dal install git-shortcuts
# Install from specific bucket
dal install git-shortcuts -b douxxtech/dal-bucket
# Force overwrite existing aliases
dal install git-shortcuts --forceUninstall Package
dal uninstall <package> [options]Remove an installed package and all its aliases.
Options:
-f, --force: Skip confirmation prompt
Search Packages
dal search [query] [options]Search for available packages across all buckets.
Options:
-b, --bucket <bucket>: Search specific bucket only
Examples:
# List all packages
dal search
# Search for git-related packages
dal search git
# Search in specific bucket
dal search docker -b douxxtech/dal-bucketPackage Structure
DAL packages are JSON files stored in GitHub repositories. Each package defines one or more aliases:
{
"name": "git-shortcuts",
"description": "Essential Git command shortcuts",
"version": "1.2.0",
"author": "Your Name",
"tags": ["git", "version-control", "productivity"],
"aliases": [
{
"alias": "gs",
"command": "git status",
"description": "Show git status",
"args": "--short --branch",
"runAsRoot": false,
"tags": ["status", "quick"]
},
{
"alias": "gp",
"command": "git push",
"description": "Push changes to remote",
"runAsRoot": false
}
]
}Package Fields
- name: Package identifier (string, required)
- description: Package description (string, optional)
- version: Package version (string, optional, default: "1.0.0")
- author: Package author (string, optional)
- tags: Package tags for discovery (array, optional)
- aliases: Array of alias configurations (required)
Alias Configuration
- alias: The alias name (string, required)
- command: The command to execute (string, required)
- description: Alias description (string, optional)
- args: Default arguments (string, optional)
- runAsRoot: Execute with sudo (boolean, optional, default: false)
- tags: Alias-specific tags (array, optional)
Creating Your Own Bucket
- Create a new GitHub repository
- Add JSON package files to the root directory
- Each
.jsonfile represents a package - Follow the package structure outlined above
- Users can add your bucket with:
dal bucket add douxxtech/your-repo
Example Bucket Structure
your-bucket/
├── git-shortcuts.json
├── docker-helpers.json
├── system-tools.json
└── README.mdConfiguration Files
DouAL stores configuration in your home directory:
~/.doual_aliases: Local aliases and package information~/.doual_buckets: Configured bucket repositories- Shell RC files:
~/.bashrc,~/.zshrc, etc. (aliases are appended here)
Troubleshooting
Common Issues
Aliases not available after installation
- Reload your terminal:
source ~/.bashrc(or restart terminal) - Check if aliases were added to the correct RC file
- Reload your terminal:
Package not found
- Refresh bucket contents:
dal bucket refresh <bucket-name> - Verify package name with:
dal search <package-name>
- Refresh bucket contents:
Permission denied errors
- Ensure proper file permissions on configuration files
- For root-level commands, use the
runAsRootoption
GitHub API rate limits
- Wait and try again later
- Consider using authentication for higher limits
Getting Help
dal --help
dal <command> --helpContributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Commit your changes:
git commit -m "Add feature" - Push to your branch:
git push origin feature-name - Create a Pull Request
Available Buckets
Below are known DAL package buckets you can add to your configuration:
Official/Community Buckets
| Bucket | Description | Packages | Maintainer |
|--------|-------------|----------|------------|
| douxxtech/dal-bucket | Example bucket with common shell utilities | Various | @douxxtech |
Adding More Buckets
If you know of other DAL-compatible buckets or have created your own, please:
- Open an issue or pull request to add it to this list
- Ensure the bucket follows the package structure guidelines
- Include a brief description and package count
To test a bucket before adding it to this list:
dal bucket add username/repository-name
dal searchNote: This is an open-source project. Feel free to contribute by creating your own packages, reporting issues, or improving the codebase!
License
Licensed under NSDv1.0
Support
- 🐛 Bug Reports: Create an issue
- 💡 Feature Requests: Create an issue
