# `jan config`
Emit shell fragments, symlink (or copy) rc files into `$HOME`, run imperative apply
steps, and check host tools declared as `config:` on command nodes.
```bash
jan config emit --shell zsh -o ~/.config/jan/config.zsh
jan config link
jan config apply
jan config deps
```
| `emit` | Concatenate all `config.shell` fragments (tree walk order) |
| `link` | Symlink `config.link` sources under the preferred dir into `$HOME` destinations |
| `apply` | Run each `config.apply` argv list |
| `deps` | Report `config.deps` tools missing from `PATH` |
## YAML
```yaml
commands:
config:
about: host configuration
commands:
zsh:
config:
shell:
path: config/zsh.zsh # relative to preferred jan dir
# or inline:
# shell: |
# setopt AUTO_CD
emacs:
config:
link:
~/.emacs.d/init.el: config/init.el
git:
config:
apply:
- [git, config, --global, alias.co, checkout]
deps-required:
about: required for full use of scripts
config:
deps:
ag: the_silver_searcher # bin → optional install hint
fzf: ""
```
| `shell.path` | File under the preferred jan directory |
| `shell:` (string) | Inline fragment |
| `link` | Map of destination → source. Dest must be absolute or `~/…` under `$HOME` (or `$XDG_CONFIG_HOME`). Source is relative to the preferred dir. |
| `apply` | List of argv arrays (no shell interpolation) |
| `deps` | Map of bare command name → optional package/install hint (empty/`~` = name only). Checked by `jan config deps`. |
Nodes may be config-only (no `run`). They appear in `--help` like alias-only nodes; opening a node that declares `config:` shows a **Host configuration (`jan config`)** section (shell path/inline, links, apply count, deps count). Existing `os:` filters still apply.
The node's `about` (or chain) labels each missing group in the `deps` report.
## Relation to `jan alias`
Do not merge schemas. `aliases:` is for typing less (`alias g=git`, extra jan names). `config:` is for host setup (sourced fragments, symlinks, `git config …`, host tool checklists). See [`alias.md`](alias.md).
## Flags
### `emit`
| `--shell sh\|bash\|zsh` | Header dialect (default: `zsh`) |
| `-o`, `--output FILE` | Write to a file instead of stdout |
### `link`
| `--dry-run` | Print planned links without changing the filesystem |
| `--copy` | Copy instead of symlink |
| `--force` | Replace an existing destination (default: warn and skip) |
If the destination path already exists, `jan config link` prints a warning to
stderr and skips that entry (exit 0). It does not overwrite unless `--force` is
passed. An existing symlink that already points at the intended source is treated
as done (`ok (already linked)`).
### `apply`
| `--dry-run` | Print argv lists without running them |
A non-zero child exit fails the whole `apply`.
### `deps`
| `--strict` | Exit `1` if any listed tool is missing (default: exit `0` and still print the report) |
## Install pattern
Same idea as `jan alias`:
```bash
jan config emit --shell zsh -o ~/.config/jan/config.zsh
source ~/.config/jan/config.zsh
jan config link
jan config apply
jan config deps
```
`libbeagan_dependencies` (when emitted from the preferred tree) is a thin wrapper around `jan config deps`.