Plugin cloning via menu (#6433)
* Add plugin cloning via menu * Split plugin commands by action * Keep plugin enablement in action commands * Remove unused plugin edit command * Simplify plugin rescan arguments * Assume Omarchy shell is running for plugin commands * Remove plugin compatibility dispatcher * Flatten plugin clone command * Keep only shared plugin helpers * Remove plugin rescan wrapper * Keep plugin commands self-contained * Simplify plugin clone lifecycle
This commit is contained in:
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=List discovered shell plugins
|
||||
# omarchy:group=plugin
|
||||
# omarchy:args=[--json]
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
json="false"
|
||||
|
||||
while (( $# > 0 )); do
|
||||
case "$1" in
|
||||
--json)
|
||||
json="true"
|
||||
;;
|
||||
-h | --help)
|
||||
echo "Usage: omarchy plugin list [--json]"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "omarchy-plugin-list: unknown option: $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
plugins=$(omarchy-shell shell listPlugins)
|
||||
|
||||
if [[ $json == "true" ]]; then
|
||||
printf '%s\n' "$plugins"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
jq -r '
|
||||
.[] |
|
||||
[ .id,
|
||||
(if .enabled then "enabled" else "disabled" end),
|
||||
(if .firstParty then "first-party" else "third-party" end),
|
||||
((.kinds // []) | join(",")),
|
||||
(.name // "")
|
||||
] | @tsv
|
||||
' <<<"$plugins" | awk -F '\t' '
|
||||
BEGIN { printf "%-32s %-9s %-11s %-18s %s\n", "ID", "STATE", "SOURCE", "KINDS", "NAME" }
|
||||
{ printf "%-32s %-9s %-11s %-18s %s\n", $1, $2, $3, $4, $5 }
|
||||
'
|
||||
Reference in New Issue
Block a user