Developer Tools

The Developer Tools is a Command Line Interface (CLI) designed to streamline the development, testing, and deployment processes for Enterprise environments and Prestashop modules. These tools are here to make your work more efficient, consistent, and reliable.

The tools provide a unified platform to manage various aspects of your development workflow.
By automating repetitive tasks and simplifying complex processes, these tools aim to boost productivity and reduce the potential for human error.
From cloning shop files and dumping databases to deploying local environments and ensuring Prestashop compliance, the Enterprise Developer Tools are your go-to solution for managing Enterprise environnement and Prestashop modules.

Overview

Enterprise Developer Tools is a comprehensive Command Line Interface (CLI) designed to streamline the development, testing, and deployment of Enterprise environments and Prestashop modules.
It aims to enhance productivity by automating repetitive tasks and providing a unified interface for managing complex workflows.

Key Features

Enterprise Developer Tools provides a robust set of features to support Enterprise environments and Prestashop module development:

Enterprise Environments

  • Clone Shop Files: Seamlessly clone the files of a specified shop to your local environment, ensuring you have the latest version for development or testing.
  • Remote Database Dump: Create a dump of the remote shop’s database, allowing you to work with real data and perform accurate testing.
  • Local Deployment: Deploy a local clone of the targeted shop, enabling you to replicate the production environment on your local machine.
  • Environment Switching: Easily switch between different Enterprise environments, facilitating testing and development across multiple setups.

Prestashop Modules

  • Prestashop Compliance Check: Verify that your Prestashop modules comply with Prestashop standards, ensuring quality and compatibility.

Benefits

  • Increased Efficiency: By automating routine tasks, Enterprise Developer Tools helps developers save time and focus on more critical aspects of their projects.
  • Consistency: Ensures that environments are consistently set up and maintained, reducing the risk of configuration errors.
  • Flexibility: Provides the flexibility to switch between different environments and configurations, making it easier to manage multiple projects.
  • Reliability: Built to handle complex workflows and dependencies, ensuring that your development process is smooth and reliable.

Usage Scenarios

Enterprise Developer Tools can be used in various scenarios, including:

  • Development: Setting up local environments for development, ensuring that you are working with the latest code and data.
  • Testing: Creating test environments that replicate production setups, allowing for thorough testing and debugging.
  • Deployment: Automating the deployment process, reducing the risk of human error and ensuring that deployments are consistent and repeatable.
  • Compliance: Checking Prestashop modules for compliance with standards, ensuring that your modules meet the required quality criteria.

Requirements

Installation

Ubuntu

Open a terminal and download binary:

$ wget "https://assets.prestashop3.com/enterprise/tools/ubuntu/ps-enterprise.zip" && unzip ps-enterprise.zip && rm ps-enterprise.zip

Install application user wide:

$ ./ps-enterprise install

Restart terminal and check ps-enterprise version

$ ps-enterprise -v

Macos

Open a terminal and download binary:

$ curl -O "https://assets.prestashop3.com/enterprise/tools/macos/ps-enterprise.zip" && unzip ps-enterprise.zip && rm ps-enterprise.zip

Install application user wide:

$ ./ps-enterprise install
You may need to authorize application to be run in system settings > security.

Restart terminal and check ps-enterprise version

$ ps-enterprise -v

Windows

Open Powershell and run this snippet to download binary:

Invoke-WebRequest -Uri "https://assets.prestashop3.com/enterprise/tools/windows/ps-enterprise.zip" `
                  -OutFile "ps-enterprise.zip"
Expand-Archive -Path "ps-enterprise.zip" `
               -DestinationPath (Get-Location) -Force
Remove-Item -Path "ps-enterprise.zip"

Install application user wide:

$ ./ps-enterprise.exe install

Restart Powershell and check ps-enterprise version

$ ps-enterprise.exe -v

Basic Usage

From the folder where you want to work, run :

$ ps-enterprise

By default, running CLI without any command name will pass through all required commands to get a local environment fully running: auth, config, clone, remote-dump, patch, stop, start, log

Details

  • Only run auth and config commands once, only when settings are not complete.
  • Only run clone if no shop file exist.
  • Only run remote-dump and patch if any file is missing.
  • Always stop then start local environment.
  • Always end with log command to watch local environment logs.

Options

flag description example
-h, --help Show help information instead of running current command. --help
-c, --clean Run clean command first. --clean

Remarks

All flags are transmitted to each sub command.
e.g: Run local environment with specified email to auth command and force mode enabled to all commands with -f flag available.
ps-enterprise -u john.doe@email.com --force
Docker service need to be started.
On MacOS, you need to authorize application to be run in system settings.

Run specific command

$ ps-enterprise <command>

Run in a shell, replacing <command> with command name.

Authenticate


Initiates the authentication process with the Prestashop Enterprise Platform.
This command ensures that your local environment can securely communicate with the Prestashop services.
It supports One-Time Password (OTP) authentication, although email OTP is not supported.

Details

  • Authenticates to Prestashop Enterprise Platform.
  • OTP is supported, an OTP code will be asked when required.
  • Email OTP is not supported.

Usage

$ ps-enterprise auth

Options

flag description example
-u, --user Specify an user email to avoid to input it manually. --user john.doe@prestashop.com
-f, --force Force to override existing authentication configuration. -f

Configure


Configures the necessary settings for your local environment.
This command allows you to select the platform project and environment you wish to work with, configure the public ngrok domain to access your local shop, and set up local environment debug settings.
This ensures that your local setup is tailored to match the production environment closely.

Details

  • Select platform project and environnement to work with.
  • Ngrok public domain to access local environnement shop.
  • Configure local environnement debug settings

Usage

$ ps-enterprise config

Options

flag description example
-f, --force Force to override existing configuration. -f

Clone


Clones the current deployed version of the project from the target environment to your local machine.
This command ensures that you have the latest code and configurations for development and testing purposes.

Details

  • Clone locally current deployed version in environnement.
  • Requires valid SSH access to Gitlab.

Usage

$ ps-enterprise clone

Options

flag description example
-f, --force Force to override existing local version without confirmation. -f

Remote Dump


Creates a dump of the remote environment’s database. This command ensures that you have a backup of the Enterprise remote environment database for testing and debugging locally.

Details

  • Dump current environnement database.
  • Last dump file stay available at output path until next dump.
    Default output path is ./tmp/dump.sql.
  • Overrides existing dump file.

Usage

$ ps-enterprise remote-dump

Options

flag description example
-o, --output Specify a new path for dump file. --output /home/jdoe/dump.sql

Patch


Updates deployed configuration and database settings to match the local environment.
This command ensures that your local setup functions correctly.

Details

  • Insert local database credentials in shop configuration.
  • Modify environment .htaccess file to accomodate local environment.
  • Add required databases queries before and after dump file.
  • Overrides existing patched files.

Usage

$ ps-enterprise patch

Stop


Stops the running local environment.
This command is useful for shutting down the environment when it is no longer needed or before making significant changes. It ensures that all processes are terminated cleanly.

Details

  • Stop running local environnement.

Usage

$ ps-enterprise stop

Start


Starts or restarts the local environment.
This command ensures that the environment is up and running, ready for development or testing.
If the environment is already running, it will be restarted to apply any changes made.

Details

  • Start local environnement. If already started, will be restarted.

Usage

$ ps-enterprise start

Log


Monitors the logs of the running local environment.
This command allows you to select which application’s logs should be displayed, providing insights into the environment’s performance and any potential issues.

Details

  • Watch running local environment logs.
  • Allow to select witch application log should be shown or hide.

Usage

$ ps-enterprise log

Clean


Cleans up local environment files and resets configurations.
This command deletes local files and settings.
It is useful for resetting the environment to a clean state.

Details

  • Delete local environment files.
  • Delete patched and temporary files.
  • Remove authentication and configuration settings.

Usage

$ ps-enterprise clean

Options

flag description example
-f, --force Force to clean everything without confirmation. -f

Compliance


Checks the compliance of a Prestashop module against Prestashop standards.
This command uses the Prestashop Compliance to analyze module files and identify errors.
It ensures that your modules meet the required quality criteria.

Details

  • Use Prestashop Compliance API.
  • Analyze a Prestashop module files to find errors.

Usage

$ ps-enterprise compliance <module>

Replace <module> with module name to check compliance. Module name can be partial, it refers to module root directory name. If more than one module includes module name, ask to select one.

Module name is optional, if not specified, ask to select one from all modules.

Advanced Commands

Exec


Execute a shell command inside one or more containers from your local environment.
Useful to run maintenance scripts, inspect files, or open an interactive shell.

Details

  • Automatically targets the container matching your current working directory.
  • Default shell used is sh, but can be overridden with --shell=bash.
  • Interactive sessions are supported with --interactive.
  • Supports passing any command to be run inside the container.

Usage

$ ps-enterprise exec <command>

Replace <command> with shell command to execute on local shop.

Options

flag description example
--shell=<shell> Use a specific shell inside the container (sh by default) --shell=bash
--interactive Open an interactive shell session in the matched container --interactive