spryker-community / cli-toolkit
The Spryker Community CLI Toolkit
0.1.0
2024-04-03 15:40 UTC
Requires
- php: >=8.1
- ext-curl: *
- ext-intl: *
- ext-json: *
- czproject/git-php: ^4.2
- deeplcom/deepl-php: ^1.5
- guzzlehttp/psr7: ^2.6
- knplabs/github-api: ^3.0
- league/csv: ^9.8
- monolog/monolog: ^3.5
- openai-php/client: ^0.7.7
- php-http/guzzle7-adapter: ^1.0
- symfony/config: ^6.4
- symfony/console: ^6.3
- symfony/dependency-injection: ^6.4
- symfony/dotenv: ^6.3
- symfony/intl: ^6.3
- symfony/yaml: ^6.4
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpstan/phpstan-symfony: ^1.3
- spryker/code-sniffer: ^0.17.19
README
Spryker Community CLI Toolkit
A suite of utilities designed to enhance performance in your day-to-day operations with Spryker Commerce OS.
Installation • Usage • Contributing
Installation
Git clone
git clone https://github.com/spryker-community/cli-toolkit && cd cli-toolkit bin/cli-toolkit
Composer
composer require --dev spryker-community/cli-toolkit vendor/bin/cli-toolkit
Usage
You can see all the available commands by executing:
bin/cli-toolkit --help
Prerequisites
Some of the commands use external services like OpenAI or DeepL that requires API credentials. In those cases you will require to add the credential to your .env
file.
- Copy the template for the environment variables:
cp .env.dist .env
- Add your own auth credentials for the service you are using:
CLI_TOOLKIT_DEEPL_API_AUTH_KEY="your_deepl_api_token"
CLI_TOOLKIT_CHATGPT_API_AUTH_KEY="your_chatgpt_api_token"
Generate translations for the Spryker Yves storefront
bin/cli-toolkit translation:yves:generate
Arguments
locales
: List of locales to which we want the Spryker glossary translated.
Options
--working-dir
: If specified, use the given directory as Spryker project working directory.--translation-engine
: The translation engine to be used for translation generation. Allowed values are deepl or chatgpt [default: "chatgpt"]
Examples
- Generate missing translations Yves glossary to Spanish from Spain (es_ES) by ChatGPT.
bin/cli-toolkit translation:yves:generate es_ES --working-dir=../b2b-demo-marketplace- --translation-engine=chatgpt
- Generate missing translations Yves glossary to Spanish from Spain (es_ES) and French from France by DeepL.
bin/cli-toolkit translation:yves:generate es_ES fr_FR --working-dir=../b2b-demo-marketplace --translation-engine=deepl
Generate translations for the Spryker Zed backoffice
bin/cli-toolkit translation:zed:generate
Arguments
locales
: List of locales to which we want the Spryker glossary translated.
Options
--working-dir
: If specified, use the given directory as Spryker project working directory.--translation-engine
: The translation engine to be used for translation generation. Allowed values aredeepl
orchatgpt
[default:chatgpt
]
Examples
- Generate missing translations Zed glossary to Spanish from Spain (es_ES) by ChatGPT.
bin/cli-toolkit translation:zed:generate es_ES --working-dir=../b2b-demo-marketplace --translation-engine=chatgpt
- Generate missing translations Zed glossary to Spanish from Spain (es_ES) and French from France by DeepL.
bin/cli-toolkit translation:zed:generate es_ES fr_FR --working-dir=../b2b-demo-marketplace --translation-engine=deepl
Contributing
We love contributions, big or small. Please don't forget to read the contribution guidelines.
License
This package is released under the MIT license
Supported with ❤️ by the Spryker Community