PHPackages                             gilads-otiannoh254/shipit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. gilads-otiannoh254/shipit

ActiveLibrary[CLI &amp; Console](/categories/cli)

gilads-otiannoh254/shipit
=========================

A professional, modular CLI tool for PHP deployments

v0.0.1(2mo ago)03PHPPHP &gt;=8.1

Since Mar 1Pushed 2mo agoCompare

[ Source](https://github.com/gilads-otiannoh24/shipit)[ Packagist](https://packagist.org/packages/gilads-otiannoh254/shipit)[ RSS](/packages/gilads-otiannoh254-shipit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

ShipIt
======

[](#shipit)

The missing bridge between Git and Shared Hosting/VPS.

ShipIt is a lightweight, zero-dependency PHP deployment orchestrator designed for developers who want professional CI/CD workflows (hooks, backups, rollbacks, and environment management) on servers managed by DirectAdmin, cPanel, or raw VPS.

Why use ShipIt?
---------------

[](#why-use-shipit)

Zero-Downtime Mentality: Automatic backups before every update.

Environment Protection: Never accidentally overwrite your .env or user-uploaded content again.

Framework Aware: Built-in adapters for CodeIgniter 4, Laravel, and React.

Permission Fixer: Automatically handles chown and chmod for webserver users.

Dead Simple: No Docker, no Kubernetes, no complex YAML—just PHP and Git.

Server Requirements
-------------------

[](#server-requirements)

ShipIt is designed to run natively on Linux-based environments (VPS, Dedicated, or Shared Hosting with SSH access like DirectAdmin / cPanel).

Your server must have:

- **PHP 8.1+** installed and accessible via CLI.
- **Git** installed and authenticated (e.g., SSH keys added so `git clone` can run without interactive password prompts).
- **Composer** and **NPM** installed (if your deployment hooks require them).
- **SSH / Terminal access** to run the deployment script.

Installation
------------

[](#installation)

### Project-Specific (Recommended)

[](#project-specific-recommended)

Install ShipIt via Composer in your project:

```
composer require gilads-otiannoh254/shipit
```

You can then run it via `vendor/bin/shipit`.

### Global Installation (For ease of use)

[](#global-installation-for-ease-of-use)

Install ShipIt globally to use it anywhere on your server:

```
composer global require gilads-otiannoh254/shipit
```

Ensure your global composer bin directory is in your `$PATH`. You can then simply run `shipit` in any project directory.

Configuration Management
------------------------

[](#configuration-management)

ShipIt supports hierarchical configuration: **Project Config** (`.deploy/config.json`) overrides **Global Config** (`~/.shipit/config.json`) which overrides **Defaults**.

Use the `config` command to manage settings easily:

```
# View current project config
shipit config

# Set a project-specific setting
shipit config user deploy_user

# Set a global default for all projects
shipit config --global user vps_admin
shipit config --global backup_path /var/backups/shipit
```

Running on a Server
-------------------

[](#running-on-a-server)

Navigate to your project root (where your `.deploy` folder lives) and run:

```
shipit
```

### Available Commands and Options

[](#available-commands-and-options)

- `shipit` - Run the full deployment sequence. (Automatically skips backup if the project is empty).
- `shipit rollback` - Clears the current project (preserving `.deploy` and `.git`), restores the last backup, and runs post-deployment tasks (composer, npm, etc.).
- `shipit config` - Manage project or global configuration.
- `shipit list` - Display all available deployment tasks.
- `shipit --dry-run` - Simulate the deployment/rollback process.
- `shipit --log` - Show detailed file copy operations.

### Setting up Auto-Deployments (Webhooks / Cron)

[](#setting-up-auto-deployments-webhooks--cron)

To trigger deployments automatically when you push to Git:

1. **Option 1: Using a webhook listener.** You can create a simple PHP script exposed publicly (e.g., `deploy.php`) that runs `shell_exec('cd /path/to/project && vendor/bin/shipit > deploy.log 2>&1');` when a payload is received from GitHub/GitLab. Make sure to secure this endpoint with a secret token!
2. **Option 2: Cron Job.** If you prefer periodic polling, set up a cron job on your server to run `vendor/bin/shipit` on a schedule. Because ShipIt checks if Git cloning is needed, however, a webhook is highly recommended for efficiency.

When you run `shipit`:

1. **Backup**: Your current directory is copied to your `backup_path`. If your project only contains `.deploy` or `.git` files, the backup is skipped (first-run optimization).
2. **Clone**: Your configured Git repository branch is cloned.
3. **Merge**: Files are copied over, excluding anything in `.deployignore` or standard ignores.
4. **Build**: Composer and NPM hooks run.
5. **Permissions**: Ownership and permissions are enforced.

Rollback Logic
--------------

[](#rollback-logic)

When you run `shipit rollback`:

1. **Clear**: The current project directory is cleared, but `.deploy` and `.git` are preserved to keep configuration and repository metadata.
2. **Restore**: The contents of the most recent backup are copied back into the project.
3. **Rebuild**: Post-deployment tasks like `composer install` and `npm build` are triggered to ensure the environment is fully functional.

The `.deployignore` File
------------------------

[](#the-deployignore-file)

By default, ShipIt already ignores common files during updates (e.g., `.env`, `vendor`, `node_modules`, `.git`, `public_html`).

If you have specific files or folders in your Git repository that should **not** be copied to your live server during a deployment, you can place a `.deployignore` file in any directory.

The syntax is similar to `.gitignore`. Each line represents a pattern to exclude:

```
# Ignore specific files
docker-compose.yml
phpunit.xml

# Ignore entire directories
tests/
dev-tools/

# Ignore files matching a pattern
*.log
*.sqlite

```

ShipIt traverses your folders and recursively applies any `.deployignore` files it finds during the update process. Use the `vendor/bin/shipit --dry-run` flag to safely verify that your ignore patterns are working correctly before doing a live deployment!

Security Best Practices
-----------------------

[](#security-best-practices)

- **Never expose `.deploy/` to the web:** Best practice is to keep your root directory (where `composer.json` and `.deploy` live) *above* your public document root (e.g. `/home/user/domains/domain.com/` while the web root is `/home/user/domains/domain.com/public_html`).
- **Protect Webhooks:** If you use a webhook PHP script to trigger deployments, secure the endpoint using a secret token verify from GitHub/GitLab. Do not leave the webhook URL easily guessable.
- **SSH Keys vs Passwords:** Always authenticate the server against the Git provider using Deploy Keys or SSH keys instead of hardcoding passwords or tokens in URLs.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance86

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

73d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a00939d7e5422a294a7b9b186f29116de3dca2d793453c8c58c0293bd2346b2?d=identicon)[gilads-otiannoh254](/maintainers/gilads-otiannoh254)

---

Top Contributors

[![gilads-otiannoh24](https://avatars.githubusercontent.com/u/180090128?v=4)](https://github.com/gilads-otiannoh24 "gilads-otiannoh24 (3 commits)")

### Embed Badge

![Health badge](/badges/gilads-otiannoh254-shipit/health.svg)

```
[![Health](https://phpackages.com/badges/gilads-otiannoh254-shipit/health.svg)](https://phpackages.com/packages/gilads-otiannoh254-shipit)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
