$ composer global require custom-services-limited/oc-cli

Install OC-CLI and Run Your First Commands

OC-CLI installs as the `oc` binary. Use it globally, from a project-local Composer install, or directly via `php bin/oc` when working from the repository.

Requirements

Base requirements

  • PHP 7.4 or newer
  • Composer
  • MySQL or MariaDB access for the target OpenCart database

When you need a store root

  • Cache, category, product, order, user, and `modification:list` commands need a real OpenCart 3.x installation root.
  • DB-native commands can run with direct DB flags from anywhere.

Installation

Global Composer install

Terminal
composer global require custom-services-limited/oc-cli

Make sure your Composer global bin directory is on `PATH` so the `oc` binary is available everywhere.

Project-local install

Terminal
composer require --dev custom-services-limited/oc-cli

For repository usage or local Composer installs, run commands through `php bin/oc` or `./vendor/bin/oc`.

Verify the Binary

Global install check

Terminal
oc list --raw

Repository or project-local check

Terminal
php bin/oc list --raw

Choose the Right Execution Mode

1

Run inside an OpenCart 3.x root

Runtime-backed and root-aware commands

Use this mode for cache, category, product, order, user, and modification commands that bootstrap real OpenCart models.

cd /path/to/opencart && oc product:list --limit=5
2

Point at a store root explicitly

Runtime-backed commands from outside the store

Use `--opencart-root` when you are outside the installation but still need runtime-backed behavior.

oc order:list --opencart-root=/var/www/opencart --customer=John --limit=10
3

Use direct database flags

DB-native commands and database-backed config access

Use direct database credentials for `db:*`, `core:config`, and other DB-native flows when no store root is available.

oc db:info --db-host=localhost --db-user=oc_user --db-pass=secret --db-name=opencart

Common First Commands

Check CLI and store version details

Terminal
oc core:version --opencart

Verify runtime requirements

Terminal
oc core:check-requirements

List products from a real OpenCart 3.x root

Terminal
oc product:list --limit=5

Working Examples

Create catalog data

oc product:create "Demo Product" "DEMO-001" "19.99"

Update an order from the CLI

oc order:update-status 1 5 --comment="Approved from OC-CLI" --notify

What Changed from the Old Docs

  • The documented package binary is `oc`, not `oc-cli`.
  • `--opencart-root` is the supported path flag. `--path` is not documented in the current repo.
  • There is no project-level runtime config file in the current implementation.
  • Runtime-backed commands currently target real OpenCart 3.x roots only.