main
1# frozen_string_literal: true
2
3Elelem::Plugins.register(:list) do |agent|
4 agent.toolbox.add("list",
5 description: "List directory contents",
6 params: { path: { type: "string" }, recursive: { type: "boolean" } },
7 required: [],
8 aliases: ["ls"]
9 ) do |a|
10 path = a["path"] || "."
11 flags = a["recursive"] ? "-laR" : "-la"
12 agent.toolbox.exec("ls", flags, path)
13 end
14end