@pagopa/dx-cli
DX CLI
A CLI tool for managing DevEx (Developer Experience) guidelines and best practices 🚀
📖 Overview
The DX CLI is a command-line tool designed to help developers manage and validate their development setup according to PagoPA's DevEx guidelines. It provides automated checks and validations to ensure repositories follow the established best practices and conventions.
✨ Features
- Repository Validation: Verify repository setup against DevEx guidelines
- Monorepo Script Checking: Validate that required scripts are present in package.json
- Developer Experience Optimization: Ensure consistent development practices across projects
🚀 Installation
[!NOTE]
The CLI is currently only available locally and is not yet distributed through package managers.
From Source (Development)
git clone https://github.com/pagopa/dx.git
cd dx
yarn install
yarn build
node ./apps/cli/bin/index.js --help
🛠️ Usage
Available Commands
doctor
Verify the repository setup according to the DevEx guidelines.
dx doctor
This command will:
- Check if you're in a valid Git repository
- Validate that required monorepo scripts are present in package.json
- Check that the
turbo.json file exists
- Verify that the installed
turbo version meets the minimum requirements
Example output:
$ dx doctor
Checking monorepo scripts...
✅ Monorepo scripts are correctly set up
savemoney
Analyze Azure subscriptions to identify unused or underutilized resources that could be costing you money.
dx savemoney [options]
Options:
--config | -c | Path to a JSON configuration file. | N/A |
--format | -f | Report format (table, json, detailed-json). | table |
--days | -d | Metric analysis period in days. | 30 |
--location | -l | Preferred Azure location for resources. | italynorth |
--verbose | -v | Enable verbose mode with detailed logging for each resource analyzed. | false |
Example usage:
dx savemoney
dx savemoney --config config.json
dx savemoney --format json --verbose
dx savemoney --days 60 --location italynorth
Configuration file example (config.json):
{
"tenantId": "your-tenant-id",
"subscriptionIds": ["subscription-1", "subscription-2"],
"preferredLocation": "italynorth",
"timespanDays": 30
}
Analyzed Azure resources:
- Virtual Machines: Deallocated or stopped VMs, low CPU usage
- Managed Disks: Unattached disks
- Network Interfaces: Unattached NICs
- Public IP Addresses: Unassociated static IPs
- Storage Accounts: Low transaction counts
- App Service Plans: Empty plans or oversized tiers
- Private Endpoints: Unused or misconfigured endpoints
[!NOTE]
Currently only Azure is supported. Support for additional cloud providers (AWS) is planned for future releases.
Global Options
--version, -V: Display version number
--help, -h: Display help information
Made with ❤️ by the PagoPA DevEx Team