Command Suggestions
ProfessionalContext-aware AI-powered command recommendations based on device type, session state, and output analysis.
Overview
Command Suggestions provide context-aware, AI-powered command recommendations based on the device type you are connected to, your current session state, and the output of recent commands. Suggestions appear inline as you type or can be explicitly triggered, giving you immediate access to the right commands for the platform you are working on.
Command Suggestions offer three modes of assistance:
- Inline Autocomplete — As you type in the terminal, the AI predicts the command you are entering and offers completions based on the device platform (Cisco IOS, NX-OS, Juniper Junos, Arista EOS, Palo Alto PAN-OS) and your current command mode.
- Next-Step Suggestions — After you execute a command, the AI analyzes the output and suggests follow-up commands. For example, after running
show ip bgp summary, it might suggest investigating a neighbor that is in Active state. - Output Analysis — The AI interprets command output and provides a plain-language summary with actionable recommendations. It highlights anomalies, errors, and potential issues in the output.
Command Suggestions use the same credential sanitization pipeline as AI Chat. Any terminal output sent for analysis is sanitized before reaching the LLM provider. See AI Chat for details on how sanitization works.
How It Works
Command Suggestions operate through a pipeline that gathers context from your terminal session, generates suggestions via the configured LLM provider, and presents ranked results inline.
Context Gathering
When suggestions are triggered, NetStacks collects the following context to build a device-specific prompt:
- Device Type and OS Version — The detected platform determines which command syntax is valid. A Cisco IOS device gets
show ip bgpsuggestions while a Juniper Junos device getsshow route protocol bgp. - Current Command Mode — Whether you are in user exec, privileged exec, global config, or interface config mode affects which commands are available.
- Recent Command History — The last several commands in your session provide context about what you are trying to accomplish.
- Last Command Output — The output of your most recent command is analyzed for anomalies and used to generate context-aware follow-up suggestions.
Suggestion Generation
The gathered context is sent to the configured LLM provider with a device-specific prompt template. The AI generates candidate commands, which are then ranked and filtered:
- Syntax Validation — Suggestions are checked against known command patterns for the detected platform.
- Relevance Ranking — Commands are ordered by how relevant they are to your current workflow.
- Deduplication — Duplicate or near-duplicate suggestions are merged.
Output Analysis
After you execute a command, the AI can analyze the output to provide:
- A plain-language summary of the output
- Identification of anomalies or errors
- Specific follow-up commands to investigate issues
- Comparisons to expected baselines where applicable
Using Command Suggestions
Command Suggestions work automatically once configured. Here is how to use them during a terminal session.
- Connect to a device — Open an SSH session to any managed device. NetStacks automatically detects the device type and operating system from the login banner and prompt.
- Begin typing a command — As you type, inline suggestions appear below your cursor. The suggestions are filtered in real-time as you continue typing.
- Accept a suggestion — Press
Tabto accept the top suggestion, or useAlt+]andAlt+[to cycle through alternatives. PressEscto dismiss. - Trigger suggestions manually — Press
Cmd/Ctrl+Spaceto explicitly request suggestions at any point, even if you have not started typing. - Review output analysis — After a command executes, look for the analysis indicator in the terminal margin. Click it to expand the AI interpretation of the output, including suggested next steps.
Keyboard Shortcuts
| Action | Shortcut |
|---|---|
| Trigger suggestions | Cmd/Ctrl+Space |
| Accept suggestion | Tab |
| Next suggestion | Alt+] |
| Previous suggestion | Alt+[ |
| Dismiss suggestions | Esc |
Code Examples
Inline Suggestions on Juniper Junos
When connected to a Juniper Junos device and typing show bgp, the AI suggests platform-appropriate commands:
user@edge-rtr-01> show bgp
Suggestions:
> show bgp summary
> show bgp neighbor
> show bgp group
> show bgp neighbor 10.0.1.2 detail
> show route protocol bgp table inet.0Output Analysis: BGP Summary on Cisco IOS
After running show ip bgp summary, the AI analyzes the output and suggests follow-up commands for neighbors with issues:
core-rtr-01# show ip bgp summary
BGP router identifier 10.255.0.1, local AS number 65001
BGP table version is 48263, main routing table version 48263
4521 network entries using 1130250 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer Up/Down State/PfxRcd
10.0.1.2 4 65002 45892 44201 48263 15d02h 2850
10.0.1.6 4 65003 38201 37992 48263 15d02h 1420
10.0.2.2 4 65004 0 0 0 never Active
10.0.2.6 4 65005 12045 11998 48263 3d14h 251
--- AI Analysis ---
Summary: 4 BGP neighbors configured. 3 are Established, 1 has never
come up.
Issues Found:
[WARNING] Neighbor 10.0.2.2 (AS 65004) is in Active state and has
never established a session. This indicates a connectivity or
configuration problem.
Suggested Commands:
1. show ip bgp neighbor 10.0.2.2
(Check detailed neighbor state and error messages)
2. ping 10.0.2.2 source Loopback0
(Verify IP reachability to the neighbor)
3. show ip route 10.0.2.2
(Confirm routing to neighbor address)
4. show logging | include BGP|NOTIFICATION|10.0.2.2
(Check for BGP notifications or errors)Platform-Specific Suggestions: VLAN Configuration
The same task produces different suggestions depending on the detected device platform:
! Cisco IOS - Creating VLAN 100
core-sw-01(config)# vlan 100
Suggestions:
> name Engineering-Data
> state active
> exit
> interface range GigabitEthernet1/0/1 - 24! Arista EOS - Creating VLAN 100
leaf-sw-01(config)# vlan 100
Suggestions:
> name Engineering-Data
> trunk group MLAG-Trunk
> state active
> interface Ethernet1-24! Juniper Junos - Creating VLAN 100
user@dist-sw-01# set vlans Engineering-Data
Suggestions:
> set vlans Engineering-Data vlan-id 100
> set vlans Engineering-Data l3-interface irb.100
> set vlans Engineering-Data description "Engineering data VLAN"
> set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members Engineering-DataQuestions & Answers
- How does the AI know which commands to suggest?
- The AI uses a combination of your current device type, operating system version, command mode (user exec, privileged exec, configuration), recent command history, and the output of your last command. This context is sent to the configured LLM provider with a device-specific prompt template that constrains the AI to suggest valid commands for your platform.
- Do suggestions work for all device types?
- Suggestions work for all device types that NetStacks supports, including Cisco IOS, IOS-XE, NX-OS, Juniper Junos, Arista EOS, Palo Alto PAN-OS, and Linux/Unix systems. The quality of suggestions depends on the LLM model's training data for each platform. Major platforms like Cisco IOS and Juniper Junos typically produce the most accurate suggestions.
- Can I disable command suggestions?
- Yes. You can disable suggestions globally in Settings > AI Assistant, or per-session by toggling the suggestions icon in the terminal toolbar. You can also adjust the suggestion trigger delay to control how quickly suggestions appear after you stop typing.
- How does output analysis work?
- After you execute a command, NetStacks captures the terminal output and sends it (sanitized) to the LLM with a prompt asking for analysis. The AI identifies key information, anomalies, errors, and potential issues. It then generates a plain-language summary and suggests follow-up commands to investigate any problems it found. Output analysis is triggered automatically for common show commands and can be manually requested for any output.
- Are suggestions device-type specific?
- Yes. NetStacks detects the device type during session establishment and uses platform-specific prompt templates. A Cisco IOS device receives IOS command syntax while a Juniper Junos device receives Junos CLI syntax. If the device type is incorrectly detected, you can manually override it in the session settings to ensure accurate suggestions.
Troubleshooting
| Issue | Possible Cause | Solution |
|---|---|---|
| Suggestions not appearing | LLM provider not configured or feature disabled | Verify an LLM provider is configured and enabled at LLM Configuration. Check that suggestions are enabled in Settings > AI Assistant. Ensure the suggestion trigger delay is not set too high. |
| Wrong device type detected | Unusual login banner or prompt format | Manually set the device type in the session settings panel. NetStacks detects device type from the login banner and prompt pattern. Custom or modified prompts may cause incorrect detection. |
| Suggestions for wrong platform | Device OS detection mismatch | Check the detected device type in the session info panel. Override it if incorrect. For example, a Cisco NX-OS device may be misdetected as IOS if the prompt is customized. |
| Slow suggestion response | Large model or high latency to provider | Consider using a faster, smaller model for suggestions (suggestions benefit from speed over reasoning depth). In LLM Configuration, you can assign different models to different AI features. |
| Output analysis not triggering | Feature not enabled or unsupported command | Output analysis triggers automatically for recognized show commands. For other commands, click the analysis icon in the terminal margin to manually request analysis. Ensure the feature is enabled in AI settings. |
Related Features
- AI Chat — Full conversational AI assistance with credential sanitization and copilot panel for extended troubleshooting sessions.
- LLM Configuration — Configure AI providers, select models for each feature, and manage token budgets.
- Terminal Overview — The terminal environment where command suggestions operate alongside your SSH sessions.
- Device Types — Supported device platforms and how NetStacks detects them for platform-specific suggestions.
- Quick Prompts — Pre-built prompt templates for common network operations tasks that complement AI suggestions.