The config file
howdy config init
Your own defaults for howdy new can live in a config
file, so you need not pass the same flags every time: the database you
always use, the packages you always want, or a fork of Howdy to build
from. The file is TOML, and optional; without one, howdy new uses the
CLI's own defaults.
Where it lives
howdy reads the first of these there is:
| System | Path |
|---|---|
| Linux | $XDG_CONFIG_HOME/howdy/config.toml, or ~/.config/howdy/config.toml |
| macOS | ~/Library/Application Support/howdy/config.toml, then ~/.config/howdy/config.toml |
| Windows | %AppData%\howdy\config.toml |
Set HOWDY_CONFIG to the path of another file to read that one instead,
which is handy in CI, or to none to read no file at all:
HOWDY_CONFIG=./ci.toml howdy new my_app
Writing one
howdy config init writes a file to start from where howdy looks first,
or to HOWDY_CONFIG when that is set. Every setting in it is commented
out at the CLI's own default, with a note on what it does, so uncomment a
line to change that default. An existing file is left alone unless you
pass --force.
Settings
The [new] table holds the defaults for howdy new. Each one stands for
a flag:
[new]
source = "git" # hex or git, as --source
howdy = "1.0.0" # the Howdy release, as --howdy
repository = "https://git.example.com/me/howdy.git"
database = "sqlite" # postgres, sqlite or none
with = ["mail", "auth"] # packages to set up, as --with
minimal = false # as --minimal
api_only = false # as --api-only
agents = true # false for --no-agents
skip_deps = false # as --skip-deps
-
sourceis where the packages are downloaded from:hex, the default, orgit. See Which Howdy release. -
howdykeeps every new project on one release. Leave it out to follow the release the CLI's templates are written for, which moves on withhowdy upgrade. Each package's version comes from the release, so they always match. -
repositoryis the Git repository the packages come from withsource = "git": a fork or a private mirror of Howdy, with the same release tags. -
databaseispostgres,sqlite, ornonefor--no-database. -
withis the packages to set up from the start. -
minimal,api_only,agentsandskip_depsare the flags of the same name;agents = falseis--no-agents.
Every setting is checked whenever the file is read, used or not, and one the CLI does not know is an error, so a misspelt key is not quietly ignored:
✗ config file ~/.config/howdy/config.toml: unknown setting new.databse; see 'howdy config --help' for the settings there are
howdy add follows the project rather than the file: it adds each package
from wherever gleam.toml takes howdy, a custom repository included.
Flags still win
A flag given on the command line always wins over the file:
-
--database sqlitebeatsdatabase = "none"; -
--with ""sets up no packages, whateverwithsays; -
a setting that turns something on is turned back off with
--minimal=false,--api-only=falseor--no-agents=false.
howdy new --no-config ignores the file altogether, and a project made
with a file says which one it read.
Seeing the defaults
howdy config
howdy config shows which file is in use, or where it looked, and the
defaults howdy new starts from, each taken from the file or the CLI's
own:
Config file: ~/.config/howdy/config.toml
Defaults for howdy new:
source hex howdy's default
howdy 1.0.0 howdy's default
repository https://github.com/howdy-gleam/howdy.git howdy's default
database sqlite from the config file
with auth, jobs from the config file
minimal false howdy's default
api_only false howdy's default
agents true howdy's default
skip_deps false howdy's default
howdy config --json prints the same as one object, with the file's
path, the paths it searched, and under new each setting's key,
value and whether it is from the config or the default.
Flags
-
howdy config --json: print the file and the settings as one JSON object. -
howdy config init --force: replace a config file that is already there.
