<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Guides on nux</title><link>https://drew-daniels.github.io/nux/docs/guides/</link><description>Recent content in Guides on nux</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://drew-daniels.github.io/nux/docs/guides/index.xml" rel="self" type="application/rss+xml"/><item><title>Monorepo Setup</title><link>https://drew-daniels.github.io/nux/docs/guides/monorepo-setup/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://drew-daniels.github.io/nux/docs/guides/monorepo-setup/</guid><description>&lt;p&gt;In a monorepo you often want each tmux window to start in a different subdirectory while still belonging to one nux project. Use &lt;strong&gt;per-window &lt;code&gt;root&lt;/code&gt;&lt;/strong&gt; values: they are paths &lt;strong&gt;relative to the project &lt;code&gt;root&lt;/code&gt;&lt;/strong&gt;, so one config can place windows under &lt;code&gt;apps/frontend&lt;/code&gt;, &lt;code&gt;apps/backend&lt;/code&gt;, &lt;code&gt;packages/shared&lt;/code&gt;, and so on.&lt;/p&gt;
&lt;h2 id="example-project-acme-mono"&gt;Example: project &amp;ldquo;acme-mono&amp;rdquo;&lt;a class="anchor" href="#example-project-acme-mono"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Assume the repo on disk is &lt;code&gt;~/code/acme-mono&lt;/code&gt; with sub-apps under &lt;code&gt;apps/&lt;/code&gt; and shared code under &lt;code&gt;packages/&lt;/code&gt;. A single project config can set the session &lt;code&gt;root&lt;/code&gt; to the monorepo root and give each window its own subdirectory.&lt;/p&gt;</description></item><item><title>Lifecycle Hooks</title><link>https://drew-daniels.github.io/nux/docs/guides/lifecycle-hooks/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://drew-daniels.github.io/nux/docs/guides/lifecycle-hooks/</guid><description>&lt;p&gt;Project configs can define four hooks that run shell commands at well-defined points in the session lifecycle.&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Hook&lt;/th&gt;
 &lt;th&gt;When it runs&lt;/th&gt;
 &lt;th&gt;Mechanism&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;on_start&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;After the session and first window are created, before remaining windows&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;SendKeys&lt;/code&gt; to the first pane&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;on_stop&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;When the session ends&lt;/td&gt;
 &lt;td&gt;tmux hook (&lt;code&gt;session-closed&lt;/code&gt;)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;on_ready&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Once, at the end of the full session build&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;SendKeys&lt;/code&gt; to the first pane&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;on_detach&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Each time a client detaches from the session&lt;/td&gt;
 &lt;td&gt;tmux hook (&lt;code&gt;client-detached&lt;/code&gt;)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="on_start"&gt;&lt;code&gt;on_start&lt;/code&gt;&lt;a class="anchor" href="#on_start"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Runs &lt;strong&gt;once&lt;/strong&gt; after the session and its first window are created. Commands are sent as keystrokes to the first pane of the first window. Use it for one-time setup like starting background services.&lt;/p&gt;</description></item><item><title>Pattern Matching</title><link>https://drew-daniels.github.io/nux/docs/guides/pattern-matching/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://drew-daniels.github.io/nux/docs/guides/pattern-matching/</guid><description>&lt;p&gt;Many nux commands accept a &lt;strong&gt;project pattern&lt;/strong&gt; instead of an exact name. The special character &lt;strong&gt;&lt;code&gt;+&lt;/code&gt; means &amp;ldquo;zero or more characters&amp;rdquo;&lt;/strong&gt; and can appear anywhere in the pattern.&lt;/p&gt;
&lt;h2 id="where--can-appear"&gt;Where &lt;code&gt;+&lt;/code&gt; can appear&lt;a class="anchor" href="#where--can-appear"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Suffix:&lt;/strong&gt; &lt;code&gt;web+&lt;/code&gt; matches names starting with &lt;code&gt;web&lt;/code&gt; (e.g. &lt;code&gt;web-app&lt;/code&gt;, &lt;code&gt;web-admin&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prefix:&lt;/strong&gt; &lt;code&gt;+wiki&lt;/code&gt; matches names ending with &lt;code&gt;wiki&lt;/code&gt; (e.g. &lt;code&gt;dev-wiki&lt;/code&gt;, &lt;code&gt;team-wiki&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Infix:&lt;/strong&gt; &lt;code&gt;+api+&lt;/code&gt; matches any name containing &lt;code&gt;api&lt;/code&gt; (e.g. &lt;code&gt;my-api-server&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiple:&lt;/strong&gt; &lt;code&gt;w+a+&lt;/code&gt; matches names starting with &lt;code&gt;w&lt;/code&gt; that also contain &lt;code&gt;a&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Internally, each &lt;code&gt;+&lt;/code&gt; is translated to &lt;code&gt;.*&lt;/code&gt; and the pattern is anchored as &lt;code&gt;^...$&lt;/code&gt;, so it must match the full project name.&lt;/p&gt;</description></item><item><title>Selective Windows</title><link>https://drew-daniels.github.io/nux/docs/guides/selective-windows/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://drew-daniels.github.io/nux/docs/guides/selective-windows/</guid><description>&lt;p&gt;You can target &lt;strong&gt;individual windows&lt;/strong&gt; with the &lt;code&gt;:window&lt;/code&gt; suffix on the project name, optionally with &lt;strong&gt;multiple windows&lt;/strong&gt; separated by commas. Window names match the &lt;code&gt;name&lt;/code&gt; field under &lt;code&gt;windows&lt;/code&gt; in your project config.&lt;/p&gt;
&lt;h2 id="syntax"&gt;Syntax&lt;a class="anchor" href="#syntax"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nux project:window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nux project:window1,window2,...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nux restart project:window
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nux restart project:window1,window2,...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="starting-a-subset-root-command"&gt;Starting a subset (root command)&lt;a class="anchor" href="#starting-a-subset-root-command"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nux myapp:editor
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nux myapp:editor,server&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Creates the session with &lt;strong&gt;only&lt;/strong&gt; the listed windows, in &lt;strong&gt;the order you list&lt;/strong&gt; (not necessarily YAML order). Session-level options (&lt;code&gt;env&lt;/code&gt;, &lt;code&gt;on_start&lt;/code&gt;, &lt;code&gt;on_ready&lt;/code&gt;, hooks) still apply; &lt;code&gt;on_start&lt;/code&gt; and &lt;code&gt;on_ready&lt;/code&gt; run against the &lt;strong&gt;first window in your list&lt;/strong&gt; as the anchor.&lt;/p&gt;</description></item><item><title>Zoxide Integration</title><link>https://drew-daniels.github.io/nux/docs/guides/zoxide-integration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://drew-daniels.github.io/nux/docs/guides/zoxide-integration/</guid><description>&lt;p&gt;&lt;a href="https://github.com/ajeetdsouza/zoxide"&gt;zoxide&lt;/a&gt; tracks directories you visit frequently. When zoxide integration is enabled, nux can resolve a project by name even when there is no matching config file, by running &lt;code&gt;zoxide query &amp;lt;name&amp;gt;&lt;/code&gt; as a fallback.&lt;/p&gt;
&lt;h2 id="behavior"&gt;Behavior&lt;a class="anchor" href="#behavior"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;If you have visited a directory before, &lt;code&gt;nux my-obscure-project&lt;/code&gt; can succeed when that name resolves via zoxide - even without a config file at &lt;code&gt;~/.config/nux/projects/my-obscure-project.yaml&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When a project resolves through zoxide, no project config is loaded. The session is built using the &lt;code&gt;default_session&lt;/code&gt; template (if configured) or as a bare session with a single window.&lt;/p&gt;</description></item><item><title>Interactive Picker</title><link>https://drew-daniels.github.io/nux/docs/guides/picker/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://drew-daniels.github.io/nux/docs/guides/picker/</guid><description>&lt;p&gt;When you run &lt;strong&gt;&lt;code&gt;nux&lt;/code&gt; with no arguments&lt;/strong&gt; from a directory that is not tied to a project, nux can open an interactive fuzzy finder instead of printing help.&lt;/p&gt;
&lt;h2 id="what-the-picker-shows"&gt;What the picker shows&lt;a class="anchor" href="#what-the-picker-shows"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The picker combines three sources into a single sorted list:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Configured&lt;/strong&gt; projects (files in &lt;code&gt;~/.config/nux/projects/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Directories&lt;/strong&gt; under each &lt;code&gt;project_dirs&lt;/code&gt; entry (top-level only, hidden directories excluded)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Running&lt;/strong&gt; tmux sessions not covered by the above&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Projects that have a config file are marked with a &lt;code&gt;*&lt;/code&gt; suffix so you can tell at a glance which entries have custom configs and which use the default session template:&lt;/p&gt;</description></item><item><title>Tool Sessions</title><link>https://drew-daniels.github.io/nux/docs/guides/tool-sessions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://drew-daniels.github.io/nux/docs/guides/tool-sessions/</guid><description>&lt;p&gt;&lt;strong&gt;Tool sessions&lt;/strong&gt; are nux projects that exist mainly to launch a &lt;strong&gt;single utility&lt;/strong&gt; (database TUI, log tailer, container dashboard, and so on). They are not special-cased in nux: they are normal project configs that often define &lt;strong&gt;one window&lt;/strong&gt; and sometimes omit a meaningful repo layout.&lt;/p&gt;
&lt;h2 id="typical-shape"&gt;Typical shape&lt;a class="anchor" href="#typical-shape"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;root&lt;/code&gt;&lt;/strong&gt; can be &lt;strong&gt;omitted&lt;/strong&gt; or set to any directory (home, a log path, a repo, or &lt;code&gt;/tmp&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;For a &lt;strong&gt;single command&lt;/strong&gt; and one pane, use one window with a single &lt;code&gt;panes&lt;/code&gt; entry.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="example-configs"&gt;Example configs&lt;a class="anchor" href="#example-configs"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Database client (single TUI)&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Troubleshooting</title><link>https://drew-daniels.github.io/nux/docs/guides/troubleshooting/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://drew-daniels.github.io/nux/docs/guides/troubleshooting/</guid><description>&lt;p&gt;Common issues and how to resolve them.&lt;/p&gt;
&lt;h2 id="nux-unknown-command-or-command-not-found"&gt;&amp;ldquo;nux: unknown command&amp;rdquo; or &amp;ldquo;command not found&amp;rdquo;&lt;a class="anchor" href="#nux-unknown-command-or-command-not-found"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;nux&lt;/code&gt; binary is not on your PATH. Verify the install:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;which nux
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nux version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you installed via &lt;code&gt;go install&lt;/code&gt;, make sure &lt;code&gt;$(go env GOPATH)/bin&lt;/code&gt; is in your PATH. If you installed via Homebrew, run &lt;code&gt;brew link nux&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="cannot-start-session-from-inside-tmux"&gt;&amp;ldquo;cannot start session from inside tmux&amp;rdquo;&lt;a class="anchor" href="#cannot-start-session-from-inside-tmux"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;nux refuses to start new sessions from inside an existing tmux session to prevent nested session confusion. Options:&lt;/p&gt;</description></item><item><title>GitHub repository setup</title><link>https://drew-daniels.github.io/nux/docs/guides/github-repo-setup/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://drew-daniels.github.io/nux/docs/guides/github-repo-setup/</guid><description>&lt;p&gt;This page documents maintainer-facing GitHub settings for &lt;strong&gt;nux&lt;/strong&gt;. Most files live in the repo (templates, Dependabot, workflows); a few settings are only in the GitHub UI or API.&lt;/p&gt;
&lt;h2 id="files-in-the-repo"&gt;Files in the repo&lt;a class="anchor" href="#files-in-the-repo"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Item&lt;/th&gt;
 &lt;th&gt;Location&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Security policy&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/Drew-Daniels/nux/blob/main/SECURITY.md"&gt;SECURITY.md&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Code of Conduct&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/Drew-Daniels/nux/blob/main/CODE_OF_CONDUCT.md"&gt;CODE_OF_CONDUCT.md&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Support / where to ask&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/Drew-Daniels/nux/blob/main/SUPPORT.md"&gt;SUPPORT.md&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Issue forms&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/Drew-Daniels/nux/tree/main/.github/ISSUE_TEMPLATE"&gt;.github/ISSUE_TEMPLATE/&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;PR template&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/Drew-Daniels/nux/blob/main/.github/PULL_REQUEST_TEMPLATE.md"&gt;.github/PULL_REQUEST_TEMPLATE.md&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Dependabot&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/Drew-Daniels/nux/blob/main/.github/dependabot.yml"&gt;.github/dependabot.yml&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Sponsor button&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/Drew-Daniels/nux/blob/main/.github/FUNDING.yml"&gt;.github/FUNDING.yml&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Stale issues (optional)&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/Drew-Daniels/nux/blob/main/.github/workflows/stale.yml"&gt;.github/workflows/stale.yml&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="settings-applied-via-github-api"&gt;Settings applied via GitHub API&lt;a class="anchor" href="#settings-applied-via-github-api"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;These can be configured with &lt;code&gt;gh&lt;/code&gt; (see project history). To reproduce or audit:&lt;/p&gt;</description></item></channel></rss>