feat: add sf schema and sf status commands for agentic CLI @W-24222996@ - #1275
Open
WillieRuemmele wants to merge 4 commits into
Open
WillieRuemmele wants to merge 4 commits into
WillieRuemmele wants to merge 4 commits into
Conversation
Outputs a JSON schema describing a command's input interface — flags with types, summaries, validation constraints, args, org/project/devhub requirements, and error codes. Without --command, outputs a compact index of all available commands. Always outputs JSON (no --json needed).
Always-JSON command that surfaces the current CLI environment: - config values (target-org, target-dev-hub, api-version) with source location - resolved target org and dev hub details (username, alias, orgId, instanceUrl, tracksSource, expirationDate, org type flags) - project context (path, defaultPackagePath, packageDirectories, namespace) - CLI version, node, os, shell, arch
ts-json-schema-generator requires return types to be exported and resolvable as named types. Export CommandSchema, CommandIndex, and StatusResult. Add a SchemaResult type alias for the union type since the generator cannot resolve inline union expressions. Regenerate command-snapshot.json and schema JSON files.
The command-reference generator requires topic entries in package.json's oclif.topics section. Add entries for the new schema and status commands.
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.
@W-24222996@
Summary
sf schemacommand that outputs a JSON schema describing a command's flags, args, and requirements (or a compact index of all commands when no--commandflag is given)sf statuscommand that outputs the current CLI environment context (target org, dev hub, project info, CLI version) as JSONCommandSchema,CommandIndex,SchemaResult,StatusResult) sots-json-schema-generatorcan resolve them forschema:generatecommandreference:generatepassesTest plan
./bin/dev.js schema:generatesucceeds./bin/dev.js snapshot:generatesucceeds./bin/dev.js snapshot:compare— no changes detected./bin/dev.js schema:compare— no changes detectedcommandreference:generate --erroronwarningspasses