hyperctl data inspect
command
Overview
The hyperctl data inspect
command is used to inspect website global data namespaces.
Usage
1 $ hyperctl data inspect -h
2Inspect global data namespace.
3
4Usage:
5 hyperctl data inspect <namespace> [options]
6
7Options:
8 -c, --config path to the website configuration file. (required) (env: HYPER_CONFIG) (default: site.yaml)
9 -h, --help Display help information.
Example
Use the hyperctl data ls
command to list available namespaces.
1$ hyperctl data ls
2Namespace Size
3--------- ----
4newsletter 163
5twitter 44
6customers 925
7downloads 18
8nav 1455
Then use hyperctl data inspect <namespace>
to see a JSON representation of the namespace template data.
1$ hyperctl data inspect newsletter
2{"description":"Stay up to date with the lastest releases and other news from the HyperTemplates community.","namespace":"newsletter","title":"Join the community"}
Combine hyperctl data inspect <namespace>
with jq
for best results.
1$ hyperctl data inspect newsletter | jq .
2{
3 "description": "Stay up to date with the lastest releases and other news from the HyperTemplates community.",
4 "namespace": "newsletter",
5 "title": "Join the community"
6}
Using jq
also lets you quickly inspect the contents of a template data property with a very similar dot-notation style accessor pattern.
1$ hyperctl data inspect nav | jq .sidebar
2[
3 {
4 "href": "/",
5 "label": "Home"
6 },
7 {
8 "href": "/features",
9 "label": "Features"
10 },
11 {
12 "href": "/blog/",
13 "label": "Blog"
14 },
15 {
16 "href": "/docs/",
17 "label": "Docs"
18 },
19 {
20 "href": "/docs/reference/cli/",
21 "label": "CLI"
22 }
23]
In this example, the hyperctl data inspect nav | jq .sidebar
command is effectively equivalent to the data.nav.sidebar
template data key that is available in your layouts. 🤌🏽
Options
-c
,--config
- Path to the website configuration file (
site.yaml
orsite.json
).Defaults to the
HYPER_CONFIG
environment variable, if set.To configure a default, use the
export
command.1export HYPER_CONFIG="site.yaml"