Agent skill · Audited from source
Add Wshcmd
skill · wavetermdev/wavetermApache-2.0 licenceAudited 3 Oct 2026 · source 63907843412f
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 63907843412f and found no filesystem, network or shell access and no hard-coded secrets. What it does: Guide for adding new wsh commands to Wave Terminal. Use when implementing new CLI commands, adding command-line functionality, or extending the wsh command interface.
Cite
Cite this page
ModelsAtlas. “Add Wshcmd (wavetermdev/waveterm)”. Retrieved 3 Oct 2026. https://modelsatlas.com/skills/wavetermdev/add-wshcmd
Trust audit
Audit 0.4.1 · source read 3 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha 63907843412f · 3 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherwavetermdev GitHub organizationOwner of the repository this skill is read from
- Source folderwavetermdev/waveterm/.kilocode/skills/add-wshcmdThe exact folder we audited
- LicenceApache-2.0As the repository states it
- Commit pinned for this verdict63907843412fA new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Guide for adding new wsh commands to Wave Terminal. Use when implementing new CLI commands, adding command-line functionality, or extending the wsh command interface.
---
name: add-wshcmd
description: Guide for adding new wsh commands to Wave Terminal. Use when implementing new CLI commands, adding command-line functionality, or extending the wsh command interface.
---
# Adding a New wsh Command to Wave Terminal
This guide explains how to add a new command to the `wsh` CLI tool.
## wsh Command System Overview
Wave Terminal's `wsh` command provides CLI access to Wave Terminal features. The system uses:
1. **Cobra Framework** - CLI command structure and parsing
2. **Command Files** - Individual command implementations in `cmd/wsh/cmd/wshcmd-*.go`
3. **RPC Client** - Communication with Wave Terminal backend via `RpcClient`
4. **Activity Tracking** - Telemetry for command usage analytics
5. **Documentation** - User-facing docs in `docs/docs/wsh-reference.mdx`
Commands are registered in their `init()` functions and execute through the Cobra framework.
## Step-by-Step Guide
### Step 1: Create Command File
Create a new file in `cmd/wsh/cmd/` named `wshcmd-[commandname].go`:
```go
// Copyright 2025, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/wavetermdev/waveterm/pkg/wshrpc"
"github.com/wavetermdev/waveterm/pkg/wshrpc/wshclient"
)
var myCommandCmd = &cobra.Command{
Use: "mycommand [args]",
Short: "Brief description of what this command does",
Long: `Detailed description of the command.
Can include multiple lines and examples of usage.`,
RunE: myCommandRun,
PreRunE: preRunSetupRpcClient, // Include if command needs RPC
DisableFlagsInUseLine: true,
}
// Flag variables
var (
myCommandFlagExample string
myCommandFlagVerbose bool
)
func init() {
// Add command to root
rootCmd.AddCommand(myCommandCmd)
// Define flags
myCommandCmd.Flags().StringVarP(&myCommandFlagExample, "example", "e", "", "example flag description")
myCommandCmd.Flags().BoolVarP(&myCommandFlagVerbose, "verbose", "v", false, "enable verbose output")
}
func myCommandRun(cmd *cobra.Command, args []string) (rtnErr error) {
// Always track activity for telemetry
defer func() {
sendActivity("mycommand", rtnErr == nil)
}()
// Validate arguments
if len(args) == 0 {
OutputHelpMessage(cmd)
return fmt.Errorf("requires at least one argument")
}
// Command implementation
fmt.Printf("Command executed successfully\n")
return nil
}
```
**File Naming Convention:**
- Use `wshcmd-[commandname].go` format
- Use lowercase, hyphenated names for multi-word commands
- Examples: `wshcmd-getvar.go`, `wshcmd-setmeta.go`, `wshcmd-ai.go`
### Step 2: Command Structure
#### Basic Command Structure
```go
var myCommandCmd = &cobra.Command{
Use: "mycommand [required] [optional...]",
Short: "One-line description (shown in help)",
Long: `Detailed multi-line description`,
// Argument validation
Args: cobra.MinimumNArgs(1), // Or cobra.ExactArgs(1), cobra.NoArgs, etc.
// Execution function
RunE: myCommandRun,
// Pre-execution setup (if needed)
PreRunE: preRunSetupRpcClient, // Sets up RPC client for backend communication
// Example usage (optional)
Example: " wsh mycommand foo\n wsh mycommand --flag bar",
// Disable flag notation in usage line
DisableFlagsInUseLine: true,
}
```
**Key Fields:**
- `Use`: Command name and argument pattern
- `Short`: Brief description for command list
- `Long`: Detailed description shown in help
- `Args`: Argument validator (optional)
- `RunE`: Main execution function (returns error)
- `PreRunE`: Setup function that runs before `RunE`
- `Example`: Usage examples (optional)
- `DisableFlagsInUseLine`: Clean up help display
#### When to Use PreRunE
Include `PreRunE: preRunSetupRpcClient` if your command:
- Communicates with the Wave Terminal backend
- Needs access to `RpcClient`
- Requires JWT authentication (WAVETERM_JWT env var)
- Makes RPC calls via `wshclient.*Command()` functions
**Don't include PreRunE** for commands that:
- Only manipulate local state
- Don't need backend communication
- Are purely informational/local operations
### Step 3: Implement Command Logic
#### Command Function Pattern
```go
func myCommandRun(cmd *cobra.Command, args []string) (rtnErr error) {
// Step 1: Always track activity (for telemetry)
defer func() {
sendActivity("mycommand", rtnErr == nil)
}()
// Step 2: Validate arguments and flags
if len(args) != 1 {
OutputHelpMessage(cmd)
return fmt.Errorf("requires exactly one argument")
}
// Step 3: Parse/prepare data
targetArg := args[0]
// Step 4: Make RPC call if needed
result, err := wshclient.SomeCommand(RpcClient, wshrpc.CommandSomeData{
Field: targetArg,
}, &wshrpc.RpcOpts{Timeout: 2000})
if err != nil {
return fmt.Errorf("executing command: %w", err)
}
// Step 5: Output results
fmt.Printf("Result: %s\n", result)
return nil
}
```
**Important Patterns:**
1. **Activity Tracking**: Always include deferred `sendActivity()` call
```go
defer func() {
sendActivity("commandname", rtnErr == nil)
}()
```
2. **Error Handling**: Return errors, don't call `os.Exit()`
```go
if err != nil {
return fmt.Errorf("context: %w", err)
}
```
3. **Output**: Use standard `fmt` package for output
```go
fmt.Printf("Success message\n")
fmt.Fprintf(os.Stderr, "Error message\n")
```
4. **Help Messages**: Show help when arguments are invalid
```go
if len(args) == 0 {
OutputHelpMessage(cmd)
return fmt.Errorf("requires arguments")
}
```
5. **Exit Codes**: Set custom exit code via `WshExitCode`
```go
if notFound {
WshExitCode = 1
return nil // Don't return error, just set exit code
}
```
### Step 4: Define FlagsExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 6390784
git clone https://github.com/wavetermdev/waveterm git -C waveterm checkout 63907843412f
The author documents no install command, so this uses the repository directly. Our verdict covers commit 63907843412f only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
63907843412f
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/wavetermdev/add-wshcmd/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →wavetermdev/waveterm
Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC.
wavetermdev/waveterm
Guide for creating WaveEnv narrowings in Wave Terminal. Use when writing a named subset type of WaveEnv for a component tree, documenting environmental dependencies, or enabling mock environments for preview/test server…
wavetermdev/waveterm
Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components.
wavetermdev/waveterm
Guide for adding new configuration settings to Wave Terminal. Use when adding a new setting to the configuration system, implementing a new config key, or adding user-customizable settings.
wavetermdev/waveterm
Guide for adding new RPC calls to Wave Terminal. Use when implementing new RPC commands, adding server-client communication methods, or extending the RPC interface with new functionality.
wavetermdev/waveterm
Guide for creating and displaying context menus in Wave Terminal. Use when implementing right-click menus, adding context menu items, creating submenus, or handling menu interactions with checkboxes and separators.
Add this badge to your README
[](https://modelsatlas.com/skills/wavetermdev/add-wshcmd/)
<a href="https://modelsatlas.com/skills/wavetermdev/add-wshcmd/"><img src="https://modelsatlas.com/skills/wavetermdev/add-wshcmd/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Add Wshcmd
What does the Add Wshcmd skill do?
Is Add Wshcmd safe to install?
What can Add Wshcmd access on my machine?
How current is this page?
Sources
- github.com/wavetermdev/waveterm/tree/main/.kilocode/skills/add-w — the audited source at commit 63907843412f and every finding aboveObserved · 3 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Add Wshcmd skill do?
- Is Add Wshcmd safe to install?
- What can Add Wshcmd access on my machine?