MCPcopy Create free account
hub / github.com/TechSpiritSS/Terminal-Portfolio / commandHistory

Function commandHistory

scripts/history.js:4–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { createText, getInputValue } from "./functions.js";
3//end imports
4export async function commandHistory(){
5 let record = JSON.parse(localStorage.getItem("history")) || [];
6 if(record.length === 0){
7 await createText("No History Found!");
8 }else{
9 await createText("Previously used commands are: ");
10 for(let i=0;i<record.length;++i){
11 await createText((i+1).toString() + ".) " + record[i]);
12 }
13 await createText("To run a specific cmd from history, run history {id} where id is the id of that cmd in histroy")
14 }
15}
16
17export async function runSpecificHistoryCmd(id) {
18 let record = JSON.parse(localStorage.getItem("history")) || [];

Callers 1

getInputValueFunction · 0.90

Calls 1

createTextFunction · 0.90

Tested by

no test coverage detected