DEV Community

rocky
rocky

Posted on

SelfCmd – Simplify SSH Connections, Custom Commands, and AI Debugging

SelfCmd is a personal command center engineered for software engineers, system administrators, and DevOps teams. It unifies SSH/serial connection management, a reusable Command Library (Cmd Lib), cross-platform local and remote command execution, and AI-driven automated error diagnostics into a single interface.

1. Connection Management (Connections)
SelfCmd provides a central hub for managing remote host connections, network discovery, and embedded interactive sessions.
1.1 Creating a New Connection
1.Access Connections: Navigate to the Connections tab in the left sidebar to open the Connection Manager.
2.Add Connection: Click Add in the top toolbar and select Add one manually... (or utilize Scan for subnet discovery or Bulk Import).
3.Configure Connection Parameters: Fill out the required connection fields in the dialog:

  • Connection Name / Server Address: Set the alias and target IP address (e.g., 172.19.156.217).
  • Port & Username: Define the SSH port (default 22) and target account (e.g., rocky).
  • Auth Method: Choose between Password or SSH Key authentication.
  • Bastion Host: Enable Use a jump host (bastion) if tunneling is required.
  • Group & Tags: Categorize hosts into groups (e.g., Ungrouped) and comma-separated tags (e.g., prod, web, db).
  • MCP / AI Access: Define AI agent execution permissions (e.g., Full (read & run)). 4.Test & Save: Click Test Connection. Upon receiving the success confirmation (Connection test succeeded!), click OK or Save and add next.

1.2 Integrated Terminal & File Manager
SelfCmd integrates powerful inline session tools directly within the Connection Manager:
●Interactive Terminal: Launch an active SSH session directly in a dedicated tab or pop-up window.
●File Management & Verification: Switch to the Files tab to browse remote file structures, perform drag-and-drop file transfers, edit files directly, and generate MD5 checksums for integrity verification.

2. Command Library & Custom Command Management (Cmd Lib)
The Cmd Lib feature allows users to transform frequent shell commands and diagnostic scripts into interactive, reusable buttons.

2.1 Adding a Built-in Command
1.Navigate to the Cmd Lib tab and click + Add.
2.Configure the command properties:

  • Command Name: Give the command a descriptive label (e.g., print route table).
  • Command Content: Input the script payload (e.g., route print -4). Multiple statements can be separated by semicolons or newlines.
  • Condition / Template Inserts: Utilize {name} placeholders to turn scripts into dynamic parameter templates.
  • Group & Tags: Assign to a designated group (e.g., Default Group) and tags (e.g., network, diagnostic).
  • Local Command Flag: Check Local command (run on this machine) if the command should execute locally rather than over SSH. 3.Click OK to save the command to the button library.

3. Unified Command Execution Engine
SelfCmd's execution bar provides seamless switching between local operating system execution and remote SSH server execution.

3.1 Cyclic & Scheduled Execution (Repeat Mode)
For ongoing monitoring tasks (e.g., watching disk utilization, process health, or queue depth):
●Enable the Repeat checkbox on the execution bar.
●Set the interval duration (e.g., 5 s).
●SelfCmd will automatically execute the target command periodically and update the log console.

4. AI-Powered Error Diagnosis (AI Diagnose)
When command execution fails or returns non-zero status codes, SelfCmd leverages built-in AI intelligence to analyze logs and deliver root-cause breakdowns.
4.1 Diagnostic Workflow
1.Upon receiving a command failure (e.g., [FAIL] exit=127), select the error log text or click AI Diagnose on the toolbar.
2.Alternatively, right-click any selected log text in the Operation Log pane and choose AI Diagnose (selection / whole log).


4.2 Diagnostic Output Structure
The AI Diagnosis panel formats output into four structured analytical sections:
●Verdict: Clear, concise identification of why the script failed (e.g., missing binary or missing executable in system PATH).
●Error Summary: Grouping of distinct error messages and exit code occurrences.
●Likely Root Causes: Ranked probable causes, such as missing dependencies, environment variable misconfigurations, or syntax errors.
●Next Diagnostic Steps: Executable, safe troubleshooting commands ready for copy-pasting to verify environment state and apply fixes.

Top comments (0)