Conversation
… properties `[Hidden]` now accepts `AttributeTargets.Class` so it can be placed on a namespace handler type to suppress the entire namespace from help output. The attribute gains two named properties: `Help` (default `true`) and `Schema` (default `false`). Plain `[Hidden]` hides the item from the help listing but leaves it fully visible in `__schema` output. Set `Schema = true` to also mark it `hidden: true` in the schema so tooling can suppress it selectively. The command or parameter is always callable, regardless of either flag. The generator reads both flags through a new `GetHiddenFlags` helper and propagates them as `IsHidden` (help gate) and `IsHiddenInSchema` (schema gate) on `CommandModel`, `ParameterModel`, and the namespace child types (`RegistryNode.NamedCommandNamespaceChild`, `ChildNamespaceSnapshot`, `AIMapNamespace`). The root and namespace help printers filter hidden namespace children from their listings and width calculations. `CliNamespaceSchema` gains a `Hidden` field and `CliSchemaJsonWriter` emits it. Existing fixtures that relied on `[Hidden]` producing `hidden: true` in schema are updated to `[Hidden(Schema = true)]`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eta-schema The cli-schema meta-schema has additionalProperties: false on namespace objects and does not include hidden as a valid property. Emitting hidden: true on namespaces caused the schema-conformance CI check to fail. Remove Hidden from CliNamespaceSchema and its emitters for now. IsHiddenInSchema on namespace models is retained for when the meta-schema is updated (tracked at cli-schema/cli-schema#7). Drop the schema test that expected hidden: true on namespace objects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This branch has not been deployed
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.
[Hidden]can now be placed on a namespace handler class to suppress the entire namespace from the help listing. The attribute gains two named properties —Help(defaulttrue) andSchema(defaultfalse) — giving callers explicit control over whether an item is hidden from users, from tooling, or from both.Prompt summary: Extend
[Hidden]to acceptAttributeTargets.Classso a namespace handler type can opt its namespace out of the public--helpoutput. The use-case is internal or automation namespaces (such as areleasenamespace) that CI scripts should still be able to invoke, but that should not clutter the help listing end users see. As part of this, addHelpandSchemanamed properties so callers can control each surface independently.Why
Namespaces registered via
AddNamespace<T>have no way to suppress themselves from the root or parent help listing short of not registering them at all. Internal automation namespaces end up visible to every end user running--help, even when they are never meant for direct use.What
Attribute surface
[Hidden]now allowsAttributeTargets.Classand exposes two named properties:Help(defaulttrue) andSchema(defaultfalse). Plain[Hidden]hides an item from the help listing but leaves it fully visible in__schemaoutput. SettingSchema = trueis wired through the generator pipeline but has no effect on namespace__schemaoutput yet — see below.Generator pipeline
A new
GetHiddenFlagshelper replacesHasHiddenAttributeeverywhere in the generator. It returns a(HideHelp, HideSchema)pair by reading the named properties from the attribute. Both flags flow asIsHidden(help gate) andIsHiddenInSchema(schema gate) onCommandModel,ParameterModel,RegistryNode.NamedCommandNamespaceChild,ChildNamespaceSnapshot, andAIMapNamespace.Help output
The root and namespace help printers now filter child namespaces where
IsHiddenistrue. A hidden namespace is still fully callable — the dispatch router routes to it normally. Only the listing in the parent's--helpoutput is suppressed.Schema output
The
hidden: trueflag on commands and parameters now requires an explicit[Hidden(Schema = true)]rather than being emitted by every bare[Hidden]. Existing test fixtures that relied on[Hidden]producinghidden: truein schema are updated to[Hidden(Schema = true)]. Thehiddenproperty is NOT yet emitted on namespace objects: the upstream cli-schema meta-schema doesn't define it for namespaces, so adding it caused schema-conformance failures. This is tracked at cli-schema/cli-schema#7.Verify
Breaking:
[Hidden]on a command method or parameter no longer emitshidden: truein__schemaoutput by default. Use[Hidden(Schema = true)]to restore that behaviour.Out of scope:
hiddenon namespace__schemaobjects is deferred pending the upstream meta-schema change at cli-schema/cli-schema#7.[MiddlewareAttribute<T>]on a class (namespace-level middleware) is also a natural companion but requires non-trivial generator changes and will be addressed separately.🤖 Generated with Claude Code