Menu Manager
Skill: infrahub-managing-menus
The Menu Manager produces and restructures YAML menu definition files that customize the Infrahub web UI sidebar. Menus can be flat or deeply nested, with group headers, icons, and ordering. The skill keeps the nesting valid: items sharing a namespace and name collapse into one entry, and an item missing either is rejected by the menu loader.
When to use
- Adding a custom structure alongside Infrahub's auto-generated sidebar navigation
- Grouping schema nodes into logical sections (e.g., "Network Topology", "Inventory", "Circuits")
- Placing your own nodes inside a section Infrahub already ships, such as IPAM
- Adding nested sub-menus and section headers
- Controlling the ordering of menu items
- Reordering, renaming, or regrouping an existing menu, or working out why an item does not appear or sits in the wrong group
What it produces
- YAML file with
apiVersion,kind: Menu, and aspec.datablock containing the menu tree - Loaded into Infrahub alongside schema and object files
Example prompts
- "Create a menu with sections for Network Topology, Circuits, and Inventory, each with relevant schema nodes nested underneath"
- "Put my VLAN and VRF entries under the IPAM section Infrahub already has"
- "Build a flat menu that lists Device, Interface, Site, and Rack in that order"
- "Add a nested sub-menu under Network Topology for BGP with entries for BGP Sessions and BGP Peers"
- "Move BGP Sessions out of Network Topology into its own section, placed after IP Management"
Key rules enforced
spec.datawrapping: the top-level menu items must be inspec.data; a common mistake is writingspec:followed by a list directlychildren.datawrapping: nested items must usechildren.data:notchildren:directly; this is the most common nesting mistakekindvspath: each item uses eitherkind:(links to a schema node's list view) orpath:(links to a custom URL), never both- Built-in sections: Infrahub ships its own top-level sections; the skill attaches your nodes to the two that hold object data (
OtherandIPAM) withparent: [Builtin, IPAM]instead of declaring a second one, and keeps clear of the platform sections such as Branches and Object Management - Group headers: section headers with no link (no
kindorpath) are valid and used for visual grouping - Icon format: icons use the Material Design Icons format with
mdi:prefix (e.g.,mdi:server,mdi:ip-network) order_weight: integer controlling item display order; lower numbers appear first
Common mistakes it catches
| Mistake | What the skill does instead |
|---|---|
Registering the menu under menu: (singular) in .infrahub.yml | Uses menus: (plural), matching every other registration key; the singular form is rejected as extra_forbidden |
Nesting children directly under children: | Wraps nested items in children.data, the same shape every paginated Infrahub response uses |
Setting both kind and path on one item | Uses exactly one; both together fail the whole menu file to load, and the sidebar falls back to the auto-generated menu |
Leaving the menu unregistered in .infrahub.yml | Includes the registration comment in the output file so it isn't missed |
| Deviating from the fixed envelope | Always emits apiVersion, kind: Menu, and spec.data; a deviation fails to load and falls back to the auto-generated menu |
Loading it
Load a menu file into a running Infrahub instance:
infrahubctl menu load <menu-file>