go install github.com/JohnnyMcGee/metadefConfiguration is done using a hjson file. By default, the CLI looks for a global config file at $HOME/.metadef.hjson. You can pass a local config file using the flag metadef -c /path/to/config.hjson.
{
// Map shop domain to admin access token. There must be at least one shop configured.
shops: {
shop-domain-1: shopify-admin-api-access-token-1
shop-domain-2: shopify-admin-api-access-token-2
shop-domain-3: shopify-admin-api-access-token-3
}
// Optionally specify the Shopify Admin API version to use.
version: 2025-04
}
shops is a map from shop domain to admin api access token. This enables the CLI to access each of your shops.
The CLI uses Shopify Admin GraphQL API. To gain access to your store, add an entry to the shops map. The key should be your myshopify domain (without the .myshopify.com suffix). For example, if your store is super-awesome-store.myshopify.com, the key will be super-awesome-store.
The easiest way to get an admin access token is to create a custom shopify app.
Your app will need read/write permissions for metaobject definitions and metaobjects.
Periodically it may be necessary to fetch the latest schema for Shopify Admin GraphQL API. One way to do this is using the get-graphql-schema CLI tool.
- Install get-grapqhl-schema tool
go install github.com/gqlgo/get-graphql-schema@latest- Download the schema from Shopify's public endpoint
get-graphql-schema https://shopify.dev/admin-graphql-direct-proxy/2025-04 > schema.graphqlReplace '2025-04' with the desired API version. API Versions are listed at https://shopify.dev/docs/api/admin-graphql