<!DOCTYPE html>
<html lang="en">

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Electron CMD <title>Electron CMD</title>
<style>
body {
font-family: monospace;
background-color: #000;
color: #0f0;
padding: 20px;
}
textarea {
width: 100%;
height: 300px;
background-color: #000;
color: #0f0;
border: 1px solid #0f0;
}
input {
width: 80%;
padding: 10px;
background-color: #000;
color: #0f0;
border: 1px solid #0f0;
}
button {
padding: 10px;
background-color: #0f0;
color: #000;
border: none;
}
</style>


Electron CMD


<textarea id="output" readonly></textarea>


<button onclick="runCommand()">Çalıştır</button>

<script>
const { ipcRenderer } = require('electron');

function runCommand() {
const commandInput = document.getElementById('command');
const command = commandInput.value.trim();
if (!command) return;

ipcRenderer.send('run-command', command);

ipcRenderer.on('command-result', (event, result) => {
const output = document.getElementById('output');
output.value += `> ${command}\n${result}\n`;
output.scrollTop = output.scrollHeight;
});

commandInput.value = '';
}
</script>