Currently all commands in command_transcripts are available regardless of the current CLI context. On real network equipment, commands like show running-config require privileged exec (#) and are not available from user exec (>).
Proposed design
Add an optional context_commands map to Platform config that whitelists which commands are available in each context:
context_commands:
">": ["enable", "exit"]
"#": ["show version", "show running-config", "configure terminal", "exit", "end"]
"(config)#": ["interface", "hostname", "exit", "end"]
"(config-if)#": ["ip address", "no shutdown", "exit", "end"]
When a command is entered in a context where it is not whitelisted, return the standard IOS error:
% Invalid input detected at '^' marker.
If context_commands is not set for a platform, all commands remain available in all contexts (backward compatible).
Notes
- This is a significant architectural addition
- Platforms without context_commands are unaffected
- Useful for testing tools that validate they are in the correct context before issuing commands
Currently all commands in
command_transcriptsare available regardless of the current CLI context. On real network equipment, commands likeshow running-configrequire privileged exec (#) and are not available from user exec (>).Proposed design
Add an optional
context_commandsmap to Platform config that whitelists which commands are available in each context:When a command is entered in a context where it is not whitelisted, return the standard IOS error:
If
context_commandsis not set for a platform, all commands remain available in all contexts (backward compatible).Notes