Global Configuration — config.toml
Settings and tasks that apply across all projects.
Table of Contents
- TOC
Location
| OS | Path |
|---|---|
| Linux / macOS | ~/.config/enx/config.toml |
| Windows | ~\AppData\Roaming\enx\config.toml |
This file is created automatically by enx setup.
[defaults]
Optional. Default settings for enx.
| Field | Type | Required | Description |
|---|---|---|---|
projects_dir |
String | No | Default directory for cloning new projects |
[defaults]
projects_dir = "~/code"
When you run enx clone <repo> without specifying a path, the repo is cloned into this directory.
[tasks]
Optional. Global tasks available in every project. These serve as a fallback when a task is not found in the project’s enx.toml.
The syntax is identical to project tasks:
[tasks.scratch]
command = "code ~/scratch.md"
description = "Open scratch notes"
[tasks."git:prune"]
command = "git fetch --prune && git branch -vv | grep gone | awk '{print $1}' | xargs git branch -d"
description = "Prune dead git branches"
Resolution order
When you run enx run <task>:
- The task is looked up in the current project’s
enx.toml - If not found, it’s looked up in
config.toml - If not found in either, enx reports an error
This means project tasks always take precedence over global tasks of the same name.
is_configured
Internal flag set to true after enx setup completes. Used to detect whether initial setup has been run.
is_configured = true
You generally don’t need to edit this field manually.
Full Example
is_configured = true
[defaults]
projects_dir = "~/code"
[tasks.scratch]
command = "code ~/scratch.md"
description = "Open scratch notes"
[tasks."git:prune"]
command = "git fetch --prune && git branch -vv | grep gone | awk '{print $1}' | xargs git branch -d"
description = "Prune dead git branches"