$ oc help

Using OC-CLI in the Real World

This guide is aligned with the current CLI repo. It explains connection modes, command families, supported output formats, and the OpenCart 3.x boundary for runtime-backed workflows.

Overview

Stable commands

29

Structured output

16

Runtime boundary

OpenCart 3.x

OC-CLI is a Symfony Console CLI for OpenCart. The current stable surface covers store inspection, configuration, database operations, cache maintenance, extensions, modifications, catalog workflows, orders, and admin-user management.

The most important distinction in the current repo is execution mode: DB-native commands can run with direct database credentials, while runtime-backed commands bootstrap real OpenCart models and therefore require a real OpenCart 3.x installation root.

Connection Modes

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

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

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

Global Options

All commands inherit the OpenCart root flag and the direct DB connection flags defined in the base command class.

--opencart-root

Path to an OpenCart installation directory for auto-discovery.

--db-host

Direct database connection flag.

--db-user

Direct database connection flag.

--db-pass

Direct database connection flag.

--db-name

Direct database connection flag.

--db-port

Direct database connection flag.

--db-prefix

Direct database connection flag.

--db-driver

Direct database connection flag.

Command Families

Database

Connection inspection, backup, restore, and maintenance commands.

7 commands

Extensions and Modifications

Extension row management and OCMOD import/list flows.

5 commands

Catalog

Category and product workflows backed by OpenCart admin models.

6 commands

Structured Output

Many read-heavy commands expose `--format=table|json|yaml`. That is especially useful for automation, monitoring, and shell pipelines.

oc db:backup nightly.sql --compress
oc db:check --format=json
oc order:list --customer=John --limit=10 --format=json

Not every command supports structured output. The API page lists options per command so you can see exactly where `--format` is available.

Examples

First-run checks

oc core:version
oc core:check-requirements
oc db:info --db-host=localhost --db-user=oc_user --db-pass=secret --db-name=opencart

Product and order workflows

oc product:create "Demo Product" "DEMO-001" "19.99"
oc product:update 100 --price=24.99 --quantity=5
oc order:update-status 1 5 --comment="Approved from OC-CLI" --notify

Current Limitations

  • Runtime-backed commands are currently supported on real OpenCart 3.x roots only.
  • There is no project-level runtime configuration file in the current repo.
  • `extension:install` imports OCMOD XML packages into the modification table. It is not a generic marketplace ZIP installer.
  • `core:config --admin` is accepted for backward compatibility but has no effect.