Open
Conversation
Adds a new package that integrates cli-to-js with the Executor SDK (@executor-js/sdk). The plugin: - Registers as an executor plugin under the 'cli' key - Exposes addBinary() to auto-discover CLI tools via --help parsing - Exposes addHelpText() for offline schema-based registration - Converts CLI flags/subcommands into executor ToolRegistrations with JSON Schema inputSchema - Routes tool invocations through cli-to-js's CliApi proxy - Supports removeBinary() for cleanup and list() for inspection - Properly cleans up on executor.close() Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
- kebab-to-camel: 6 unit tests for case conversion - flag-to-json-schema: 7 unit tests for flag-to-schema conversion - build-input-schema: 8 unit tests for full schema generation - plugin integration: 13 tests using createExecutor from @executor-js/sdk - Plugin registration and extension API - addHelpText with root tools, subcommands, schema generation - addBinary with real echo binary - Tool invocation returning stdout/stderr/exitCode - ToolNotFoundError for unregistered tools - removeBinary cleanup - Multiple binary registration - Executor close cleanup 34 tests total, all passing. Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
Source changes: - Inline kebab-to-camel and flag-to-json-schema into build-input-schema (eliminating two single-use utility files) - Remove formatCommandResult — CommandResult already has the right shape - Extract parseToolId, describeCommand, subcommandToRegistration as pure helpers outside the closure - Extract shared registerApi for addBinary/addHelpText - Replace push loop with .map() in registerToolsFromSchema - Use Promise.all in close handler instead of sequential loop - Remove redundant String() coercion on already-typed parameter Test changes: - Delete kebab-to-camel.test.ts and flag-to-json-schema.test.ts (for removed files); fold their coverage into build-input-schema.test.ts - Extract shared startExecutor helper and afterEach cleanup - Extract toolNamesForSource helper to reduce assertion boilerplate - 34 tests → 23 tests with same coverage, less duplication Co-authored-by: Aiden Bai <aidenybai@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
Adds a new package
@cli-to-js/plugin-executorthat integrates cli-to-js with the Executor SDK (@executor-js/sdk). This lets any CLI tool wrapped by cli-to-js be exposed as invocable tools inside an Executor, alongside MCP, OpenAPI, GraphQL, and other plugin-based tool sources.Usage
What the plugin does
"cli"keyaddBinary(config)— runs a binary's--help, parses the output via cli-to-js, and registers every flag/subcommand as an executor tool with JSON SchemainputSchemaaddHelpText(config)— same as above but from a string (no subprocess needed)removeBinary(namespace)— unregisters all tools for a namespacelist()— returns all registered namespace keysCliApiproxy, returning{ stdout, stderr, exitCode }executor.close()unregisters all tools viaPromise.allPackage structure
Tests
23 tests across 2 test files, all passing:
build-input-schema.test.tsplugin.test.tscreateExecutor— plugin registration, addHelpText, addBinary, tool listing, schema inspection, tool invocation with real binaries, ToolNotFoundError, removeBinary, multi-binary isolation