You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns `true` on success, or `false, reason` if the key is already owned by cliamp's core UI or the plugin lacks the `keymap` permission. Pass a description string as the middle argument to surface the binding in the `Ctrl+K` keymap overlay; omit it for an internal-only binding.
191
+
192
+
Key strings are in Bubbletea's `msg.String()` form: lowercase letters, `ctrl+` / `shift+` / `alt+` prefixes (e.g. `"x"`, `"ctrl+e"`, `"shift+f1"`). Case-insensitive.
193
+
194
+
Plugin keys only fire in the main view — overlays like the file browser, theme picker, and keymap itself capture their own input. Core reserves all keys documented in `docs/keybindings.md`; trying to bind one of those logs a warning and returns `false`.
-- args is an array of strings passed after the command name
203
+
return"done: " ..args[1]
204
+
end)
205
+
```
206
+
207
+
The callback can return a string, which is printed by the CLI client. Commands are invoked from the shell via `cliamp plugins call <plugin-name> <command> [args...]` and dispatched to the running cliamp over IPC. Since dispatch runs in the running player, commands don't need a separate permission (they're user-initiated).
208
+
209
+
List all registered commands with `cliamp plugins commands`. Commands can run for up to 5 minutes before timing out.
210
+
170
211
## Lua API
171
212
172
213
All APIs are under the `cliamp` global table.
@@ -232,9 +273,11 @@ cliamp.fs.append(path, content) -- append to file
Writes are restricted to `/tmp/`, `~/.config/cliamp/`, and `~/.local/share/cliamp/`. Reads are allowed from anywhere.
280
+
Writes are restricted to `/tmp/`, `~/.config/cliamp/`, `~/.local/share/cliamp/`, and `~/Music/cliamp/`. Reads are allowed from anywhere.
238
281
239
282
### cliamp.json
240
283
@@ -297,6 +340,46 @@ cliamp.notify("Song Title", "Artist Name") -- notification with title and body
297
340
298
341
Sends a desktop notification via `notify-send`. Works with mako, dunst, and other notification daemons.
299
342
343
+
### cliamp.exec (requires permissions)
344
+
345
+
Plugins that declare `permissions = {"exec"}` can spawn subprocesses from a configurable binary allowlist. Default allowlist: `yt-dlp`, `ffmpeg`. Extend it in `config.toml`:
346
+
347
+
```toml
348
+
[plugins]
349
+
allowed_binaries = "ffprobe, curl"# merged with defaults
0 commit comments