Skip to main content

BigCommerce Toolkit

BigCommerce Toolkit is a command-line interface (CLI) tool for BigCommerce's API. It follows UNIX principles of "do one thing well" and organizes commands based on resource type and action. This structure aligns with RESTful API principles, providing a logical and hierarchical system for managing various BigCommerce resources.

Features

  • Resource-based Commands: Commands are structured around resource types (e.g., products, categories, customers) and their respective actions (e.g., get, create, update, delete).
  • Hierarchical Command Structure: Similar to UNIX tools like git, commands are grouped logically to align with BigCommerce's API structure.
  • Environment Variable Support: Store hash and authentication token can be set via environment variables for convenience.
  • Paginated Requests: Supports fetching all pages of data for GET requests with pagination.
  • Standard Input (stdin) Support: Allows reading values from stdin for easier scripting and piping data between commands.

Installation

To install BigCommerce Toolkit, clone the repository and install the necessary dependencies.

pip install bigcommerce-toolkit

Usage

Basic Command Structure

The CLI uses a structure similar to UNIX commands, where you specify the resource type, action, and additional parameters or options as needed.

bigc [<options>] <resource> [<subresource>] <action> [<arguments>]

Setting Up Environment Variables

Before using the tool, set the environment variables for your BigCommerce store hash and authentication token.

export BIGCOMMERCE_STORE_HASH=your_store_hash
export BIGCOMMERCE_AUTH_TOKEN=your_auth_token

Alternatively, you can pass these values directly via command-line options.

bigc --store-hash your_store_hash --auth-token your_auth_token …

Example Commands

Create a Product (via Arguments)

To create a new product with data provided as named arguments:

bigc products create --name "New Product" --price 19.99 --type physical --weight 0

Create a Product (via Standard Input)

BigCommerce Toolkit also supports reading values from stdin, allowing for piping data between commands for easier scripting. For example:

echo '{"name": "New Product", "price": 19.99, "type": "physical", "weight": 0}' | bigc products create --data -

Update a Product

This can be further leveraged by piping through additional tools like jq. First, retrieving a product's ID by the product's name, and then updating that product's price:

bigc products get --name:like "New Product" | jq -r '.data[0].id' | bigc product update --id - --price 24.99

Fetching All Products

For endpoints that support pagination, you can fetch all pages of data. Using tools like jq and csvlook, it is possible to format the data into a more readable format.

bigc products get-all | jq -r '["id","sku","name"], (.data[] | [.id,.sku,.name]) | @csv' | csvlook

Contributing

We welcome contributions to improve the project. Please submit issues and pull requests via GitHub.

Metadata

Release files for bigcommerce-toolkit 0.1.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bigcommerce-toolkit 0.1.16
File Size Uploaded
bigcommerce_toolkit-0.1.16.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bigcommerce-toolkit 0.1.16
File Interpreter ABI Platform
bigcommerce_toolkit-0.1.16-py3-none-any.whl Python 3 none any Details

Total release size: 21.4 kB

Release files / bigcommerce_toolkit-0.1.16.tar.gz

Download URL bigcommerce_toolkit-0.1.16.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5d33d2b4f2494345d5b33e158c1ea11512bef4c5fbccba87e94f942e64fd01b4
BLAKE2b-256 checksum
How to use checksums
14eaf825458e73e0d6c3cfadff4b3154654238f46fcf4844f5a4afe913de4f8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.2 Darwin/24.6.0

Release files / bigcommerce_toolkit-0.1.16-py3-none-any.whl

Download URL bigcommerce_toolkit-0.1.16-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a7779ff3ee5cccc95a51ec15a7801f6a41a08c2c21d1f013a83c021cb757332
BLAKE2b-256 checksum
How to use checksums
75ef5dfe434085484beddc20fd44482b980d1a6e18840ed3eca6fa5d3ade92d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.2 Darwin/24.6.0

Release history Release notifications | RSS feed

This release

0.1.16 This release

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page