Repository navigation
feat(launcher): accept -EncodedCommand/--ec spellings for the verbatim handoff - #477
Merged
Merged
Conversation
…m handoff The `--encoded-command` route is the machine-to-machine channel that CI, agents, and schedulers already generate command lines for — most notably the PowerShell ecosystem, where `pwsh -EncodedCommand <b64>` is the established spelling. Matching `-EncodedCommand` case-insensitively (like every PowerShell parameter name) lets existing tooling reach niu unchanged; the short `--ec` alias cuts the friction for hand-typed and token-counted agent invocations. All three spellings feed the same decode + `-c` re-entry: a single is_encoded_command_word() predicate backs the leading-option group, the launcher-dispatch walk, and the argument-taking arm, so payloads, v1:-prefix guard, and missing-argument diagnostics stay byte-identical. Only the whole word matches — single-dash `-ec` keeps its GNU `-e -c` cluster meaning, and double-dash GNU spellings stay case-sensitive. Fixes #474 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
5 tasks done
caomengxuan666
added a commit
that referenced
this pull request
Oct 22, 2026
* docs(skill): refresh agent skill bundle for the 1.4.3 surface The corpus transcript predated the GNU invocation face and the verbatim handoff, and the prose still described the retired oh-my-niu stack (niubash#145) and the managed-block rc era (niubash#359). - corpus: recapture `niu --help` (GNU long/short option face, verbatim handoff spellings --encoded-command/-EncodedCommand/--ec + v1:, --cwd-state, --install-wt-shortcuts, plugin migrate-rc, skill install|status, portal lines, primary-only rc wording) - SKILL.md: 83/83 suite ledger (2026-10-12 re-run), argv[0] hardlink faces, generated-loader startup (before rc, NIU_PLUGIN_LOADER=off, migrate-rc), NIU_SHELL+SHELL exports, behavior notes for the gather wedge / bare-drive / negative-cache / unset-inherited / marker-zone / dolbrace / ordered-fd / CJK-readline fixes, verbatim handoff for hosts that cannot quote - references: prompt-plugins.md rewritten for the spec+lockfile+loader model; paths.md gains bare drive designators; wpm.md notes same-session visibility of fresh installs; quickref.md gains the host-level verbs - generate-skill.py: capability snapshot names `config`, the verbatim handoff, and `migrate-rc` - check-rename-clean.baseline regenerated: drops the retired winuxshrc- migration help line, absorbs docs/src residue already on master, and records the intentional WINUXSH_SHELL mention in SKILL.md Refs niubash#474 #477 #481 #482 #483 #484 #490 #943 #948 #952 niubash#359 Refs rubash#940 #947 #951 #952 #953 #955 #957 #976 #977 #979 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs(skill): correct SHELL export claim — filled only when unset NIU_SHELL is exported unconditionally, but SHELL is backfilled with the niu.exe path only when the host left it unset (shell.rs shell_was_missing gate); a parent-supplied SHELL passes through. Aligns the NIU_SHELL paragraph with the actual behavior per review on #498. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Summary
--encoded-commandverbatim handoff now accepts two more spellings:-EncodedCommand(PowerShell spelling, matched case-insensitively like every PowerShell parameter name, so tooling that already emitspwsh -EncodedCommand <b64>command lines plugs in unchanged) and the short--ecalias.is_encoded_command_word()predicate backs all three parser sites — the leading-option group, the launcher-dispatch walk, and the argument-taking arm — so every spelling feeds the same decode +-cre-entry with byte-identical results, identicalv1:prefix guard, and identical missing-argument diagnostics.-eckeeps its GNU-e -ccluster meaning, and double-dash GNU spellings stay case-sensitive (--Encoded-Commandis left for the engine to reject).niu --helpgroups the three spellings under a "Verbatim handoff" heading.Fixes #474
Test plan
cargo test --locked --bin niu— 44 passed, including newspelling_table_is_exactly_the_alias_family,encoded_command_aliases_are_launcher_words,encoded_command_aliases_keep_cluster_and_operand_boundariescargo test --locked --test issue474_encoded_command_aliases— 6 passed (byte-identical output across all spellings,v1:guard under every spelling, identical missing-arg diagnostic,-eerrexit contract under aliases,-ecstays the GNU cluster, help grouping)cargo test --locked --test issue390_encoded_command_flags— 7 passed, zero regressioncargo fmt --check -p niubashGenerated with Devin