Repository navigation
Pass arguments from /run to a script task - #17
Merged
Merged
Conversation
Words after the task's name in /run (or !run) are handed to check.sh as its arguments. A run with arguments is answered and not recorded, so it cannot change which alerts the scheduled runs send. Scheduled runs get none, and prompt tasks refuse them. The words can be typed after the name (the suggestion list keeps them) or in the command's own arguments field. The disk-health example takes --report: every disk with the values the check judges, the sleeping disks it skipped, and the limits.
Discord's command list drops words typed after the task's name, so the
arguments field is the only way there, and the suggestion list no longer
tries to carry them. A slash command pasted or typed as plain text may
carry the labels ("arguments: --report", "name:disk-health"); they
are dropped instead of reaching the script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
/run <name>can now pass words to a script task:check.shas its arguments ($1,$2, …). They are split at spaces and never pass through a shell. Up to 10 words of 100 characters, plain ASCII.(with --report)) and not recorded: it does not count as the task's last run and changes nothing about which alerts the scheduled runs send.argumentsfield (Discord drops words typed after the task's name there). Typed or pasted as a plain message they follow the name; a pasted line may keep its field labels (/run disk-health arguments: --report).The
disk-healthexample takes--report: one line for every disk with the values the check judges, sleeping disks listed as skipped, and the limits. It reads nothing more than a normal run and wakes no disk. An unknown argument is refused.The base instructions tell Claude to give a task that stores readings a
--dry-runargument.Notes for the release
/runonce with "This command is outdated": the app still holds the old command. Reload Discord (Ctrl+R) or try again a little later.!runis not affected.disk-health; to get--report, ask Claude to copy it again from/usr/local/share/berthward/task-examples/disk-healthand approve it.Tested
/runwith theargumentsfield and!runwith words both reach the script; the realdisk-health --reportlists the disks, a plain run stays quiet, an unknown argument exits 2.argumentsfield,/run disk-health --reportas text, the same with thearguments:label, and!runall pass the words.