Skip to content

feat: add sf schema and sf status commands for agentic CLI @W-24222996@ - #1275

Open
WillieRuemmele wants to merge 4 commits into
mainfrom
wr/schema-command
Open

WillieRuemmele wants to merge 4 commits into
mainfrom
wr/schema-command

Conversation

@WillieRuemmele

@WillieRuemmele WillieRuemmele commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

@W-24222996@

Summary

  • Add sf schema command that outputs a JSON schema describing a command's flags, args, and requirements (or a compact index of all commands when no --command flag is given)
  • Add sf status command that outputs the current CLI environment context (target org, dev hub, project info, CLI version) as JSON
  • Export return types (CommandSchema, CommandIndex, SchemaResult, StatusResult) so ts-json-schema-generator can resolve them for schema:generate
  • Add oclif topic metadata for the new commands so commandreference:generate passes

Test plan

  • ./bin/dev.js schema:generate succeeds
  • ./bin/dev.js snapshot:generate succeeds
  • ./bin/dev.js snapshot:compare — no changes detected
  • ./bin/dev.js schema:compare — no changes detected
  • commandreference:generate --erroronwarnings passes
  • Unit tests pass (123 passing; 2 pre-existing doctor test timeouts also fail on main)

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.
@WillieRuemmele
WillieRuemmele requested a review from a team as a code owner September 15, 2026 21:26
@WillieRuemmele WillieRuemmele changed the title feat: add sf schema and sf status commands for agentic CLI feat: add sf schema and sf status commands for agentic CLI @W-24222996@ Sep 17, 2026
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