Skip to content

feat(office): forward --target-user, and name the line the script really ends with - #254

Merged
quickbeard merged 1 commit into
mainfrom
feat/office-target-user
Aug 11, 2026
Merged

feat(office): forward --target-user, and name the line the script really ends with#254
quickbeard merged 1 commit into
mainfrom
feat/office-target-user

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Two gaps found while documenting how to repair a Windows machine whose skills were installed into an admin account (quickbeard/codev-landing-page#110).

1. --target-user was the one flag codevhub could not express

installerArgs forwarded only --skip-verify and --force-skills, and unknown flags are hard-rejected — so -TargetUser had no route through the CLI at all.

That is backwards: -TargetUser exists because a human is driving the install by hand from an admin session, which is exactly when they reach for codevhub. The documented recovery had to break out of the tool halfway through and tell people to type the second command themselves.

codevhub skill office --target-user minhnh49
codevhub skill office --uninstall --skills-only --target-user minhnh49
  • Applies to both modes: install puts the skills in the right profile, uninstall clears them out of one.
  • Windows only, rejected elsewhere with the same shape as the existing --arch guard — the bash scripts recover the invoking user from SUDO_USER, so there is nothing to name and an unknown flag would just make them choke.
  • Advertised in OFFICE_USAGE, unlike --uninstall. There is no reason to hide it, and the docs now point at it.

2. Uninstall mode quoted a message the uninstaller never prints

The Windows manual handoff said, in both modes:

  1. Wait for the green "Verification passed" closing message

The uninstaller ends with codev-office uninstall finished. So anyone running --uninstall sat waiting for a line that was never coming — the same class of bug as codev-scripts#29, which fixed the script side of exactly this.

Each mode now names the line its own script actually ends with. For install that is codev-office setup complete, which codev-scripts#29 made unconditional, rather than Verification passed, which is absent under --skip-verify.

⚠️ That install string assumes the post-#29 setup script is published to codev-storage. It is merged in codev-scripts but the scripts still need uploading — worth confirming before this ships, or the install handoff names a line an older published script does not print. The uninstall string is safe either way.

Testing

pnpm check, pnpm typecheck, pnpm test (1414 passed, 76 files) and pnpm build all pass. Nine new tests, verified to actually execute rather than silently skip:

  • both spellings — --target-user jdoe and --target-user=VTS\minhnh49
  • missing value rejected
  • legal in install and uninstall mode alike
  • forwarding through installerArgs and uninstallerArgs, including combined with the existing switches, and that nothing is forwarded when absent
  • the printed command for a domain-qualified account (VTS\minhnh49, unquoted) and for one containing a space ("First Last", quoted) — the value reaches PowerShell copy-pasteable either way

Not covered: the --target-user on non-Windows rejection lives in runSkillOffice, which does I/O and has no existing test harness — the neighbouring --arch guard is untested for the same reason. I also could not exercise the printed handoff end-to-end, since it sits after the download from codev-storage; the unit tests cover the command string it composes.

🤖 Generated with Claude Code

…lly ends with

Two gaps found while documenting how to repair a Windows machine whose skills
were installed into an admin account (codev-landing-page#110).

--target-user forwards to both scripts as -TargetUser. It was the one flag
codevhub could not express, and the only flag whose entire reason for existing
is that a human is driving the install by hand - which is exactly when they
reach for codevhub. Without it the documented recovery had to break out of the
tool halfway through and tell people to type the second command themselves.

It applies to install and uninstall alike: install puts the skills in the right
profile, uninstall clears them out of one. Windows only, rejected elsewhere with
the same shape as the existing --arch guard, because the bash scripts recover
the invoking user from SUDO_USER and would choke on an unknown flag.

The Windows manual handoff also told people to "Wait for the green Verification
passed closing message" in BOTH modes. The uninstaller never prints that - it
ends with "codev-office uninstall finished" - so anyone running --uninstall sat
waiting for a message that was not coming. Each mode now names the line its own
script actually ends with. For install that is "codev-office setup complete",
which is unconditional, rather than "Verification passed", which is absent under
--skip-verify.

Tests cover both spellings of the flag, the missing-value rejection, legality in
both modes, forwarding through installerArgs/uninstallerArgs, and the printed
command for a domain-qualified account and for one containing a space.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit b61081b into main Aug 11, 2026
2 of 4 checks passed
@quickbeard
quickbeard deleted the feat/office-target-user branch August 11, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant