{"id":48111534,"url":"https://github.com/ddtcorex/warden-custom-commands","last_synced_at":"2026-04-04T16:07:52.905Z","repository":{"id":177227022,"uuid":"613071487","full_name":"ddtcorex/warden-custom-commands","owner":"ddtcorex","description":"Custom commands that extend Warden's functionality for multiple framework types.","archived":false,"fork":false,"pushed_at":"2026-03-31T12:55:00.000Z","size":659,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-31T14:44:57.324Z","etag":null,"topics":["docker","laravel","magento","magento2","php","symfony","warden","wordpress"],"latest_commit_sha":null,"homepage":"https://docs.warden.dev/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddtcorex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2023-03-12T19:51:09.000Z","updated_at":"2026-03-31T12:55:03.000Z","dependencies_parsed_at":"2024-11-29T04:35:12.409Z","dependency_job_id":null,"html_url":"https://github.com/ddtcorex/warden-custom-commands","commit_stats":null,"previous_names":["kaido92/magento2-den-commands","kaido92/magento2-warden-commands","kaido92/warden-custom-commands","ddtcorex/warden-custom-commands"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/ddtcorex/warden-custom-commands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddtcorex%2Fwarden-custom-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddtcorex%2Fwarden-custom-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddtcorex%2Fwarden-custom-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddtcorex%2Fwarden-custom-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddtcorex","download_url":"https://codeload.github.com/ddtcorex/warden-custom-commands/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddtcorex%2Fwarden-custom-commands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31405488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","laravel","magento","magento2","php","symfony","warden","wordpress"],"created_at":"2026-04-04T16:07:52.809Z","updated_at":"2026-04-04T16:07:52.883Z","avatar_url":"https://github.com/ddtcorex.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Warden Custom Commands\n\nCustom commands that extend Warden's functionality for multiple framework types.\n\n## Installation\n\n### Prerequisites\n\n1. **Docker Desktop** or **Docker Engine**\n   - [Docker Desktop for Mac](https://hub.docker.com/editions/community/docker-ce-desktop-mac) 2.2.0.0 or later\n   - [Docker for Linux](https://docs.docker.com/install/) (tested on Fedora 29 and Ubuntu 18.10)\n   - [Docker for Windows](https://docs.docker.com/desktop/windows/install/)\n\n   **Important:** Docker Desktop should have at least **6GB RAM** allocated (Preferences → Resources → Advanced → Memory)\n\n2. **docker-compose** version 2 or later\n\n   ```bash\n   # Verify docker-compose is installed\n   docker-compose --version\n   ```\n\n### Install Warden\n\n### Option 1: Manual Installation (Recommended)\n\n```bash\nsudo mkdir /opt/warden\nsudo chown $(whoami) /opt/warden\ngit clone -b main https://github.com/wardenenv/warden.git /opt/warden\necho 'export PATH=\"/opt/warden/bin:$PATH\"' \u003e\u003e ~/.bashrc\nPATH=\"/opt/warden/bin:$PATH\"\nwarden svc up\n```\n\n### Option 2: Via Homebrew\n\n```bash\nbrew install wardenenv/warden/warden\nwarden svc up\n```\n\n**For zsh users:**\n\n```bash\necho 'export PATH=\"/opt/warden/bin:$PATH\"' \u003e\u003e ~/.zshrc\nsource ~/.zshrc\n```\n\n### DNS Resolver Configuration (Linux)\n\nIf you are running on Linux (Ubuntu, Fedora, etc.), you must configure `systemd-resolved` to work with Warden's DNS resolver.\n\n1. Create a configuration directory for `systemd-resolved`:\n\n   ```bash\n   sudo mkdir -p /etc/systemd/resolved.conf.d\n   ```\n\n2. Create the Warden configuration file:\n\n   ```bash\n   sudo tee /etc/systemd/resolved.conf.d/warden.conf \u003c\u003cEOF\n   [Resolve]\n   DNS=127.0.0.1\n   Domains=~test\n   EOF\n   ```\n\n3. Restart the service:\n\n   ```bash\n   sudo systemctl restart systemd-resolved\n   ```\n\nFor more details, see [Warden Docs: Systemd Resolved](https://docs.warden.dev/configuration/dns-resolver.html#systemd-resolved).\n\n### Install Custom Commands\n\n```bash\n# Clone this repository to ~/.warden/commands\ngit clone https://github.com/ddtcorex/warden-custom-commands.git ~/.warden/commands\n\n# Make commands executable\nchmod +x ~/.warden/commands/*.cmd\nchmod +x ~/.warden/commands/env-adapters/*/*.cmd\n```\n\n\u003e [!TIP] \u003e **Development Workflow:** If you are contributing or modifying these commands, it is recommended to symlink your development directory to `~/.warden/commands`:\n\u003e\n\u003e ```bash\n\u003e ln -s ~/path/to/your/repo ~/.warden/commands\n\u003e ```\n\nCommands will be automatically available via `warden \u003ccommand\u003e`.\n\n### SSH Key Setup (Local → Remote Server)\n\nIf you plan to use remote operations (cloning sites, syncing media/files, downloading databases), set up SSH keys for passwordless authentication.\n\n#### 1) Generate an SSH key on your local machine\n\n```bash\n# Use ed25519 (recommended) or RSA\nssh-keygen -t ed25519 -C \"your_email@example.com\"\n\n# Or for RSA (wider compatibility)\nssh-keygen -t rsa -b 4096 -C \"your_email@example.com\"\n```\n\n#### 2) Start the SSH agent and add your key\n\n```bash\neval \"$(ssh-agent -s)\"\nssh-add ~/.ssh/id_ed25519   # or ~/.ssh/id_rsa\n```\n\n#### 3) Add your public key to the remote server\n\n```bash\nssh-copy-id -p 22 user@your-server.com\n\n# Or manually:\ncat ~/.ssh/id_ed25519.pub | ssh user@server 'cat \u003e\u003e ~/.ssh/authorized_keys'\n```\n\n#### 4) Test SSH login\n\n```bash\nssh -p 22 user@your-server.com\n```\n\n#### 5) Optional: Simplify with `~/.ssh/config`\n\n```ssh-config\nHost staging\n    HostName staging.example.com\n    User deploy\n    Port 22\n    IdentityFile ~/.ssh/id_ed25519\n```\n\nThen connect with just `ssh staging`.\n\n#### Troubleshooting\n\n- **Permission denied**: Ensure `~/.ssh` is `700` and `authorized_keys` is `600` on remote\n- **Agent not running**: Add `eval \"$(ssh-agent -s)\" \u0026\u0026 ssh-add` to your `.bashrc`/`.zshrc`\n- **Host key verification**: Commands now include `-o StrictHostKeyChecking=no` to skip prompts\n\n## Architecture\n\n### Dispatcher Pattern\n\nCommands use a **dispatcher pattern** where root commands delegate to environment-specific implementations:\n\n```text\ncommands/\n├── bootstrap.cmd          # Dispatcher → env-adapters/{type}/bootstrap.cmd\n├── db-dump.cmd            # Dispatcher → env-adapters/{type}/db-dump.cmd\n├── db-import.cmd          # Dispatcher → env-adapters/{type}/db-import.cmd\n├── deploy.cmd             # Dispatcher → env-adapters/{type}/deploy.cmd\n├── env-sync.cmd           # Dispatcher → env-adapters/{type}/env-sync.cmd\n├── fix-deps.cmd           # Dispatcher → env-adapters/{type}/fix-deps.cmd\n├── open.cmd               # Dispatcher → env-adapters/{type}/open.cmd\n├── set-config.cmd         # Dispatcher → env-adapters/{type}/set-config.cmd\n├── upgrade.cmd            # Dispatcher → env-adapters/{type}/upgrade.cmd\n│\n├── env-variables          # Global environment loader\n├── remote-exec.cmd        # Global command\n├── self-update.cmd        # Global command\n├── setup-remotes.cmd      # Global command\n│\n└── env-adapters/          # Environment-specific implementations\n    ├── magento2/\n    │   ├── bootstrap.cmd\n    │   ├── bootstrap.help\n    │   ├── db-dump.cmd\n    │   ├── db-dump.help\n    │   ├── db-import.cmd\n    │   ├── db-import.help\n    │   ├── deploy.cmd\n    │   ├── deploy.help\n    │   ├── env-sync.cmd\n    │   ├── fix-deps.cmd\n    │   ├── fix-deps.help\n    │   ├── magento-versions.json\n    │   ├── open.cmd\n    │   ├── open.help\n    │   ├── set-config.cmd\n    │   ├── set-config.help\n    │   ├── upgrade.cmd\n    │   └── upgrade.help\n    │\n    ├── laravel/\n    │   ├── bootstrap.cmd\n    │   ├── db-dump.cmd\n    │   ├── db-dump.help\n    │   ├── db-import.cmd\n    │   ├── env-sync.cmd\n    │   ├── fix-deps.cmd\n    │   ├── fix-deps.help\n    │   ├── open.cmd\n    │   ├── open.help\n    │   ├── set-config.cmd\n    │   ├── upgrade.cmd\n    │   └── upgrade.help\n    │\n    ├── symfony/\n    │   ├── bootstrap.cmd\n    │   ├── db-dump.cmd\n    │   ├── db-dump.help\n    │   ├── db-import.cmd\n    │   ├── env-sync.cmd\n    │   ├── fix-deps.cmd\n    │   ├── fix-deps.help\n    │   ├── open.cmd\n    │   ├── open.help\n    │   ├── set-config.cmd\n    │   ├── upgrade.cmd\n    │   └── upgrade.help\n    │\n    └── wordpress/\n        ├── bootstrap.cmd\n        ├── db-dump.cmd\n        ├── db-dump.help\n        ├── db-import.cmd\n        ├── env-sync.cmd\n        ├── fix-deps.cmd\n        ├── fix-deps.help\n        ├── open.cmd\n        ├── open.help\n        ├── set-config.cmd\n        ├── upgrade.cmd\n        └── upgrade.help\n```\n\n### How It Works\n\n1. You run: `warden bootstrap`\n2. Warden calls: `~/.warden/commands/bootstrap.cmd` (dispatcher)\n3. Dispatcher reads `WARDEN_ENV_TYPE` from `.env`\n4. Dispatcher sources the appropriate implementation:\n   - `env-adapters/magento2/bootstrap.cmd` for Magento 2\n   - `env-adapters/laravel/bootstrap.cmd` for Laravel\n   - etc.\n\n## Commands Reference\n\n### Global Options\n\nMost commands support the following global flags:\n\n- `-v`, `--verbose`: Enable verbose output (detailed logs).\n- `-vv`: Enable debug mode (prints shell commands during execution).\n\n### Common Commands\n\n#### `warden env-sync`\n\nThe unified synchronization command for files, media, and databases.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-s, -e, --source, --environment`: Source environment (default: `staging`)\n- `-d, --destination`: Destination environment (default: `local`)\n- `-f, --file`: Sync source code/files\n- `-m, --media`: Sync media files\n- `--db`: Sync database (streaming, no local dump file created)\n- `-N, --no-noise`: Skip noise tables from DB sync (logs, cache, search indexes)\n- `-S, --no-pii`: Exclude PII/GDPR sensitive tables (Customers, Orders, etc.)\n- `--full`: Full Sync (Shortcut for `--file --media --db`)\n- `-p, --path`: Sync a specific directory or file path\n- `--include-product`: Include product/cache images in media sync (Magento 2 only)\n- `--dry-run`: Show what would happen without making changes\n- `--redeploy`: Redeploy destination after sync using `deploy.cmd` (default: disabled)\n- `--delete`: Delete files on destination that are not present in source (rsync only)\n- `--backup`: Create a backup of the destination database before syncing (if DB is synced)\n- `--backup-dir=PATH`: Path to store backups (default: `~/backup` on destination)\n- `-y, --yes`: Non-interactive mode\n\n**Examples:**\n\n1. **Sync Database (Remote to Local)**\n\n   ```bash\n   # Pull database from staging (default) to local\n   warden env-sync --db\n\n   # Pull database from prod to local\n   warden env-sync -s prod --db\n   ```\n\n2. **Sync Media (Remote to Local)**\n\n   ```bash\n   # Pull media files from staging to local\n   warden env-sync --media\n\n   # Delete local files that are missing on remote (mirroring)\n   warden env-sync --media --delete\n   ```\n\n3. **Sync Files/Code (Local to Remote)**\n\n   ```bash\n   # Push local changes to dev environment\n   warden env-sync -d dev --file\n\n   # Push a specific file\n   warden env-sync -d dev -p app/etc/config.php\n   ```\n\n4. **Sync Specific Path (Remote to Remote)**\n\n   ```bash\n   # Sync a specific log folder from prod to staging\n   warden env-sync -s prod -d staging -p var/log/\n   ```\n\n5. **Full Synchronization**\n\n   ```bash\n   # Sync everything: DB, Media, Files (all tables included by default)\n   warden env-sync --full\n\n   # Sync DB, skipping noise tables (logs/cache/search indexes)\n   warden env-sync --db -N\n\n   # Sync DB, skipping both noise tables and PII/sensitive data\n   warden env-sync --db -N -S\n   ```\n\n6. **Dry Run**\n\n   ```bash\n   # See what would happen without actually syncing\n   warden env-sync --media --delete --dry-run\n   ```\n\n\u003e [!IMPORTANT]\n\u003e Operations to remote environments (where neither source nor destination is `local`) use **SSH Agent Forwarding**.\n\u003e\n\u003e - The local machine connects to the Source.\n\u003e - The Source connects to the Destination using **your local keys**.\n\u003e - **Requirement:** You must have your SSH keys loaded locally (`ssh-add -l`). If empty, run `ssh-add`.\n\n### Magento 2 Commands\n\n#### Magento 2: `warden bootstrap`\n\nInitialize a new Magento 2 environment with all dependencies and configuration.\n\n**Clone Options:**\n\n- `-c, --clone` - Clone project from remote (source + DB + media)\n- `--code-only` - With --clone: skip DB and media sync\n\n**Install Options:**\n\n- `--fresh` - Create fresh Magento project (aliases: `--clean-install`, `--fresh-install`)\n- `--version, --meta-version=\u003cversion\u003e` - Magento version for fresh install (e.g., 2.4.8)\n- `--meta-package=\u003cpackage\u003e` - Magento package name (default: `magento/project-community-edition`)\n- `--mage-username=\u003cusername\u003e` - Magento Marketplace Public Key\n- `--mage-password=\u003cpassword\u003e` - Magento Marketplace Private Key\n- `--include-sample` - Include sample data (fresh install/bootstrap)\n- `--hyva-install` - Install Hyvä theme (fresh install)\n\n**Skip Options:**\n\n- `--no-db` - Skip database import\n- `--no-media` - Skip media sync from remote\n- `--no-composer` - Skip composer install\n- `--no-admin` - Skip admin user creation\n- `--no-stream-db` - Use intermediate dump file instead of streaming\n- `--no-noise` - Exclude noise tables (logs/cache/indexes) in DB sync during clone\n- `--no-pii` - Exclude PII/sensitive data from DB sync during clone\n\n**Other Options:**\n\n- `-e, --environment=\u003cenv\u003e` - Source environment (staging, prod, dev). Default: staging\n- `--db-dump=\u003cfile\u003e` - Use specific local database dump file for import\n- `--fix-deps` - Auto-fix dependency versions (PHP, Redis, etc.) based on Magento version\n- `-y, --yes` - Non-interactive mode\n\n**Example:**\n\n```bash\n# Standard bootstrap from staging\nwarden bootstrap\n\n# Clone project from prod (one-command setup)\nwarden bootstrap -c -e prod\n\n# Clone code only, skip DB and media\nwarden bootstrap -c --code-only -e staging\n\n# Fresh Magento installation\nwarden bootstrap --fresh --version=2.4.8\n```\n\n#### Magento 2: `warden db-dump`\n\nCreate a database backup with optional compression.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-f, --file=\u003cfile\u003e` - Output file path\n- `-e, --environment=\u003cenv\u003e` - Specific environment (local, dev, staging, prod). Default: local\n- `-N, --no-noise` - Exclude noise tables from dump (logs/cache/indexes)\n- `-S, --no-pii` - Exclude sensitive data (customers, orders, etc.)\n- `--local` - Download the dump to your local machine (host) instead of storing it on the remote server.\n  (Applies only when dumping from remote environments; default behavior for remote is to store at `~/backup/` on the server).\n\n**Example:**\n\n```bash\nwarden db-dump                       # Dump all tables (default)\nwarden db-dump -N -e prod            # Dump from prod, skip noise tables\nwarden db-dump -N -S                 # Skip noise + PII data\n```\n\n#### Magento 2: `warden db-import`\n\nImport database from local or remote file.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-f, --file=\u003cfile\u003e` - Path to existing database dump file (can be gzipped)\n- `--stream-db` - Stream database directly from remote environment (no local file)\n- `-e, --environment=\u003cenv\u003e` - Remote environment to stream from (used with `--stream-db`)\n\n**Example:**\n\n```bash\nwarden db-import --file=backup.sql.gz\nwarden db-import -f /path/to/database.sql\n```\n\n#### Magento 2: `warden deploy`\n\nDeploy Magento application (run setup:upgrade, compile, deploy).\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Environment to deploy to. Default: local\n- `-j, --jobs=\u003cn\u003e` - Number of parallel jobs for static content (default: 4)\n- `-o, --only-static` - Deploy static content only (skip composer, upgrade, compile)\n- `--deployer` - Use Deployer strategy (equivalent to `--strategy=deployer`)\n- `--strategy=\u003ctype\u003e` - Deployment strategy: `native` (default) or `deployer`\n- `--deployer-config=\u003cpath\u003e` - Path to custom `deploy.php` or `deploy.yaml`\n\n**Example:**\n\n```bash\nwarden deploy\nwarden deploy --jobs=8\nwarden deploy --only-static\n\n# Deployer Strategy\nwarden deploy --deployer\nwarden deploy -e staging --strategy=deployer\nwarden deploy --deployer-config=custom/deploy.php\n```\n\n#### Deployer Strategy\n\nYou can use [Deployer](https://deployer.org/) to handle deployments by passing the `--deployer` flag or using `--strategy=deployer`.\n\n- **Automatic Detection:** Warden looks for `deploy.php` or `deploy.yaml`.\n- **Global Installation:** If `dep` is not in your project, Warden installs it globally within the container.\n- **SSH Config:** Host key verification is automatically handled.\n- **Environment Matching:** The `-e` environment name (e.g., `staging`) is passed directly to Deployer as the stage name.\n\n#### Magento 2: `warden open`\n\nOpen Magento services in browser or establish tunnels.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Specific environment (local, dev, staging, prod). Default: local\n\n**Arguments:**\n\n- `db` - Open database connection (tunnels to remote if environment specified)\n- `shell` - Open container shell (or SSH to remote)\n- `sftp` - Open SFTP connection\n- `admin` - Open admin panel in browser\n- `elasticsearch` - Open Elasticsearch/OpenSearch\n\n**Other Options:**\n\n- `-a, --xdg-open` - Automatically open in browser/client\n\n**Example:**\n\n```bash\nwarden open\nwarden open admin\nwarden open -e staging\n```\n\n#### Magento 2: `warden set-config`\n\nAutomatically configure Magento settings to optimize for the Warden development environment.\n\n**Features:**\n\n- Sets base URLs to match Traefik configuration.\n- Configures Varnish, Redis, and OpenSearch/Elasticsearch based on `.env` settings.\n- Disables security features for easier development (2FA, reCAPTCHA, etc.).\n- Enables developer mode.\n- Supports custom hooks via `.warden/hooks`.\n\n**Example:**\n\n```bash\nwarden set-config\n```\n\n#### Magento 2: `warden upgrade`\n\nUpgrade Magento to a specified version.\n\n**Options:**\n\n- `--version=\u003cversion\u003e` - Target version to upgrade to (required)\n- `--dry-run` - Show what would be done without making changes\n- `--skip-db-upgrade` - Skip database upgrade step\n- `--skip-env-update` - Skip environment dependency updates (automatic `fix-deps`)\n\n**Example:**\n\n```bash\nwarden upgrade --version=2.4.8\nwarden upgrade --version=2.4.8 --dry-run\nwarden upgrade --version=2.4.8-p3 --skip-db-upgrade\n```\n\n#### Magento 2: `warden fix-deps`\n\nAutomatically detect and update environment dependency versions (PHP, MySQL, Redis, etc.) in `.env` based on the Magento version.\n\n**Options:**\n\n- `-v, --version=VERSION` - Specify Magento version manually (e.g., 2.4.8)\n- `--dry-run` - Preview changes without modifying `.env`\n\n**Example:**\n\n```bash\nwarden fix-deps --version=2.4.8\nwarden fix-deps --dry-run\n```\n\n### Magento 1 Commands\n\n#### Magento 1: `warden bootstrap`\n\nInitialize a new Magento 1 / OpenMage environment.\n\n**Options:**\n\n- `-c, --clone` - Clone project from remote (source + DB + media)\n- `--code-only` - With --clone: skip DB and media sync\n- `--fresh` - Create fresh M1/OpenMage project\n- `--no-db`, `--no-media`, `--no-composer` - Skip specific steps\n- `--no-noise` - Exclude noise tables (logs/cache/indexes) in DB sync during clone\n- `--no-pii` - Exclude PII/sensitive data from DB sync during clone\n\n**Example:**\n\n```bash\nwarden bootstrap -c -e staging\n```\n\n#### Magento 1: `warden env-sync`\n\nStandardized synchronization for M1. Supports `--db`, `--media`, `--no-noise`, etc.\n\n#### Magento 1: `warden db-dump` / `db-import`\n\nStandardized database operations for M1 with support for `--no-noise` and `--no-pii`.\n\n#### Magento 1: `warden upgrade` / `deploy` / `open`\n\nUtility commands adapted for Magento 1 architecture.\n\n### Laravel Commands\n\n#### Laravel: `warden bootstrap`\n\nInitialize Laravel environment with dependencies and database.\n\n**Clone Options:**\n\n- `-c, --clone` - Clone project from remote (source + DB)\n- `--code-only` - With --clone: skip DB sync\n\n**Install Options:**\n\n- `--fresh` - Create fresh Laravel project\n- `--fix-deps` - Auto-fix dependency versions\n\n**Skip Options:**\n\n- `--no-db` - Skip database import\n- `--no-composer` - Skip composer install\n- `--no-migrate` - Skip database migrations\n- `--no-stream-db` - Use intermediate dump file instead of streaming\n- `--no-noise` - Exclude noise tables (logs/cache/indexes) in DB sync during clone\n- `--no-pii` - Exclude PII/sensitive data from DB sync during clone\n\n**Other Options:**\n\n- `-e, --environment=\u003cenv\u003e` - Source environment (staging, prod, dev). Default: staging\n- `--db-dump=\u003cfile\u003e` - Use specific local database dump file for import\n- `-y, --yes` - Non-interactive mode\n\n**Example:**\n\n```bash\nwarden bootstrap                    # Standard bootstrap\nwarden bootstrap -c -e prod         # Clone from prod\nwarden bootstrap --fresh            # Create new Laravel project\n```\n\n#### Laravel: `warden db-dump`\n\nDump database from a remote Laravel environment.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Specific environment (local, dev, staging, prod). Default: local\n- `-f, --file=\u003cfile\u003e` - Output file path\n- `-N, --no-noise` - Skip noise tables (logs, cache, indexes)\n- `-S, --no-pii` - Exclude sensitive data from the dump\n- `--local` - Download remote dump to local machine (default: store on remote at `~/backup/`)\n\n**Example:**\n\n```bash\nwarden db-dump -e dev --local\nwarden db-dump --file=prod-backup.sql.gz -e prod\n```\n\n#### Laravel: `warden db-import`\n\nImport database dump into Laravel project.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-f, --file=\u003cfile\u003e` - Path to existing database dump file (can be gzipped)\n- `--stream-db` - Stream database directly from remote environment (no local file)\n- `-e, --environment=\u003cenv\u003e` - Remote environment to stream from (used with `--stream-db`)\n\n**Example:**\n\n```bash\nwarden db-import --file=backup.sql.gz\nwarden db-import --stream-db -e staging\n```\n\n#### Laravel: `warden open`\n\nOpen Laravel services (local or remote).\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Specific environment (local, dev, staging, prod). Default: local\n- `-a, --xdg-open` - Automatically open in browser/client\n\n**Arguments:** `db`, `shell`, `sftp`, `admin`, `elasticsearch`\n\n**Example:**\n\n```bash\nwarden open db\nwarden open -e staging shell\n```\n\n#### Laravel: `warden set-config`\n\nUpdate Laravel `.env` configuration with Warden-specific settings.\n\n**Example:**\n\n```bash\nwarden set-config\n```\n\n#### Laravel: `warden deploy`\n\nDeploy Laravel locally. Supports native strategy and Deployer.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Environment to deploy to. Default: local\n- `-o, --only-static` - Deploy static assets only (storage:link) and run hooks\n- `--deployer` - Use Deployer strategy (equivalent to `--strategy=deployer`)\n- `--strategy=\u003ctype\u003e` - Deployment strategy: `native` (default) or `deployer`\n- `--deployer-config=\u003cpath\u003e` - Path to custom `deploy.php` or `deploy.yaml`\n\n**Example:**\n\n```bash\nwarden deploy\nwarden deploy --deployer\n```\n\n#### Laravel: `warden upgrade`\n\nUpgrade Laravel framework to a specified version.\n\n**Options:**\n\n- `--version=\u003cversion\u003e` - Target version to upgrade to (required)\n- `--dry-run` - Show what would be done without making changes\n\n**Example:**\n\n```bash\nwarden upgrade --version=11.0\nwarden upgrade --version=10.x --dry-run\n```\n\n### Symfony Commands\n\n#### Symfony: `warden bootstrap`\n\nInitialize Symfony environment with dependencies and database.\n\n**Clone Options:**\n\n- `-c, --clone` - Clone project from remote (source + DB)\n- `--code-only` - With --clone: skip DB sync\n\n**Install Options:**\n\n- `--fresh` - Create fresh Symfony project\n- `--fix-deps` - Auto-fix dependency versions\n\n**Skip Options:**\n\n- `--no-db` - Skip database import\n- `--no-composer` - Skip composer install\n- `--no-migrate` - Skip database migrations\n- `--no-stream-db` - Use intermediate dump file instead of streaming\n- `--no-noise` - Exclude noise tables (logs/cache/indexes) in DB sync during clone\n- `--no-pii` - Exclude PII/sensitive data from DB sync during clone\n\n**Other Options:**\n\n- `-e, --environment=\u003cenv\u003e` - Source environment (staging, prod, dev). Default: staging\n- `--db-dump=\u003cfile\u003e` - Use specific local database dump file for import\n- `-y, --yes` - Non-interactive mode\n\n**Example:**\n\n```bash\nwarden bootstrap                    # Standard bootstrap\nwarden bootstrap -c -e prod         # Clone from prod\nwarden bootstrap --fresh            # Create new Symfony project\n```\n\n#### Symfony: `warden db-dump`\n\nDump database from a remote Symfony environment.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Specific environment (local, dev, staging, prod). Default: local\n- `-f, --file=\u003cfile\u003e` - Output file path\n- `-N, --no-noise` - Skip noise tables (logs, cache, indexes)\n- `-S, --no-pii` - Exclude sensitive data from the dump\n- `--local` - Download remote dump to local machine (default: store on remote at `~/backup/`)\n\n**Example:**\n\n```bash\nwarden db-dump -e dev --local\nwarden db-dump --file=prod-backup.sql.gz -e prod\n```\n\n#### Symfony: `warden db-import`\n\nImport database dump into Symfony project.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-f, --file=\u003cfile\u003e` - Path to existing database dump file (can be gzipped)\n- `--stream-db` - Stream database directly from remote environment (no local file)\n- `-e, --environment=\u003cenv\u003e` - Remote environment to stream from (used with `--stream-db`)\n\n**Example:**\n\n```bash\nwarden db-import --file=backup.sql.gz\nwarden db-import --stream-db -e staging\n```\n\n#### Symfony: `warden open`\n\nOpen Symfony services (local or remote).\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Specific environment (local, dev, staging, prod). Default: local\n- `-a, --xdg-open` - Automatically open in browser/client\n\n**Arguments:** `db`, `shell`, `sftp`, `admin`, `elasticsearch`\n\n**Example:**\n\n```bash\nwarden open db\nwarden open -e staging shell\n```\n\n#### Symfony: `warden set-config`\n\nUpdate Symfony configuration for Warden environment.\n\n**Example:**\n\n```bash\nwarden set-config\n```\n\n#### Symfony: `warden deploy`\n\nDeploy Symfony locally. Supports native strategy and Deployer.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Environment to deploy to. Default: local\n- `-o, --only-static` - Deploy assets only (skip composer, migrations)\n- `--deployer` - Use Deployer strategy (equivalent to `--strategy=deployer`)\n- `--strategy=\u003ctype\u003e` - Deployment strategy: `native` (default) or `deployer`\n- `--deployer-config=\u003cpath\u003e` - Path to custom `deploy.php` or `deploy.yaml`\n\n**Example:**\n\n```bash\nwarden deploy\nwarden deploy --deployer\n```\n\n#### Symfony: `warden upgrade`\n\nUpgrade Symfony framework to a specified version.\n\n**Options:**\n\n- `--version=\u003cversion\u003e` - Target version to upgrade to (required)\n- `--dry-run` - Show what would be done without making changes\n\n**Example:**\n\n```bash\nwarden upgrade --version=7.0\nwarden upgrade --version=6.4 --dry-run\n```\n\n### WordPress Commands\n\n#### WordPress: `warden bootstrap`\n\nInitialize WordPress environment with complete installation.\n\n**Clone Options:**\n\n- `-c, --clone` - Clone project from remote (source + DB)\n- `--code-only` - With --clone: skip DB sync\n\n**Install Options:**\n\n- `--fresh` - Download fresh WordPress installation\n- `--fix-deps` - Auto-fix dependency versions\n\n**Skip Options:**\n\n- `--no-db` - Skip database import\n- `--no-composer` - Skip composer install\n- `--no-wp-install` - Skip WordPress installation wizard\n- `--no-stream-db` - Use intermediate dump file instead of streaming\n- `--no-noise` - Exclude noise tables (logs/cache/indexes) in DB sync during clone\n- `--no-pii` - Exclude PII/sensitive data from DB sync during clone\n\n**Other Options:**\n\n- `-e, --environment=\u003cenv\u003e` - Source environment (staging, prod, dev). Default: staging\n- `--db-dump=\u003cfile\u003e` - Use specific local database dump file for import\n- `-y, --yes` - Non-interactive mode\n\n**Example:**\n\n```bash\nwarden bootstrap                    # Standard bootstrap\nwarden bootstrap -c -e prod         # Clone from prod\nwarden bootstrap --fresh            # Download fresh WordPress\n```\n\n**Note:** With `--fresh`, WordPress will be downloaded, wp-config.php created, and the site installed with admin credentials displayed.\n\n#### WordPress: `warden db-dump`\n\nDump database from a remote WordPress environment.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Specific environment (local, dev, staging, prod). Default: local\n- `-f, --file=\u003cfile\u003e` - Output file path\n- `-N, --no-noise` - Skip noise tables (logs, cache, indexes)\n- `-S, --no-pii` - Exclude sensitive data from the dump\n- `--local` - Download remote dump to local machine (default: store on remote at `~/backup/`)\n\n**Example:**\n\n```bash\nwarden db-dump -e dev --local\nwarden db-dump --file=prod-backup.sql.gz -e prod\n```\n\n#### WordPress: `warden db-import`\n\nImport database dump into WordPress.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-f, --file=\u003cfile\u003e` - Path to existing database dump file (can be gzipped)\n- `--stream-db` - Stream database directly from remote environment (no local file)\n- `-e, --environment=\u003cenv\u003e` - Remote environment to stream from (used with `--stream-db`)\n\n**Example:**\n\n```bash\nwarden db-import --file=backup.sql.gz\nwarden db-import --stream-db -e staging\n```\n\n**Note:** After import, use WP-CLI to search-replace URLs if needed:\n\n```bash\nwarden env exec php-fpm wp search-replace 'old-domain.com' 'app.test.test'\n```\n\n#### WordPress: `warden open`\n\nOpen WordPress services (local or remote).\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Specific environment (local, dev, staging, prod). Default: local\n- `-a, --xdg-open` - Automatically open in browser/client\n\n**Arguments:** `db`, `shell`, `sftp`, `admin`, `elasticsearch`\n\n**Example:**\n\n```bash\nwarden open db\nwarden open -e staging admin\n```\n\n#### WordPress: `warden deploy`\n\nDeploy WordPress locally. Supports native strategy and Deployer.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment=\u003cenv\u003e` - Environment to deploy to. Default: local\n- `-o, --only-static` - Deploy static assets only (flush cache) and run hooks\n- `--deployer` - Use Deployer strategy (equivalent to `--strategy=deployer`)\n- `--strategy=\u003ctype\u003e` - Deployment strategy: `native` (default) or `deployer`\n- `--deployer-config=\u003cpath\u003e` - Path to custom `deploy.php` or `deploy.yaml`\n\n**Example:**\n\n```bash\nwarden deploy\nwarden deploy --deployer\n```\n\n#### WordPress: `warden set-config`\n\nUpdate WordPress configuration for Warden environment.\n\n**Example:**\n\n```bash\nwarden set-config\n```\n\n#### WordPress: `warden upgrade`\n\nUpgrade WordPress core to a specified version.\n\n**Options:**\n\n- `--version=\u003cversion\u003e` - Target version to upgrade to (required)\n- `--dry-run` - Show what would be done without making changes\n\n**Example:**\n\n```bash\nwarden upgrade --version=6.5\nwarden upgrade --version=6.4.3 --dry-run\n```\n\n### Global Commands\n\n#### `warden self-update`\n\nUpdate both **Warden Core** and these **Custom Commands** to the latest versions. It also applies necessary patches to Warden to ensure compatibility.\n\n**Options:**\n\n- `-f, --force`: Force update, overwriting local changes (uncommitted files).\n- `--dry-run`: Simulate the update process without making changes.\n\n**Example:**\n\n```bash\nwarden self-update\nwarden self-update --dry-run\nwarden self-update --force\n```\n\n#### `warden setup-remotes`\n\nInteractive wizard to configure remote environment connection details (Dev, Staging) in your `.env` file.\n\n**Features:**\n\n- Interactive prompts for Host, User, Port, and Path.\n- Auto-validation of SSH connectivity.\n- Updates/Creates `.env` entries safely.\n\n**Example:**\n\n```bash\nwarden setup-remotes\nwarden setup-remotes --help\n```\n\n#### `warden remote-exec`\n\nRun arbitrary commands on a remote environment via SSH.\n\n**Options:**\n\n- `-h, --help` - Display help menu\n- `-e, --environment` - Remote environment to execute on (default: `staging`)\n- `-v, --verbose` - Print the command execution details for debugging\n\n**Example:**\n\n```bash\n# Run command on staging (default)\nwarden remote-exec bin/magento cache:flush\n\n# Run command on prod\nwarden remote-exec -e prod bin/magento indexer:reindex\n```\n\n## Adding New Environment Support\n\nTo add support for a new framework (e.g., Drupal):\n\n1. **Create the directory:**\n\n   ```bash\n   mkdir -p ~/.warden/commands/env-adapters/symfony\n   ```\n\n2. **Create command files:**\n\n   ```bash\n   touch ~/.warden/commands/env-adapters/symfony/bootstrap.cmd\n   touch ~/.warden/commands/env-adapters/symfony/set-config.cmd\n   # ... other commands\n   ```\n\n3. **Implement the logic:**\n\n   ```bash\n   #!/usr/bin/env bash\n   # Don't include shebang - file will be sourced\n\n   :: Installing Symfony\n   warden env exec php-fpm composer install\n   # ... Symfony-specific logic\n   ```\n\n4. **Create help files (optional):**\n\n   ```bash\n   touch ~/.warden/commands/env-adapters/symfony/bootstrap.help\n   ```\n\n5. **Make executable:**\n\n   ```bash\n   chmod +x ~/.warden/commands/env-adapters/symfony/*.cmd\n   ```\n\nThe commands will automatically be available when `WARDEN_ENV_TYPE=symfony` is set in `.env`.\n\n## Configuration\n\nCustom commands read environment variables from the project's `.env` file:\n\n```bash\n# Required\nWARDEN_ENV_NAME=myproject\nWARDEN_ENV_TYPE=magento2   # or laravel, wordpress, symfony\n\n# Optional (framework-specific)\nTRAEFIK_DOMAIN=myproject.test\nTRAEFIK_SUBDOMAIN=app\n\n# Magento 2 specific\nPHP_VERSION=8.2\nCOMPOSER_VERSION=2\nMYSQL_DISTRIBUTION=mysql\nMYSQL_DISTRIBUTION_VERSION=8.0\n\n# Laravel specific\nDB_CONNECTION=mysql\nDB_HOST=db\nDB_DATABASE=laravel\nDB_USERNAME=laravel\nDB_PASSWORD=laravel\n```\n\n## Troubleshooting\n\n### Commands not found\n\n```bash\n# Ensure commands are executable\nchmod +x ~/.warden/commands/*.cmd\nchmod +x ~/.warden/commands/env-adapters/*/*.cmd\n```\n\n### Wrong environment commands loading\n\n```bash\n# Check .env file has correct WARDEN_ENV_TYPE\ncat .env | grep WARDEN_ENV_TYPE\n```\n\n### Permission issues\n\n```bash\n# Fix ownership\nchown -R $(whoami):$(whoami) ~/.warden/commands\n```\n\n## Testing\n\nThis project includes a comprehensive testing suite (Unit \u0026 Integration) based on Docker. It simulates multiple environments (`-local`, `-dev`, `-staging`) to verify the `warden` custom commands across different frameworks.\n\nDetailed instructions can be found in [tests/README.md](tests/README.md).\n\n### Quick Start\n\n```bash\n# Run all tests for Magento 2 (Unit + Integration)\n./tests/run-tests.sh magento2\n\n# Run only unit tests\n./tests/run-tests.sh magento2 --unit-only\n```\n\nThe runner will automatically:\n\n1. Detect container IPs for dynamic environments.\n2. Isolate the SSH environment to prevent conflicts with your host's ssh-agent.\n3. Distribute safe test keys between containers.\n4. Execute all test suites (files, media, db, custom paths, R2R, error handling).\n\n## Contributing\n\n1. Create a feature branch\n2. Make your changes\n3. Test with different environment types\n4. Submit a pull request\n\n## License\n\nGNU General Public License v3.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddtcorex%2Fwarden-custom-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddtcorex%2Fwarden-custom-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddtcorex%2Fwarden-custom-commands/lists"}