cmd
Recipe card from the charly-core plugin (Commands — runtime CLI verbs).
charly cmd – Single Command Execution
Section titled “charly cmd – Single Command Execution”Overview
Section titled “Overview”Runs a single command inside a running container via <engine> exec and sends a D-Bus desktop notification when the command completes. Useful for one-off commands without opening an interactive shell.
Quick Reference
Section titled “Quick Reference”| Action | Command | Description |
|---|---|---|
| Run command | charly cmd <image> "command" |
Execute command in running container |
| With instance | charly cmd <image> "command" -i 2 |
Target specific instance |
| With env vars | charly cmd <image> "command" -e KEY=VALUE |
Pass environment variables |
# Run a command in a running containercharly cmd fedora "uname -a"
# Run with environment variablescharly cmd jupyter "python script.py" -e CUDA_VISIBLE_DEVICES=0
# Target a specific instancecharly cmd ollama "ollama list" -i 2| Flag | Description |
|---|---|
-i, --instance INSTANCE |
Target a specific container instance (default: 1) |
-e, --env KEY=VALUE |
Pass environment variables to the command |
--sidecar NAME |
Run in the named SIDECAR container (charly-<box>[-<inst>]-<name>) instead of the app container |
Behavior
Section titled “Behavior”- The container must already be running (
charly start <image>) - Agent forwarding (SSH/GPG) env vars are injected automatically if enabled
- A D-Bus desktop notification is sent on command completion (success or failure)
- For interactive shells, use
charly shellinstead - For persistent sessions or long-running commands, use the typed
charly agent terminalprovider.
Cross-References
Section titled “Cross-References”-
/charly-build:pull– Prerequisite: fetch the image into local storage; handles remote refs (@github.com/...) and theErrImageNotLocalrecovery path -
/charly-core:shell– Interactive shell sessions with workspace mounts -
/charly-check:dbus– D-Bus interaction inside containers -
/charly-automation:tmux– Typed persistent terminal sessions for long-running commands