MCPcopy Create free account
hub / github.com/Microck/opencode-studio / fetchCommands

Function fetchCommands

client-next/src/app/commands/page.tsx:36–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 const [editingCmd, setEditingCmd] = useState<{ originalName: string, name: string, template: string } | null>(null);
35
36 const fetchCommands = async () => {
37 try {
38 setLoading(true);
39 const data = await getCommands();
40 const entries = Object.entries(data).map(([name, value]) => ({
41 name,
42 template: value.template,
43 }));
44 setCommands(entries);
45 } catch (err: any) {
46 toast.error("Failed to load commands");
47 console.error(err);
48 } finally {
49 setLoading(false);
50 }
51 };
52
53 useEffect(() => {
54 fetchCommands();

Callers 4

CommandsPageFunction · 0.85
handleAddFunction · 0.85
handleEditSaveFunction · 0.85
handleDeleteFunction · 0.85

Calls 1

getCommandsFunction · 0.90

Tested by

no test coverage detected