Skip to content

feat!: add workos skills subcommand group (install, uninstall, list)#86

Merged
nicknisi merged 5 commits intomainfrom
nicknisi/skills-uninstall
Mar 7, 2026
Merged

feat!: add workos skills subcommand group (install, uninstall, list)#86
nicknisi merged 5 commits intomainfrom
nicknisi/skills-uninstall

Conversation

@nicknisi
Copy link
Member

@nicknisi nicknisi commented Mar 7, 2026

Summary

Introduces a workos skills subcommand group that replaces the standalone install-skill and uninstall-skill commands, following the same nested pattern used by other resource commands (workos env, workos organization, etc.).

New command structure

workos skills install [--skill ...] [--agent ...]
workos skills uninstall [--skill ...] [--agent ...]
workos skills list [--agent ...]

Breaking changes

  • workos install-skillworkos skills install
  • workos uninstall-skillworkos skills uninstall
  • --list flag removed from both commands in favor of workos skills list

Skills commands no longer require auth

Skills commands only read/write local files (no WorkOS API calls), so the withAuth wrapper has been removed. This also fixes a bug where the process would hang after auth login due to an unclosed HTTP server from the OAuth callback.

Proper error handling and JSON mode support

The uninstall and list commands now use the project's standard output and logging infrastructure:

  • JSON mode: Structured JSON output when piped or with --json flag, including structured error objects to stderr ({ "error": { "code": "...", "message": "..." } })
  • Project logging: All error/warning/info paths use logError/logWarn/logInfo for Sentry tracking and session log files
  • exitWithError: All failure exits use structured error codes (SKILLS_DIR_READ_FAILED, NO_AGENTS_FOUND, SKILL_NOT_FOUND)
  • discoverSkills error handling: Wrapped in try-catch with actionable error message instead of raw stack trace
  • Unrecognized skill names: Warns when --skill values don't match known skills instead of silently ignoring them

Other improvements

  • Removed process.exit(0) workaround from both install-skill and uninstall-skill handlers in bin.ts (root cause was withAuth, now removed)
  • Replaced redundant existsSync pre-check with findInstalledSkills to eliminate TOCTOU race
  • Consolidated duplicate fs import in test file
  • Added test for findInstalledSkills when globalSkillsDir doesn't exist
  • Added orchestrator tests for --skill filter edge cases (all unknown, partial match)
  • Added JSON mode tests for both uninstall results and error output
  • Updated help-json.ts command registry to nested skills structure
  • workos skills list shows both available skills and installed-per-agent in a unified view

nicknisi added 4 commits March 7, 2026 10:33
…ing agents

Mirrors install-skill with --list, --skill, and --agent flags.
Detects installed skills by scanning agent directories for known
WorkOS skill names, ensuring user-created skills are never removed.
The auth system keeps the event loop alive after command completion.
Other commands (install, doctor) already call process.exit(0) explicitly.
…mmand

- Add structured JSON output for --list, results, and errors (isJsonMode/outputJson/exitWithError)
- Add project logging (logError/logInfo/logWarn) for Sentry and session logs
- Wrap discoverSkills in try-catch with actionable error message
- Warn on unrecognized --skill names instead of silently ignoring
- Replace redundant existsSync pre-check with findInstalledSkills
- Remove process.exit(0) from install-skill and uninstall-skill handlers in bin.ts
- Add orchestrator tests for --skill filter and JSON mode tests
- Consolidate duplicate fs import and add globalSkillsDir nonexistent test
BREAKING CHANGE: `workos install-skill` and `workos uninstall-skill` are
replaced by `workos skills install`, `workos skills uninstall`, and
`workos skills list`.

- Restructure as `skills` subcommand group using registerSubcommand
- Extract `--list` flags into dedicated `workos skills list` command
  that shows both available and installed skills per agent
- Remove withAuth from skills commands (no API calls needed)
- Add list-skills.ts with JSON mode support
- Add list-skills.spec.ts with human and JSON output tests
- Update help-json.ts command registry to nested structure
@nicknisi nicknisi changed the title feat: add uninstall-skill command feat!: add workos skills subcommand group (install, uninstall, list) Mar 7, 2026
@nicknisi nicknisi merged commit c008b72 into main Mar 7, 2026
5 checks passed
@nicknisi nicknisi deleted the nicknisi/skills-uninstall branch March 7, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant