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 1mo ago

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

Maintenance30

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

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://www.gravatar.com/avatar/e8d8e9debda33ad0e4553a7911e3edf50de38392e1f6458536cb7932d69569cc?d=identicon)[adnen](/maintainers/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

[wp-cli/wp-cli

WP-CLI framework

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

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[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)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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