github.com/Racer159/jackal@v0.32.7-0.20240401174413-0bd2339e4f2e/docs/2-the-jackal-cli/2-jackal-config-files.md (about) 1 import Tabs from '@theme/Tabs'; 2 import TabItem from '@theme/TabItem'; 3 import FetchFileCodeBlock from '@site/src/components/FetchFileCodeBlock'; 4 5 # Jackal Config Files 6 7 ## Overview 8 9 Users can use a config file to easily control flags for `jackal init`, `jackal package create`, and `jackal package deploy` commands, as well as global flags (excluding `--confirm`), enabling a more straightforward and declarative workflow. 10 11 Jackal supports config files written in common configuration file formats including `toml`, `json`, `yaml`, `ini` and `props`, and by default Jackal will look for a file called `jackal-config` with one of these filenames in the current working directory. To generate a blank config file you can run `jackal dev generate-config` with an optional output filename/format. For example, to create an empty config file with the `my-cool-env` in the yaml format, you can use `jackal dev generate-config my-cool-env.yaml`. 12 13 To use a custom config filename, set the `JACKAL_CONFIG` environment variable to the config file's path. For example, to use the `my-cool-env.yaml` config file in the current working directory, you can set the `JACKAL_CONFIG` environment variable to `my-cool-env.yaml`. The `JACKAL_CONFIG` environment variable can be set either in the shell or in a `.env` file in the current working directory. Note that the `JACKAL_CONFIG` environment variable takes precedence over the default config file path. 14 15 Additionally, you can set any supported config parameter via an environment variable using the `JACKAL_` prefix. For example, you can set the `jackal init` `--storage-class` flag by setting the `JACKAL_INIT_STORAGE_CLASS` environment variable. Note that the `JACKAL_` environment variable takes precedence over a config file. 16 17 While config files set default values, these values can still be overwritten by command line flags. For example, if the config file sets the log level to `info` and the command line flag is set to `debug`, the log level will be set to `debug`. The order of precedence for command line configuration is as follows: 18 19 1. Command line flags 20 2. Environment variables 21 3. Config file 22 4. Default values 23 24 For additional information, see the [Config File Example](../../examples/config-file/README.md). 25 26 ## Config File Location 27 28 Jackal searches for the Jackal Config File from either your current working directory or the `~/.jackal/` directory if you don't specify a config file. 29 30 ## Config File Examples 31 32 <Tabs queryString="init-file-examples"> 33 <TabItem value="yaml"> 34 <FetchFileCodeBlock src={require('../../examples/config-file/jackal-config.yaml')} fileName="jackal-config.yaml" fileFormat="yaml" /> 35 </TabItem> 36 <TabItem value="toml"> 37 <FetchFileCodeBlock src={require('../../examples/config-file/jackal-config.toml')} fileFormat="toml" fileName="jackal-config.toml" /> 38 </TabItem> 39 <TabItem value="ini"> 40 <FetchFileCodeBlock src={require('../../examples/config-file/jackal-config.ini')} fileFormat="ini" fileName="jackal-config.ini" /> 41 </TabItem> 42 <TabItem value="json"> 43 <FetchFileCodeBlock src={require('../../examples/config-file/jackal-config.json')} fileFormat="json" fileName="jackal-config.json" /> 44 </TabItem> 45 </Tabs>