feat(templates): add allow-telemetry wrapper template #182

Merged
rootiest merged 4 commits from feat/templates-allow-telemetry into main 2026-09-29 08:38:16 +00:00
Owner

Summary

Adds a new templates/ directory. It holds starting points for users' own functions. The first template is allow-telemetry.fish. It wraps one command and removes a list of environment variables from that command's process only. Every other tool still sees them.

Settings are two file-scope lines at the top:

set -l wrap_cmd claude
set -l wrap_unset DO_NOT_TRACK DISABLE_TELEMETRY

function $wrap_cmd -V wrap_cmd -V wrap_unset freezes both values into the function, so they do not leak into the shell. env -u … runs the external binary, so the wrapper cannot recurse. To use it, a user edits the two lines and saves the file as <cmd>.fish.

Changes

  • templates/allow-telemetry.fish: the template.
  • tests/run-tests.fish: the syntax/indent lint now covers templates/.
  • tests/test-templates.fish: instantiates the template against a stub binary. It checks that the listed vars are removed, other vars are kept, arguments and exit status pass through, the parent keeps the vars, the settings do not leak, and an empty list is a no-op.
  • .github/workflows/ci.yml: templates/** added to the push paths and the PR relevance regex.
  • README.md: new "Function templates" subsection under Personalization.

Verification

fish tests/run-tests.fish: 257/257 lint, 923/923 assertions, exit 0.

Follow-up (not in this PR)

More templates, and a generator that reads the set -l settings block and writes literal values, so __fish_help_header can find function <name>. Output goes to user-dots functions/ when present. That directory is not on $fish_function_path today.

https://claude.ai/code/session_015eE4sQqrZ8yKGkTMf58shs

## Summary Adds a new `templates/` directory. It holds starting points for users' own functions. The first template is `allow-telemetry.fish`. It wraps one command and removes a list of environment variables from that command's process only. Every other tool still sees them. Settings are two file-scope lines at the top: ```fish set -l wrap_cmd claude set -l wrap_unset DO_NOT_TRACK DISABLE_TELEMETRY ``` `function $wrap_cmd -V wrap_cmd -V wrap_unset` freezes both values into the function, so they do not leak into the shell. `env -u …` runs the external binary, so the wrapper cannot recurse. To use it, a user edits the two lines and saves the file as `<cmd>.fish`. ## Changes - `templates/allow-telemetry.fish`: the template. - `tests/run-tests.fish`: the syntax/indent lint now covers `templates/`. - `tests/test-templates.fish`: instantiates the template against a stub binary. It checks that the listed vars are removed, other vars are kept, arguments and exit status pass through, the parent keeps the vars, the settings do not leak, and an empty list is a no-op. - `.github/workflows/ci.yml`: `templates/**` added to the push paths and the PR relevance regex. - `README.md`: new "Function templates" subsection under Personalization. ## Verification `fish tests/run-tests.fish`: 257/257 lint, 923/923 assertions, exit 0. ## Follow-up (not in this PR) More templates, and a generator that reads the `set -l` settings block and writes literal values, so `__fish_help_header` can find `function <name>`. Output goes to user-dots `functions/` when present. That directory is not on `$fish_function_path` today. https://claude.ai/code/session_015eE4sQqrZ8yKGkTMf58shs
rootiest added the Kind/FeatureArea/TestsArea/CI labels 2026-09-29 08:18:58 +00:00
rootiest added 2 commits 2026-09-29 08:18:59 +00:00
First entry in a new templates/ directory. The template wraps one
command and removes a list of environment variables from that command's
process only. The command name and variable list are file-scope settings
at the top of the file; function -V freezes them into the function, so
users edit two lines and save as <cmd>.fish.

templates/ joins the syntax/indent lint, and tests/test-templates.fish
instantiates the template against a stub binary.

Claude-Session: https://claude.ai/code/session_015eE4sQqrZ8yKGkTMf58shs
docs(readme): document templates/ and add it to CI paths
CI / test (pull_request) Successful in 2m46s
CI / github-mirror (pull_request) Skipped
CI / docs (pull_request) Successful in 14s
b1784c65fc
Claude-Session: https://claude.ai/code/session_015eE4sQqrZ8yKGkTMf58shs
rootiest added 1 commit 2026-09-29 08:25:53 +00:00
Merge branch 'main' into feat/templates-allow-telemetry
CI / github-mirror (pull_request) Skipped
CI / test (pull_request) Successful in 2m21s
CI / docs (pull_request) Successful in 16s
5c1885b422
rootiest added 1 commit 2026-09-29 08:34:40 +00:00
Merge branch 'main' into feat/templates-allow-telemetry
CI / github-mirror (pull_request) Skipped
CI / test (pull_request) Successful in 2m48s
CI / docs (pull_request) Successful in 14s
1f774c919e
rootiest merged commit 727534c446 into main 2026-09-29 08:38:16 +00:00
rootiest deleted branch feat/templates-allow-telemetry 2026-09-29 08:38:16 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rootiest/fish-config#182