PHPackages                             beecodersteam/mycommands - 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. beecodersteam/mycommands

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

beecodersteam/mycommands
========================

A bunch of useful terminal commands

v1.2.3(11mo ago)36MITPHPPHP ^8.3CI passing

Since May 17Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/luizalbertobm/my-commands)[ Packagist](https://packagist.org/packages/beecodersteam/mycommands)[ RSS](/packages/beecodersteam-mycommands/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (8)Versions (26)Used By (0)

[![CodeRabbit Pull Request Reviews](https://camo.githubusercontent.com/7be00f6b724c8a2d380b00ef55ac9bd6f125a0f7f7f240f6e6524a61d0cfa1c6/68747470733a2f2f696d672e736869656c64732e696f2f636f64657261626269742f7072732f6769746875622f6c75697a616c626572746f626d2f6d792d636f6d6d616e64733f75746d5f736f757263653d6f73732675746d5f6d656469756d3d6769746875622675746d5f63616d706169676e3d6c75697a616c626572746f626d2532466d792d636f6d6d616e6473266c6162656c436f6c6f723d31373137313726636f6c6f723d464635373041266c696e6b3d6874747073253341253246253246636f64657261626269742e6169266c6162656c3d436f64655261626269742b52657669657773)](https://camo.githubusercontent.com/7be00f6b724c8a2d380b00ef55ac9bd6f125a0f7f7f240f6e6524a61d0cfa1c6/68747470733a2f2f696d672e736869656c64732e696f2f636f64657261626269742f7072732f6769746875622f6c75697a616c626572746f626d2f6d792d636f6d6d616e64733f75746d5f736f757263653d6f73732675746d5f6d656469756d3d6769746875622675746d5f63616d706169676e3d6c75697a616c626572746f626d2532466d792d636f6d6d616e6473266c6162656c436f6c6f723d31373137313726636f6c6f723d464635373041266c696e6b3d6874747073253341253246253246636f64657261626269742e6169266c6162656c3d436f64655261626269742b52657669657773)[![PHPStan](https://camo.githubusercontent.com/eaf4cbfc12d0a6eacfb1050f360b1cccf53389e21a0242b95ef8a965b3a41c46/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d3045313131313f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d31373137313726636f6c6f723d303033333939)](https://camo.githubusercontent.com/eaf4cbfc12d0a6eacfb1050f360b1cccf53389e21a0242b95ef8a965b3a41c46/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d3045313131313f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d31373137313726636f6c6f723d303033333939)[![PHP CS Fixer](https://camo.githubusercontent.com/b27d6ed4222c2330d5b6fd6875b7f60a6c48379b5017eb4f627a8b107d1cb9d9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850253230435325323046697865722d3045313131313f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d31373137313726636f6c6f723d303033333939)](https://camo.githubusercontent.com/b27d6ed4222c2330d5b6fd6875b7f60a6c48379b5017eb4f627a8b107d1cb9d9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850253230435325323046697865722d3045313131313f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d31373137313726636f6c6f723d303033333939)[![COVERAGE 47.10%](https://camo.githubusercontent.com/37f4849a45e14d66b649a1a8b23e4f12d499d979f770fe5231d2a70d34da409a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d34372e31302532352d3045313131313f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d31373137313726636f6c6f723d303039393333)](https://camo.githubusercontent.com/37f4849a45e14d66b649a1a8b23e4f12d499d979f770fe5231d2a70d34da409a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d34372e31302532352d3045313131313f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d31373137313726636f6c6f723d303039393333)

My Commands
===========

[](#my-commands)

A curated suite of CLI tools built with [PHP](https://www.php.net/) and the [Symfony Console component](https://symfony.com/doc/current/components/console.html). Automate repetitive tasks, streamline your workflow and integrate with OpenAI for AI‑powered features. The project is designed for easy extension so you can add your own commands whenever needed.

🎬 Demo
------

[](#-demo)

[![Command Demo](.docs/screen.gif)](.docs/screen.gif)

Contents
--------

[](#contents)

- [Prerequisites](#-prerequisites)
- [Features](#-features)
- [Installation](#-installation)
- [Usage](#-usage)
- [Development](#-development)
- [Contributing](#-contributing)
- [License](#-license)

📋 Prerequisites
---------------

[](#-prerequisites)

Before installing and running the project, ensure you have the following:

- **PHP 8.1+**: Required runtime environment
- **Composer**: For dependency management
- **Git**: For version control operations
- **OpenAI API Key**: Required for AI-powered features (obtain from [OpenAI's website](https://platform.openai.com/api-keys))

✨ Features
----------

[](#-features)

- **AI-Powered Git Commits**: Generate semantic commit messages automatically
- **OpenAI Integration**: Send custom prompts and receive AI-generated responses
- **Development Workflow Tools**: Zip directories, manage environment variables, and more
- **Docker Management**: Easily list and stop Docker containers
- **Currency Conversion**: Convert between currencies directly from your terminal
- **Extensible Architecture**: Easily add your own custom commands

⚡ Quick Start
-------------

[](#-quick-start)

Run the installer script and reload your shell:

```
./install.sh
source ~/.zshrc  # or source ~/.bashrc
```

List available commands with:

```
my list
```

🚀 Installation
--------------

[](#-installation)

You can install My Commands in three ways:

### Option 1: Using the Installation Script (Recommended)

[](#option-1-using-the-installation-script-recommended)

```
# Run the installation script
./install.sh

# Reload your shell configuration
source ~/.zshrc  # or source ~/.bashrc
```

The installation script automatically:

- ✅ Checks if PHP and Composer are installed
- ✅ Installs all dependencies
- ✅ Creates a symbolic link for global access
- ✅ Configures shell autocompletion

### Option 2: Manual Installation

[](#option-2-manual-installation)

If you prefer step-by-step manual installation:

1. Install dependencies:

    ```
    composer install
    ```
2. Create a symbolic link for global access:

    ```
    sudo ln -s $(pwd)/bin/my /usr/local/bin/my
    ```
3. Configure shell autocompletion:

    ```
    # For Zsh
    echo "source $(pwd)/my-autocomplete.sh" >> ~/.zshrc
    # OR for Bash
    echo "source $(pwd)/my-autocomplete.sh" >> ~/.bashrc
    ```
4. Reload your shell configuration:

    ```
    source ~/.zshrc  # or source ~/.bashrc
    ```

### Option 3: Install via Composer

[](#option-3-install-via-composer)

Once this package is available on [Packagist](https://packagist.org) you can install it globally with Composer. The installer script will run automatically after installation:

```
composer global require luizalbertobm/mycommands
```

🔧 Usage
-------

[](#-usage)

To see all available commands:

```
my list
```

### Example Commands

[](#example-commands)

```
# Generate AI-powered semantic commit message
my ai:commit

# Ask OpenAI a question
my ai:ask "Write a poem about clean code."

# Convert currency
my currency:convert 100 USD EUR

# Zip current directory
my zip:all

# Manage environment variables
my env:set API_KEY your_api_key_here
my env:unset API_KEY

# Docker operations
my docker:list
my docker:stop-all
```

### Command Autocompletion

[](#command-autocompletion)

Tab completion is automatically activated during installation. Simply type `my` and press Tab to see available commands.

#### Updating Autocompletion

[](#updating-autocompletion)

If you create new commands, regenerate the completion file:

```
# Regenerate autocompletion
my completion > my-autocomplete.sh

# Apply changes
source ~/.zshrc  # or source ~/.bashrc
```

💻 Development
-------------

[](#-development)

### Available Commands

[](#available-commands)

CommandDescription`my ai:ask`Ask a question to OpenAI`my ai:commit`Generate a semantic commit message`my ai:reset-key`Reset your OpenAI API key`my currency:convert`Convert between currencies`my docker:list`List running Docker containers`my docker:stop-all`Stop all running Docker containers`my env:set`Set an environment variable`my env:unset`Unset an environment variable`my git:soft-revert`Soft revert Git changes`my git:stash`Stash Git changes`my git:stash-restore`Restore stashed Git changes`my zip:all`Zip the current directory### Code Quality

[](#code-quality)

```
# Fix code style issues
make check

# Run tests
make test

# Run tests with coverage report
make coverage
```

### Adding New Commands

[](#adding-new-commands)

1. Create a new command class in the `src/Command` directory:

```
