MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / execCmd

Function execCmd

app/src/modules/input.js:87–124  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

85}
86
87function execCmd(cmd) {
88 cmd = normalizeSlashCommandInput(cmd) || String(cmd || '').trim().toLowerCase();
89 hideCmdMenu();
90 $input.value = '';
91 $input.style.height = 'auto';
92 updateSendBtn();
93
94 if (cmd === '/model') {
95 showModelPicker();
96 return;
97 }
98
99 if (cmd === '/cost') {
100 closeGroup();
101 const el = document.createElement('div');
102 el.className = 'user-msg';
103 el.textContent = '/cost';
104 $msgs.appendChild(el);
105 scrollEnd();
106 sendSlashCmd(cmd);
107 return;
108 }
109
110 if (cmd === '/clear') {
111 clearConversationUi();
112 S.sessionId = '';
113 S.resumeRequestedFor = '';
114 sendSlashCmd(cmd);
115 return;
116 }
117
118 const fb = CMD_FEEDBACK[cmd];
119 if (fb) {
120 if (fb.overlay) showCmdOverlay(fb.label);
121 else if (fb.toast) showToast(fb.toast);
122 }
123 sendSlashCmd(cmd);
124}
125
126export function sendSlashCmd(text) {
127 if (!S.ws || S.ws.readyState !== WebSocket.OPEN) return;

Callers 3

showCmdMenuFunction · 0.70
sendFunction · 0.70
initInputFunction · 0.70

Calls 10

showModelPickerFunction · 0.90
closeGroupFunction · 0.90
scrollEndFunction · 0.90
clearConversationUiFunction · 0.90
showToastFunction · 0.90
hideCmdMenuFunction · 0.70
updateSendBtnFunction · 0.70
sendSlashCmdFunction · 0.70
showCmdOverlayFunction · 0.70

Tested by

no test coverage detected