Usage#
nux new <name>Description#
Creates a new project config file at ~/.config/nux/projects/<name>.yaml and opens it in $EDITOR if set.
The generated config includes a schema modeline for editor IntelliSense and a minimal template:
# yaml-language-server: $schema=https://raw.githubusercontent.com/Drew-Daniels/nux/main/schemas/project.schema.json
windows:
- name: editorEdit this file to define your windows, panes, commands, and other project settings.
Behavior#
- If a config for
<name>already exists, nux exits with an error (it will not overwrite). - The config file is written to disk.
- nux prints
Created <path>. - If
$EDITORis set, nux opens the new file in your editor. - If
$EDITORis not set, nux printshint: set $EDITOR to open new configs automatically.
Errors#
config already exists: <path>- a file with that name already exists. Usenux edit <name>to modify it, ornux delete <name>to remove it first.
Examples#
# Create and edit a new project config
nux new blog
# Create without opening an editor (when $EDITOR is unset)
unset EDITOR && nux new apiPost-save validation#
When the editor closes, nux re-loads and validates the config. Errors are printed as [error] and a clean config prints Config valid. If the YAML is unparseable, a syntax error warning is shown instead.
Notes#
- The project name comes from the argument, not from a field inside the YAML. The filename
blog.yamlmeans the project is calledblog. - After creating the config, start the session with
nux blog.