CLI interface to devhub
Project description
devhub
CLI interface to devhub
Installation
Install this tool using pip:
pip install devhub-cli
Or just install and execute via uvx
uvx devhub-cli
Usage
For help, run:
devhub --help
You can also use:
python -m devhub --help
Via uvx
uvx devhub-cli
Theme Commands
The DevHub CLI provides powerful theme management capabilities for synchronizing and managing your DevHub theme components locally.
Initial Setup
Before using theme commands, you need to initialize your environment:
# Initialize in current directory
devhub theme init
# Initialize in a new directory
devhub theme init mybrand-corporate-theme
This command will:
- Create a
.envfile with your DevHub API credentials - Generate a
.gitignorefile with appropriate exclusions - Create a
devhub.conf.jsonconfiguration file
When specifying a directory, the command will create the directory if it doesn't exist and initialize all configuration files within it.
You'll be prompted to enter:
DEVHUB_API_KEY- Your OAuth1 API keyDEVHUB_API_SECRET- Your OAuth1 API secretDEVHUB_BASE_URL- Your DevHub instance URL (e.g., https://yourbrand.cloudfrontend.net)DEVHUB_SITE_ID- Your site identifier
Available Commands
devhub theme list
Lists all available theme templates and components that can be synchronized.
devhub theme list
devhub theme status
Shows the synchronization status of all theme components, indicating which files have changes compared to the remote version.
devhub theme status
devhub theme sync
Synchronizes theme components from your DevHub instance to local files.
# Sync all components
devhub theme sync
# Sync specific components only
devhub theme sync layouts/headers/DefaultHeader.html components/HeroSection/HeroSection.jinja
The sync command will:
- Download theme files (CSS, headers, footers, localization) to the
layouts/directory - Download template components to the
components/directory as.jinjafiles - Format templates using
djlintwith 2-space indentation - Convert component names from slug-case to PascalCase (e.g.,
hero-section→HeroSection.jinja) - Perform checksum comparison to detect conflicts between local and remote changes
Project Structure
After initialization and synchronization, your project structure will look like:
your-project/
├── .env # Environment variables (not committed)
├── .gitignore # Git exclusions
├── devhub.conf.json # CLI configuration
├── layouts/ # Theme templates (headers, footers, CSS)
│ ├── headers/DefaultHeader.jinja
│ ├── footers/DefaultFooter.jinja
├── styles/ # CSS styles
│ └── globals.css
└── components/ # Template components
├── HeroSection/HeroSection.jinja
├── ProductCard/ProductCard.jinja
└── NavigationMenu/NavigationMenu.jinja
Authentication & Environment
The CLI uses OAuth1 authentication to connect to your DevHub instance. All sensitive credentials are stored in the .env file, which should never be committed to version control.
Required environment variables:
DEVHUB_API_KEY- OAuth1 API keyDEVHUB_API_SECRET- OAuth1 API secretDEVHUB_BASE_URL- Base URL for DevHub APIDEVHUB_SITE_ID- Site identifier
AI Toolkit Commands
The DevHub CLI includes AI toolkit management for setting up AI-powered development tools and templates.
devhub aikit init
Downloads and installs the DevHub AI toolkit to your current working directory.
devhub aikit init
This command will:
- Download the latest AI toolkit from the DevHub CLI AI Toolkit repository
- Extract all toolkit files to your current directory
- Skip existing files to avoid overwriting your customizations
- Provide feedback on extracted and skipped files
The AI toolkit includes templates, examples, and utilities for AI-powered development workflows with DevHub.
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd devhub-cli
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
python -m pytest
CLI template
CLI click template based on https://github.com/simonw/click-app
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devhub_cli-0.1.2.tar.gz.
File metadata
- Download URL: devhub_cli-0.1.2.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52ade5e2994946088228138cf2254963912fa10cbfb023e81e18583820c3494a
|
|
| MD5 |
b3f944900a91cf9d8af58fafb2dff95c
|
|
| BLAKE2b-256 |
9bd43e8fc2eb7ecd16f09383e04cfa78a34b3f1046a5b9945035cafa42c77a4d
|
Provenance
The following attestation bundles were made for devhub_cli-0.1.2.tar.gz:
Publisher:
publish.yml on devhub/devhub-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devhub_cli-0.1.2.tar.gz -
Subject digest:
52ade5e2994946088228138cf2254963912fa10cbfb023e81e18583820c3494a - Sigstore transparency entry: 230244342
- Sigstore integration time:
-
Permalink:
devhub/devhub-cli@cb782006aebfdcdb4b6b7f9bf8daaf70069b3e6b -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/devhub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb782006aebfdcdb4b6b7f9bf8daaf70069b3e6b -
Trigger Event:
release
-
Statement type:
File details
Details for the file devhub_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: devhub_cli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
960cf74f6b31be22a011a77a28059be665eb75147b8bc2679d2a1f329ab5e124
|
|
| MD5 |
b7905a141bf1dc2867b9e458ae1cf82a
|
|
| BLAKE2b-256 |
da8e685d3547a9fe2e880194f86c808ffca98f522732792d2739d20b9dbf0db9
|
Provenance
The following attestation bundles were made for devhub_cli-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on devhub/devhub-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devhub_cli-0.1.2-py3-none-any.whl -
Subject digest:
960cf74f6b31be22a011a77a28059be665eb75147b8bc2679d2a1f329ab5e124 - Sigstore transparency entry: 230244344
- Sigstore integration time:
-
Permalink:
devhub/devhub-cli@cb782006aebfdcdb4b6b7f9bf8daaf70069b3e6b -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/devhub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb782006aebfdcdb4b6b7f9bf8daaf70069b3e6b -
Trigger Event:
release
-
Statement type: