DX CLI is a lightweight, extensible command-line interface designed to enhance the developer experience in software develpoment projects. It provides a standardized way to create, share, and execute common development tasks across your team and projects.
- Standardized Command Interface: Consistent command structure across all your projects
- Extensible Architecture: Easily add custom commands specific to your project
- Command Repository Support: Install commands from external Git repositories
- Global Command Access: Run commands from anywhere in your project
- Configuration File: Automatically install commands from specified repositories
- Self-updating: Keep your DX CLI installation up to date
While in the root folder of your codebase, run:
curl -fsSL https://raw.githubusercontent.com/dx-tooling/dxcli/refs/heads/main/dxify.sh | bash
Or download and run the script manually:
wget https://raw.githubusercontent.com/dx-tooling/dxcli/refs/heads/main/dxify.sh
chmod +x dxify.sh
./dxify.sh
After installation, you can run commands using the dx
command:
./dx <command>
To see available commands:
./dx
To use the dx
command from anywhere in your project, install it globally:
./dx .install-globally
This will install a wrapper script that allows you to run dx
from any directory within your project.
Create custom commands by adding shell scripts to the .dxcli/subcommands
directory:
-
Copy the example script:
cp .dxcli/subcommands/_example.sh .dxcli/subcommands/your-command.sh
-
Edit the script and update the metadata section:
#@metadata-start #@name your-command #@description Description of what your command does #@metadata-end
-
Make your script executable:
chmod +x .dxcli/subcommands/your-command.sh
Install commands from external Git repositories:
./dx .install-commands <git-repository-url>
Create a .dxclirc
file in your project root to automatically install commands from specified repositories:
[install-commands]
https://github.com/your-org/your-commands-repo.git
git@github.com:your-org/another-commands-repo.git
You can create this file in your codebase prior to the initial dxcli project installation, and it will automatically be honored when dxcli is set up.
If this file exists in your project codebase and contains [install-commands]
URLs, you can simply run dx .install-commands
(without a URL) to install/update subcommands from these URLs.
Update your DX CLI installation to the latest version:
./dx .update
DX CLI has two types of commands:
- Subcommands: Regular commands for project tasks
- Metacommands: System commands that manage DX CLI itself (prefixed with a dot)
- Create commands for repetitive tasks in your development workflow
- Share common commands across your team via Git repositories
- Use descriptive names and helpful descriptions for your commands
- Keep commands focused on a single responsibility
- Document command usage in the script itself
Contributions are welcome! Feel free to submit pull requests or open issues on GitHub.