PHPackages                             adnen/php-crud-with-cli - 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. adnen/php-crud-with-cli

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

adnen/php-crud-with-cli
=======================

This is a simple PHP CLI application that performs basic CRUD (Create, Read, Update, Delete) operations on a user table in a MySQL database using PDO (PHP Data Objects). The script interacts with the database through a Command-Line Interface (CLI) and outputs results as JSON in the terminal.

00PHP

Since Nov 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/adnenre/php-crud-with-cli)[ Packagist](https://packagist.org/packages/adnen/php-crud-with-cli)[ RSS](/packages/adnen-php-crud-with-cli/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

PHP CRUD WITH CLI
=================

[](#php-crud-with-cli)

This is a simple PHP CLI application that performs basic CRUD (Create, Read, Update, Delete) operations on a user table in a MySQL database using PDO (PHP Data Objects). The script interacts with the database through a Command-Line Interface (CLI) and outputs results as JSON in the terminal.

Prerequisites
-------------

[](#prerequisites)

Before running the script, make sure you have the following:

- PHP (Version 7.4 or higher)
- Composer (for dependency management)
- MySQL or MariaDB database running
- A `.env` file configured with your database credentials

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

[](#installation)

### Step 1: Clone the Repository

[](#step-1-clone-the-repository)

Clone this repository to your local machine:

```
git clone https://github.com/yourusername/php-with-CRUD-cli.git
cd php-crud-with-cli
composer install
```

### Step 2: Install Dependencies

[](#step-2-install-dependencies)

```
composer install
```

### Step 3: Set Up Environment Variables

[](#step-3-set-up-environment-variables)

modifie the name of .env.example file in the root directory of the project and configure the database credentials:

### Step 4: Set Up Database

[](#step-4-set-up-database)

```
CREATE DATABASE your_database_name;

USE your_database_name;
```

### Step 5: Run the CLI Script

[](#step-5-run-the-cli-script)

```
php public/CLI.php
```

### CLI Menu and Commands

[](#cli-menu-and-commands)

PHP PDO CRUD CLI
----------------

[](#php-pdo-crud-cli)

Choose an option:

1. Create User
2. Read All Users
3. Read User by ID
4. Update User
5. Delete User
6. Exit Your choice:

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/527008?v=4)[adnen](/maintainers/adnen)[@Adnen](https://github.com/Adnen)

---

Top Contributors

[![adnenre](https://avatars.githubusercontent.com/u/11591834?v=4)](https://github.com/adnenre "adnenre (3 commits)")

### Embed Badge

![Health badge](/badges/adnen-php-crud-with-cli/health.svg)

```
[![Health](https://phpackages.com/badges/adnen-php-crud-with-cli/health.svg)](https://phpackages.com/packages/adnen-php-crud-with-cli)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71470.5k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20720.9k21](/packages/winbox-args)[tomatophp/filament-artisan

Simple but yet powerful library for running some artisan commands for FilamentPHP

3275.4k1](/packages/tomatophp-filament-artisan)

PHPackages © 2026

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