Configuration
Finqu CLI uses a JSON configuration file to store settings, credentials, and theme connections. The configuration supports multiple environments, allowing you to work with different themes or API endpoints.
Configuration File
By default, the CLI looks for finqu.config.json in the current directory. You can override this with:
- The
--config <path>global option - The
FINQU_CONFIGenvironment variable
Configuration Structure
The configuration file supports multiple environments. Each environment is a top-level key in the JSON object:
{
"production": {
"themeDir": "/path/to/theme/directory",
"resourceUrl": "https://<your-env>.api.myfinqu.com",
"apiVersion": "1.2",
"accessToken": "<oauth_access_token>",
"refreshToken": "<oauth_refresh_token>",
"expiresAt": 1784447850458,
"store": {
"merchantId": 6,
"id": 57704,
"themeId": 870,
"versionId": "152bd77a7749171803307263acec8028",
"domain": "example.finqustore.com"
}
},
"development": {
"themeDir": "/path/to/dev/theme",
"resourceUrl": "https://dev.api.myfinqu.com",
"apiVersion": "1.2",
"accessToken": "<dev_access_token>",
"refreshToken": "<dev_refresh_token>",
"expiresAt": 1784447850458,
"store": {
"merchantId": 6,
"id": 57705,
"themeId": 871,
"versionId": "dev_version_id",
"domain": "dev.finqustore.com"
}
}
}Configuration Keys
| Key | Description |
|---|---|
themeDir | Local directory path for theme files |
resourceUrl | Finqu API base URL (set automatically by finqu sign-in) |
apiVersion | Finqu API version (optional, default: 1.2) |
accessToken | OAuth 2.0 access token (automatically managed) |
refreshToken | OAuth 2.0 refresh token (automatically managed) |
expiresAt | Access token expiration timestamp (automatically managed) |
store | Store/theme selection (set by finqu theme configure) |
verbose | Enable or disable verbose logging |
Environment Selection
Use the --env <environment> global option to specify which environment configuration to use:
finqu theme deploy --env development
finqu theme download --env productionIf not specified, the CLI defaults to the production environment.
Configuration Precedence
The CLI resolves configuration values in the following order (highest to lowest priority):
- Command-line flags:
--config,--env,--verbose - Environment variables:
FINQU_CONFIG,FINQU_API_CLIENT_ID,FINQU_API_CLIENT_SECRET - Configuration file: Values from
finqu.config.json(or the file specified by--config)
Automatic Management
The configuration file is automatically created and updated by CLI commands:
finqu sign-instores authentication tokensfinqu theme configurestores theme connection details- Token refresh happens automatically when tokens expire
Note: You typically don’t need to edit the configuration file manually. The CLI manages it for you. However, you can manually edit it if needed, for example to add multiple environments or adjust settings.
Environment Variables
You can override configuration values using environment variables:
| Variable | Description |
|---|---|
FINQU_CONFIG | Override the default configuration file path |
FINQU_API_CLIENT_ID | API Client key to use for authentication (alternative to using --key) |
FINQU_API_CLIENT_SECRET | API Client secret to use for authentication (alternative to using --secret) |
These are particularly useful in CI/CD environments where you want to avoid storing credentials in files.