[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B0TVFM38JH3PBA2K219Z2X":3,"skill-same:01M7B0TVFM38JH3PBA2K219Z2X":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":13,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":43,"install":44,"resources":57},"01M7B0TVFM38JH3PBA2K219Z2X","shell-path-login",null,"Use when a binary or script works in one shell context but not another (interactive vs non-interactive login vs non-login shell).","gitricko\u002F.minions","gitricko","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F18060558?v=4","01M7B0KG9EHG0CZ0QT1EN5YPCR","01M7B0KGA0ZV14R7SKBF3B5SCT",2,"MIT","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fshell-path-login\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: shell-path-login\ndescription: Use when a binary or script works in one shell context but not another (interactive vs non-interactive login vs non-login shell).\nversion: 1.0.0\nauthor: Hermes Agent\nlicense: MIT\nplatforms: [linux]\nmetadata:\n  hermes:\n    tags: [shell, path, login-shell, bash, environment]\n    related_skills: [ci-debugging, docker-test-shell]\n---\n\n# Shell PATH & Login-Shell Debugging\n\nWhen a command \"works in my terminal\" but not in CI, cron, or a container,\nthe usual culprit is which shell startup files got sourced.\n\n## The 3 shell contexts\n\n| Shell context | Sources | Typical invocation |\n|---------------|---------|-------------------|\n| Interactive login | `~\u002F.bash_profile`, then `~\u002F.profile` (which sources `~\u002F.bashrc`) | `bash -l`, SSH login |\n| Interactive non-login | `~\u002F.bashrc` only | new terminal tab |\n| Non-interactive (script, CI, docker exec) | **Neither** by default | `bash script.sh`, `docker exec` |\n\nKey trap: `~\u002F.bashrc` starts with an interactive-check guard:\n\n```bash\ncase $- in\n    *i*) ;;            # interactive — continue\n      *) return;;      # non-interactive — EXITS EARLY\nesac\n```\n\nAnything you `export` or `PATH=` after that guard (e.g. the installer's\nPATH snippet) **never runs in non-interactive shells**. That's why a binary\n\"works in my terminal\" but not in `dts exec` or CI.\n\n## Diagnosis checklist\n\n```bash\n# 1. Which shells find the binary?\nwhich \u003Cbin>                    # current shell\nbash -l -c 'which \u003Cbin>'       # login shell\nbash -c 'which \u003Cbin>'          # non-interactive\nenv -i PATH=\"$PATH\" bash -c 'echo $PATH'   # clean env\n\n# 2. What's actually in the startup files?\ncat ~\u002F.bashrc | tail -10       # look for PATH exports AFTER the interactive guard\ncat ~\u002F.profile  | tail -10     # sourced by ALL login shells\ngrep -n \"PATH=\" ~\u002F.bashrc ~\u002F.profile\n\n# 3. Does a login shell pick it up?\nbash -l -c 'echo \"PATH=$PATH\"'\n```\n\n## Canonical fixes\n\n1. **Add the PATH snippet to `~\u002F.profile`** (runs for all login shells):\n   ```bash\n   # ~\u002F.profile\n   export PATH=\"$HOME\u002F.minions\u002Fbin:$PATH\"\n   ```\n   This is the single most robust fix for \"works interactively, not in CI\".\n\n2. **Make the CI\u002Ftest invocation a login shell** if the environment allows:\n   ```bash\n   docker exec ... bash -l -c \"your-command\"\n   ```\n\n3. **Export the PATH explicitly at the top of the script** that needs it\n   (self-contained, most reliable):\n   ```bash\n   export PATH=\"${HOME}\u002F.minions\u002Fbin:${PATH}\"\n   ```\n\n## Installer lesson\n\nWhen `install.sh` adds a PATH snippet, add it to **all three** of\n`~\u002F.bashrc`, `~\u002F.zshrc`, **and** `~\u002F.profile`. The `.profile` entry is what\nmakes it work in non-interactive login contexts (cron, `docker exec -l`,\nCI jobs that source login shells).\n\n## CLI wrappers vs shell aliases\n\nPrefer a `bin\u002F\u003Cwrapper>` executable on `PATH` over a shell alias. Aliases only work in interactive shells — scripts, `make`, CI steps, `ssh host cmd`, and `sudo` never inherit them, so users get \"command not found\" in non-interactive contexts.\n\n- Ship `~\u002F.minions\u002Fbin\u002Fts` (or similar) as a POSIX `sh` wrapper that execs the real binary with the correct flags. `PATH` already contains `~\u002F.minions\u002Fbin`, so the wrapper works immediately without reloading a shell.\n- Do not add an `alias ts=...` to rc files when a wrapper exists — it is redundant and misleading. If an alias already shipped, remove it and keep only the wrapper.\n\n## Socket and tilde pitfalls\n\n- `--flag=~\u002Fpath` does not expand `~`. `~` only expands at the start of a word or after `:` in `PATH`-like assignments; `--socket=~\u002F.minions\u002F...` is not an assignment, so the binary dials a literal `~` path and fails with \"no such file\". Always use `$HOME` or `$MINIONS_HOME` (`--socket=\"$HOME\u002F.minions\u002F...\"`).\n- Some CLIs ignore their env var for socket selection (e.g. Tailscale `v1.104.1` ignores `TAILSCALE_SOCKET`). Verify with a live probe: `ENV=... bin status` failing while `bin --socket=... status` succeeds proves the env is ignored — fix probes to use the flag.\n- Wrapper socket resolution: use `${MINIONS_HOME:-$HOME\u002F.minions}\u002Fvar\u002Frun\u002F\u003Csock>` not `$HOME` alone — `$HOME` may not match the daemon's home in CI, `ssh`, or `sudo` contexts where `MINIONS_HOME` is the exported canonical path.\n- Always pass `--socket` in the wrapper; do not gate on `[ -S \"$SOCK\" ]` then fall back to the default. The socket can disappear between the check and the exec, causing a silent fallback to the wrong path. Let the CLI fail explicitly if the socket is gone.\n\n## Real-world example\n\n`mnemon` was installed by `.minions` to `~\u002F.minions\u002Fbin\u002Fmnemon` with a\nsymlink, but `self-check.sh` reported \"mnemon not found in PATH\". The\ninstaller only appended the PATH snippet to `~\u002F.bashrc` — after the\ninteractive guard — so `dts exec` (non-interactive `bash -l -c`) never\nsourced it. Fix: add the same snippet to `~\u002F.profile`, which all login\nshells source regardless of interactivity.","# Shell PATH & Login-Shell Debugging\n\nWhen a command \"works in my terminal\" but not in CI, cron, or a container,\nthe usual culprit is which shell startup files got sourced.\n\n## The 3 shell contexts\n\n| Shell context | Sources | Typical invocation |\n|---------------|---------|-------------------|\n| Interactive login | `~\u002F.bash_profile`, then `~\u002F.profile` (which sources `~\u002F.bashrc`) | `bash -l`, SSH login |\n| Interactive non-login | `~\u002F.bashrc` only | new terminal tab |\n| Non-interactive (script, CI, docker exec) | **Neither** by default | `bash script.sh`, `docker exec` |\n\nKey trap: `~\u002F.bashrc` starts with an interactive-check guard:\n\n```bash\ncase $- in\n    *i*) ;;            # interactive — continue\n      *) return;;      # non-interactive — EXITS EARLY\nesac\n```\n\nAnything you `export` or `PATH=` after that guard (e.g. the installer's\nPATH snippet) **never runs in non-interactive shells**. That's why a binary\n\"works in my terminal\" but not in `dts exec` or CI.\n\n## Diagnosis checklist\n\n```bash\n# 1. Which shells find the binary?\nwhich \u003Cbin>                    # current shell\nbash -l -c 'which \u003Cbin>'       # login shell\nbash -c 'which \u003Cbin>'          # non-interactive\nenv -i PATH=\"$PATH\" bash -c 'echo $PATH'   # clean env\n\n# 2. What's actually in the startup files?\ncat ~\u002F.bashrc | tail -10       # look for PATH exports AFTER the interactive guard\ncat ~\u002F.profile  | tail -10     # sourced by ALL login shells\ngrep -n \"PATH=\" ~\u002F.bashrc ~\u002F.profile\n\n# 3. Does a login shell pick it up?\nbash -l -c 'echo \"PATH=$PATH\"'\n```\n\n## Canonical fixes\n\n1. **Add the PATH snippet to `~\u002F.profile`** (runs for all login shells):\n   ```bash\n   # ~\u002F.profile\n   export PATH=\"$HOME\u002F.minions\u002Fbin:$PATH\"\n   ```\n   This is the single most robust fix for \"works interactively, not in CI\".\n\n2. **Make the CI\u002Ftest invocation a login shell** if the environment allows:\n   ```bash\n   docker exec ... bash -l -c \"your-command\"\n   ```\n\n3. **Export the PATH explicitly at the top of the script** that needs it\n   (self-contained, most reliable):\n   ```bash\n   export PATH=\"${HOME}\u002F.minions\u002Fbin:${PATH}\"\n   ```\n\n## Installer lesson\n\nWhen `install.sh` adds a PATH snippet, add it to **all three** of\n`~\u002F.bashrc`, `~\u002F.zshrc`, **and** `~\u002F.profile`. The `.profile` entry is what\nmakes it work in non-interactive login contexts (cron, `docker exec -l`,\nCI jobs that source login shells).\n\n## CLI wrappers vs shell aliases\n\nPrefer a `bin\u002F\u003Cwrapper>` executable on `PATH` over a shell alias. Aliases only work in interactive shells — scripts, `make`, CI steps, `ssh host cmd`, and `sudo` never inherit them, so users get \"command not found\" in non-interactive contexts.\n\n- Ship `~\u002F.minions\u002Fbin\u002Fts` (or similar) as a POSIX `sh` wrapper that execs the real binary with the correct flags. `PATH` already contains `~\u002F.minions\u002Fbin`, so the wrapper works immediately without reloading a shell.\n- Do not add an `alias ts=...` to rc files when a wrapper exists — it is redundant and misleading. If an alias already shipped, remove it and keep only the wrapper.\n\n## Socket and tilde pitfalls\n\n- `--flag=~\u002Fpath` does not expand `~`. `~` only expands at the start of a word or after `:` in `PATH`-like assignments; `--socket=~\u002F.minions\u002F...` is not an assignment, so the binary dials a literal `~` path and fails with \"no such file\". Always use `$HOME` or `$MINIONS_HOME` (`--socket=\"$HOME\u002F.minions\u002F...\"`).\n- Some CLIs ignore their env var for socket selection (e.g. Tailscale `v1.104.1` ignores `TAILSCALE_SOCKET`). Verify with a live probe: `ENV=... bin status` failing while `bin --socket=... status` succeeds proves the env is ignored — fix probes to use the flag.\n- Wrapper socket resolution: use `${MINIONS_HOME:-$HOME\u002F.minions}\u002Fvar\u002Frun\u002F\u003Csock>` not `$HOME` alone — `$HOME` may not match the daemon's home in CI, `ssh`, or `sudo` contexts where `MINIONS_HOME` is the exported canonical path.\n- Always pass `--socket` in the wrapper; do not gate on `[ -S \"$SOCK\" ]` then fall back to the default. The socket can disappear between the check and the exec, causing a silent fallback to the wrong path. Let the CLI fail explicitly if the socket is gone.\n\n## Real-world example\n\n`mnemon` was installed by `.minions` to `~\u002F.minions\u002Fbin\u002Fmnemon` with a\nsymlink, but `self-check.sh` reported \"mnemon not found in PATH\". The\ninstaller only appended the PATH snippet to `~\u002F.bashrc` — after the\ninteractive guard — so `dts exec` (non-interactive `bash -l -c`) never\nsourced it. Fix: add the same snippet to `~\u002F.profile`, which all login\nshells source regardless of interactivity.",{"name":5,"author":23,"license":14,"version":24,"metadata":25,"platforms":36,"description":7},"Hermes Agent","1.0.0",{"hermes":26},{"tags":27,"related_skills":33},[28,29,30,31,32],"shell","path","login-shell","bash","environment",[34,35],"ci-debugging","docker-test-shell",[37],"linux","main","e95aec76487a22bbbc23b63234724bc7178d4692","skills\u002Fshell-path-login","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions","https:\u002F\u002Fgithub.com\u002Fgitricko","2026-11-13 16:00:00",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add gitricko\u002F.minions --skill shell-path-login",{"tool":50,"command":51},"bunx","bunx skills add gitricko\u002F.minions --skill shell-path-login",{"tool":53,"command":54},"pnpm","pnpm dlx skills add gitricko\u002F.minions --skill shell-path-login","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fshell-path-login\u002FSKILL.md",true,[],[59,66,73,80,87,94],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M7B0VJ3Q0YMCTJY69FEJ4100","version-single-source","Use when adding a new component dependency or versioning a binary in install\u002Fboot scripts.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fversion-single-source\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M7B0V888DV8J3JY5W9Z6WCF3","tdd","Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions \"red-green-refactor\", or wants integration tests.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7B0TKFCTVQBTSNF9WF1MXJ6","self-update-fix","Fix a failing dependency update PR. Use when a self-update PR's CI fails, or when invoked by scripts\u002Fself-update-fix.sh.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fself-update-fix\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M7B0TB57WEW0E6E9874K3C72","pr-change-log","Use when a multi-commit PR needs its description written\u002Fupdated, or when closing out a long branch with many fix commits.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fpr-change-log\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M7B0T2FGSV0ZFRZ46PG4BBY2","persistent-knowledge","Persistent skills\u002Fknowledge in Codespace via symlinks.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fpersistent-knowledge\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M7B0SSS6R0QN67MZNTEM3GWC","mnemon-seed-persistence","Persist Mnemon memory across Codespace rebuilds.","https:\u002F\u002Fgithub.com\u002Fgitricko\u002F.minions\u002Fblob\u002Fmain\u002Fskills\u002Fmnemon-seed-persistence\u002FSKILL.md",[],[]]