No release in over 3 years
Low commit activity in last 3 years
Versacommerce::CLI is a Command Line Interface tool that interacts with several VersaCommerce-related services.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8
= 0.10.1
~> 10.4

Runtime

 Project Readme

Versacommerce::CLI

Gem Version

Versacommerce::CLI is a Command Line Interface tool that interacts with several VersaCommerce-related services.

Requirements

Ruby ≥ 2.0.0

Installation

$ gem install versacommerce-cli

Commands

vc-theme

Authorization

The vc-theme command has several subcommands that all need an Authorization in order to work. You can get such an Authorization from your shop's admin section.

There are 4 ways to provide an Authorization to the CLI, which are checked in order:

Provide an authorization command line option:

vc-theme <subcommand> --authorization=YOUR_AUTHORIZATION

Provide an explicit config file:

vc-theme <subcommand> --config=path/to/config/file.yml

The config file needs to be a YAML file. The value for an authorization key will be respected. Example config file:

authorization: YOUR_AUTHORIZATION

Provide an implicit config file in the working directory: Same as 2, but the config file location is fix to the working directory.

Provide a THEME_AUTHORIZATION environment variable:

THEME_AUTHORIZATION=YOUR_AUTHORIZATION vc-theme <subcommand>

Provide an implicit config file. Same as 2, but the config file location is fix to ~/.config/versacommerce/cli/config.yml.

Quicksaving Authorization

You can quicksave the given authorization (from any source) to a config.yml file inside the working directory using the --save-config command line option:

$ vc-theme <subcommand> --save-config

It's also possible to change the path the config.yml file is saved to:

$ vc-theme <subcommand> --save-config=path/to/directory

The following subcommands are available:

vc-theme download

The vc-theme download subcommand is used to download a complete Theme from the Theme API. Usage:

$ vc-theme download

This will download the Authorization's Theme to a theme directory relative to the working directory. If you want to change the path the Theme is downloaded to, provide a path command line option:

$ vc-theme download --path=path/to/directory

The directory will be created by using mkdir -p, so you don't need to worry about its existence too much.

vc-theme watch

The vc-theme watch subcommand is used to synchronize local files with the Theme API. Usage:

$ vc-theme watch

This will watch for file changes made in (and below) the working directory. When a file is changed (created, modified, deleted), the change is also pushed to the Theme API. If you want to change the path that is being watched, provide a path command line option:

$ vc-theme watch --path=path/to/directory

vc-theme upload

The vc-theme upload subcommand is used to push a directory to the Theme API. Usage:

$ vc-theme upload

This will upload the working directory and its descendants to the Theme API. For each file found under the working directory the upload process will try to delete and readd the file to the Theme API. If you want to change the path that is being uploaded, provide a path command line option:

$ vc-theme upload --path=path/to/directory

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

Contributing

  1. Fork it (https://github.com/versacommerce/versacommerce-cli/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

MIT.