Skip to main content

Configuration Files

archetect.yaml configures the Archetect tool — catalogs, default answers, security policy, mode flags, and server/client settings. (Not to be confused with archetype.yaml, which describes an archetype.)

For a task-oriented walkthrough, see User Guide: Configuration.

File Locations and Merge Order

Configuration is layered from multiple sources. Later sources override earlier ones (field-level merge, with one exception for catalog noted below):

OrderSourceNotes
1Built-in defaultsSee Default Configuration.
2User config: ~/.config/archetect/archetect.yamlOptional.
3Drop-in fragments: ~/.config/archetect/etc.d/*.yaml (and *.yml)Loaded in lexicographically sorted filename order; later files override earlier ones. Ideal for machine-managed fragments (e.g. 10-corp.yaml, 20-team.yaml).
4Project config in the current directoryOne of archetect.yaml, archetect.yml, .archetect.yaml, .archetect.yml. It is an error for more than one variant to exist.
5-c/--config-file <path>An additional config file supplied on the command line.
6CLI flags and environment variables--offline, --headless, --dry-run, --local, --force-update, --allow-exec and their ARCHETECT_* equivalents.

Three special rules:

  • Project catalog replaces, not merges. If the project config declares a catalog: section, it fully replaces the global catalog rather than being field-merged into it. All other sections (e.g. answers) merge field-by-field as usual. Use archetect global ... to bypass a project config and use the global catalog.
  • switches folds per item, not per list. Each layer's switches list overlays the accumulated set item by item: name (or name=true) enables, name=false disables, and switches a layer doesn't mention are untouched. See Switches.
  • CLI flags only override when explicitly set. A flag's built-in default does not clobber a value from a config file.

Directory locations follow the XDG Base Directory Specification (verify yours with archetect system layout):

PurposeLinux/macOS defaultEnv override
Config (archetect.yaml, etc.d/)~/.config/archetectXDG_CONFIG_HOME
Cache (git clones, downloads, library staging)~/.cache/archetectXDG_CACHE_HOME
Data (persistent, e.g. Lua type annotations)~/.local/share/archetectXDG_DATA_HOME

On Windows, native conventions are used: %APPDATA%\archetect\config, %LOCALAPPDATA%\archetect\cache, %APPDATA%\archetect\data.

Schema

catalog

A map of named catalog entries — the entries shown when running archetect with no arguments, and addressable as actions (e.g. archetect render archetect ...).

catalog:
archetect:
description: Archetect Catalog
source: https://github.com/archetect/archetect-catalog.git

The default configuration ships with exactly this single entry, pointing at the official Archetect catalog.

answers

A map of default answers supplied to every render (lowest-precedence answer source — see Answer Files). By default, Archetect seeds this from your git configuration:

KeySeeded from
author_namegit user.name
author_emailgit user.email
author_full"<name> <email>"
answers:
author_name: Jane Doe
company: Acme

switches

A list of switch names enabled for every render. Folded per item across config layers: a later layer can disable an inherited switch with name=false without affecting the rest.

switches:
- debug

security

FieldTypeDefaultDescription
allow_execbooleanLegacy form: true maps to the allowed policy, false to prompt.
shell_exec_policyforbidden | prompt | allowedpromptGates archetect.shell.run / archetect.shell.capture in scripts. Takes precedence over allow_exec when both are set.

Policies:

PolicyBehavior
forbiddenShell exec attempts always fail. (Forced in MCP mode.)
promptEvery shell exec call prompts the user with the exact command. In headless mode this is a hard failure.
allowedShell exec is allowed unconditionally. (Set by --allow-exec / ARCHETECT_ALLOW_EXEC.)

Mode Flags

FieldTypeDefaultCLI / EnvDescription
offlinebooleanfalse-o/--offline / ARCHETECT_OFFLINEOnly use local directories and already-cached remote sources.
headlessbooleanfalse--headless / ARCHETECT_HEADLESSExpect all inputs to be resolved by answers, defaults, and optional values — never wait for interactive input.
dry_runbooleanfalse-n/--dry-run / ARCHETECT_DRY_RUNShow what would be rendered without writing files.

updates

FieldTypeDefaultDescription
forcebooleanfalseForce-update all cached catalogs and archetypes on every render (-U/--force-update / ARCHETECT_FORCE_UPDATE).
intervalinteger (seconds)604800 (7 days)How often cached remote sources are checked for updates.

locals

Local development checkouts: when enabled, sources that match a checkout under one of the configured paths use the local copy instead of the remote.

FieldTypeDefaultDescription
enabledbooleanfalseEnable local checkout resolution (-l/--local / ARCHETECT_LOCAL).
pathslist of paths["~/projects/archetypes/"]Directories scanned for local checkouts.

server

Applies to archetect server. Every field is optional — CLI flags and environment variables override this section, and anything left unset falls through to hardcoded defaults.

FieldTypeDescription
hoststringBind address.
portintegerBind port.
tls.certpathServer certificate (required if tls: is present).
tls.keypathServer private key (required if tls: is present).
tls.client_capathCA for verifying client certificates (enables mTLS).

client

Applies to archetect connect (and as the fallback for server catalog entries). Every field is optional — CLI flags override.

FieldTypeDescription
endpointstringDefault server endpoint used when none is given on the command line.
connect.timeout_secsintegerInitial gRPC connect timeout.
connect.retriesintegerConnect retry count.
connect.backoff_base_msintegerBase backoff between retries.
connect.max_backoff_secsintegerBackoff ceiling.
keepalive.interval_secsintegerHTTP/2 keepalive interval. 0 disables keepalive.
keepalive.timeout_secsintegerKeepalive timeout.
tlsmapPresence of this section (even empty) enables TLS — equivalent to --tls.
tls.capathCA certificate to trust.
tls.client_certpathClient certificate (mTLS).
tls.client_keypathClient private key (mTLS).
tls.domainstringExpected TLS server name.

Environment Variables

VariableEquivalentSection/Field
ARCHETECT_OFFLINE-o/--offlineoffline
ARCHETECT_HEADLESS--headlessheadless
ARCHETECT_DRY_RUN-n/--dry-rundry_run
ARCHETECT_ALLOW_EXEC-e/--allow-execsecurity.allow_exec
ARCHETECT_LOCAL-l/--locallocals.enabled
ARCHETECT_FORCE_UPDATE-U/--force-updateupdates.force
ARCHETECT_SERVER_HOSTarchetect server --hostserver.host
ARCHETECT_SERVER_PORTarchetect server --portserver.port
ARCHETECT_SERVER_TLS_CERTarchetect server --tls-certserver.tls.cert
ARCHETECT_SERVER_TLS_KEYarchetect server --tls-keyserver.tls.key
ARCHETECT_SERVER_TLS_CLIENT_CAarchetect server --tls-client-caserver.tls.client_ca
ARCHETECT_CONNECT_TIMEOUTarchetect connect timeout flagclient.connect.timeout_secs
ARCHETECT_CONNECT_RETRIESarchetect connect retries flagclient.connect.retries
ARCHETECT_CLIENT_TLS--tlsclient.tls (enable)
ARCHETECT_CLIENT_TLS_CA--tls-caclient.tls.ca
ARCHETECT_CLIENT_TLS_CERT--tls-certclient.tls.client_cert
ARCHETECT_CLIENT_TLS_KEY--tls-keyclient.tls.client_key
ARCHETECT_CLIENT_TLS_DOMAIN--tls-domainclient.tls.domain

See the CLI Reference for the full flag list.

Default Configuration

Print the resolved defaults on your machine with archetect config defaults (see CLI: config):

catalog:
archetect:
description: Archetect Catalog
source: https://github.com/archetect/archetect-catalog.git
answers:
author_email: jane@example.com # seeded from git user.email
author_full: Jane Doe <jane@example.com>
author_name: Jane Doe # seeded from git user.name
updates:
interval: 604800
locals:
paths:
- ~/projects/archetypes/
security: {}