diff --git a/command-signatures/json/podman.json b/command-signatures/json/podman.json new file mode 100644 index 00000000..0e2ccad2 --- /dev/null +++ b/command-signatures/json/podman.json @@ -0,0 +1,4158 @@ +{ + "name": "podman", + "description": "Manage pods, containers and images", + "options": [ + { + "name": "--cgroup-manager", + "description": "Cgroup manager to use (\"cgroupfs\"|\"systemd\") (default \"cgroupfs\")", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--config", + "description": "Location of authentication config file", + "args": { "name": "string", "template": "filepaths" }, + "isPersistent": true + }, + { + "name": "--conmon", + "description": "Path of the conmon binary", + "args": { "name": "string", "template": "filepaths" }, + "isPersistent": true + }, + { + "name": [ + "-c", + "--connection" + ], + "description": "Connection to use for remote Podman service (CONTAINER_CONNECTION)", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--events-backend", + "description": "Events backend to use (\"file\"|\"journald\"|\"none\") (default \"file\")", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--hooks-dir", + "description": "Set the OCI hooks directory path (may be set multiple times)", + "args": { "name": "path", "template": "folders" }, + "isPersistent": true + }, + { + "name": "--identity", + "description": "Path to SSH identity file (CONTAINER_SSHKEY)", + "args": { "name": "string", "template": "filepaths" }, + "isPersistent": true + }, + { + "name": "--imagestore", + "description": "Path to a separate 'image store' directory, split out from the graph root", + "args": { "name": "string", "template": "folders" }, + "isPersistent": true + }, + { + "name": "--log-level", + "description": "Log messages above specified level (trace, debug, info, warn, warning, error, fatal, panic) (default \"warn\")", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--module", + "description": "Load the containers.conf(5) module", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--network-cmd-path", + "description": "Path to the command for configuring the network", + "args": { "name": "string", "template": "filepaths" }, + "isPersistent": true + }, + { + "name": "--network-config-dir", + "description": "Path of the configuration directory for networks", + "args": { "name": "string", "template": "folders" }, + "isPersistent": true + }, + { + "name": "--out", + "description": "Send output (stdout) from podman to a file", + "args": { "name": "string", "template": "filepaths" }, + "isPersistent": true + }, + { + "name": [ + "-r", + "--remote" + ], + "description": "Access remote Podman service", + "isPersistent": true + }, + { + "name": "--root", + "description": "Path to the graph root directory where images, containers, etc. are stored", + "args": { "name": "string", "template": "folders" }, + "isPersistent": true + }, + { + "name": "--runroot", + "description": "Path to the 'run directory' where all state information is stored", + "args": { "name": "string", "template": "folders" }, + "isPersistent": true + }, + { + "name": "--runtime", + "description": "Path to the OCI-compatible binary used to run containers (default \"crun\")", + "args": { "name": "string", "template": "filepaths" }, + "isPersistent": true + }, + { + "name": "--runtime-flag", + "description": "Add global flags for the container runtime", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--ssh", + "description": "Define the ssh mode (default \"golang\")", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--storage-driver", + "description": "Select which storage driver is used to manage storage of images and containers", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--storage-opt", + "description": "Used to pass an option to the storage driver", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--syslog", + "description": "Output logging information to syslog as well as the console (default false)", + "isPersistent": true + }, + { + "name": "--tmpdir", + "description": "Path to the tmp directory for libpod state content", + "args": { "name": "string", "template": "folders" }, + "isPersistent": true + }, + { + "name": "--transient-store", + "description": "Enable transient container storage", + "isPersistent": true + }, + { + "name": "--url", + "description": "URL to access Podman service (CONTAINER_HOST)", + "args": { "name": "string" }, + "isPersistent": true + }, + { + "name": "--volumepath", + "description": "Path to the volume directory in which volume data is stored", + "args": { "name": "string", "template": "folders" }, + "isPersistent": true + } + ], + "subcommands": [ + { + "name": "artifact", + "description": "Manage OCI artifacts", + "subcommands": [ + { + "name": "add", + "description": "Add an OCI artifact to the local store" + }, + { "name": "inspect", "description": "Inspect an OCI artifact" }, + { "name": "ls", "description": "List OCI artifacts" }, + { "name": "pull", "description": "Pull an OCI artifact" }, + { "name": "push", "description": "Push an OCI artifact" }, + { "name": "rm", "description": "Remove an OCI artifact" } + ] + }, + { + "name": "attach", + "description": "Attach to a running container", + "args": { + "name": "container", + "generatorName": "running_podman_containers" + }, + "options": [ + { + "name": "--detach-keys", + "description": "Select the key sequence for detaching a container (default \"ctrl-p,ctrl-q\")", + "args": { "name": "string" } + }, + { + "name": [ + "-l", + "--latest" + ], + "description": "Act on the latest container podman is aware of (not supported with --remote)" + }, + { "name": "--no-stdin", "description": "Do not attach STDIN" }, + { + "name": "--sig-proxy", + "description": "Proxy received signals to the process (default true)" + } + ] + }, + { + "name": "auto-update", + "description": "Auto update containers according to their auto-update policy", + "options": [ + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--dry-run", + "description": "Check for pending updates" + }, + { + "name": "--format", + "description": "Change the output format to JSON or a Go template", + "args": { "name": "string" } + }, + { + "name": "--rollback", + "description": "Rollback to previous image if update fails (default true)" + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when contacting registries (default true)" + } + ] + }, + { + "name": "build", + "description": "Build an image using instructions from Containerfiles", + "args": { "name": "context", "template": "folders" }, + "options": [ + { + "name": "--add-host", + "description": "Add a custom host-to-IP mapping (host:ip)", + "args": { "name": "list" } + }, + { + "name": "--all-platforms", + "description": "Attempt to build for all base image platforms" + }, + { + "name": "--annotation", + "description": "Set metadata for an image", + "args": { "name": "list" } + }, + { + "name": "--arch", + "description": "Set the architecture of the image instead of the host's (default \"amd64\")", + "args": { "name": "string" } + }, + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--build-arg", + "description": "Supply argument=value to the builder", + "args": { "name": "argument=value" } + }, + { + "name": "--build-context", + "description": "Supply additional build context named argument=value", + "args": { "name": "argument=value" } + }, + { + "name": "--cache-from", + "description": "Remote repository list to use as a potential cache source", + "args": { "name": "list" } + }, + { + "name": "--cache-to", + "description": "Remote repository list to use as a potential cache destination", + "args": { "name": "list" } + }, + { + "name": "--cap-add", + "description": "Add the specified capability when running", + "args": { "name": "list" } + }, + { + "name": "--cap-drop", + "description": "Drop the specified capability when running", + "args": { "name": "list" } + }, + { + "name": "--cert-dir", + "description": "Use certificates at the specified path to access the registry", + "args": { "name": "string", "template": "folders" } + }, + { + "name": "--cgroup-parent", + "description": "Optional parent cgroup for the container", + "args": { "name": "string" } + }, + { + "name": "--compress", + "description": "Legacy option with no effect on the image" + }, + { "name": [ + "-c", + "--cpu-shares" + ], "description": "CPU shares (relative weight)", "args": { "name": "uint" } }, + { + "name": "--cpuset-cpus", + "description": "CPUs in which to allow execution (0-3, 0,1)", + "args": { "name": "string" } + }, + { + "name": "--creds", + "description": "Use [username[:password]] for accessing the registry", + "args": { "name": "username[:password]" } + }, + { + "name": "--decryption-key", + "description": "Key needed to decrypt the image", + "args": { "name": "list" } + }, + { + "name": "--device", + "description": "Additional devices to provide", + "args": { "name": "list" } + }, + { "name": [ + "-D", + "--disable-compression" + ], "description": "Don't compress layers by default (default true)" }, + { + "name": "--dns", + "description": "Set custom DNS servers, or 'none' to disable", + "args": { "name": "list" } + }, + { + "name": "--dns-option", + "description": "Set custom DNS options", + "args": { "name": "list" } + }, + { + "name": "--dns-search", + "description": "Set custom DNS search domains", + "args": { "name": "list" } + }, + { + "name": "--env", + "description": "Set environment variable for the image", + "args": { "name": "list" } + }, + { + "name": [ + "-f", + "--file" + ], + "description": "Pathname or URL of a Containerfile", + "args": { + "name": "pathname or URL", + "template": "filepaths" + } + }, + { + "name": "--force-rm", + "description": "Always remove intermediate containers after a build (default true)" + }, + { + "name": "--format", + "description": "Format of the built image's manifest and metadata (default \"oci\")", + "args": { "name": "format" } + }, + { + "name": "--from", + "description": "Image name used to replace the value in the first FROM instruction", + "args": { "name": "string" } + }, + { + "name": "--iidfile", + "description": "File to write the image ID to", + "args": { "name": "file", "template": "filepaths" } + }, + { + "name": "--ignorefile", + "description": "Path to an alternate .containerignore file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--isolation", + "description": "Type of process isolation to use (default \"rootless\")", + "args": { "name": "type" } + }, + { + "name": "--jobs", + "description": "How many stages to run in parallel (default 1)", + "args": { "name": "int" } + }, + { + "name": "--label", + "description": "Set metadata for an image", + "args": { "name": "list" } + }, + { + "name": "--layers", + "description": "Use intermediate layers during build (default true)" + }, + { + "name": "--logfile", + "description": "Log to file instead of stdout/stderr", + "args": { "name": "file", "template": "filepaths" } + }, + { + "name": "--manifest", + "description": "Add the image to the specified manifest list, creating it if needed", + "args": { "name": "string" } + }, + { "name": [ + "-m", + "--memory" + ], "description": "Memory limit (format: [])", "args": { "name": "string" } }, + { + "name": "--network", + "description": "'private', 'none', 'ns:path' of network namespace to join, or 'host'", + "args": { "name": "string" } + }, + { + "name": "--no-cache", + "description": "Do not use existing cached images for the build" + }, + { + "name": "--os", + "description": "Set the OS of the image instead of the host's (default \"linux\")", + "args": { "name": "string" } + }, + { "name": [ + "-o", + "--output" + ], "description": "Output destination (format: type=local,dest=path)", "args": { "name": "string" } }, + { + "name": "--platform", + "description": "Set OS/ARCH[/VARIANT] of the image instead of the host's", + "args": { "name": "OS/ARCH[/VARIANT]" } + }, + { + "name": "--pull", + "description": "Pull image policy (\"always\"|\"missing\"|\"never\"|\"newer\") (default \"missing\")", + "args": { "name": "string" } + }, + { "name": [ + "-q", + "--quiet" + ], "description": "Refrain from announcing build instructions and image read/write progress" }, + { + "name": "--retry", + "description": "Number of times to retry in case of failure when performing push/pull (default 3)", + "args": { "name": "int" } + }, + { + "name": "--retry-delay", + "description": "Delay between retries in case of push/pull failures", + "args": { "name": "string" } + }, + { + "name": "--rm", + "description": "Remove intermediate containers after a successful build (default true)" + }, + { + "name": "--secret", + "description": "Secret file to expose to the build", + "args": { "name": "list" } + }, + { + "name": "--security-opt", + "description": "Security options", + "args": { "name": "list" } + }, + { + "name": "--shm-size", + "description": "Size of '/dev/shm' (default \"65536k\")", + "args": { "name": "string" } + }, + { + "name": "--squash", + "description": "Squash all image layers into a single layer" + }, + { + "name": "--ssh", + "description": "SSH agent socket or keys to expose to the build", + "args": { "name": "list" } + }, + { "name": [ + "-t", + "--tag" + ], "description": "Tagged name to apply to the built image", "args": { "name": "name" } }, + { + "name": "--target", + "description": "Set the target build stage to build", + "args": { "name": "string" } + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when accessing the registry (default true)" + }, + { + "name": "--ulimit", + "description": "Ulimit options", + "args": { "name": "list" } + }, + { + "name": "--userns", + "description": "'container', path of user namespace to join, or 'host'", + "args": { "name": "path" } + }, + { + "name": "--variant", + "description": "Override the variant of the specified image", + "args": { "name": "variant" } + }, + { "name": [ + "-v", + "--volume" + ], "description": "Bind mount a volume into the container", "args": { "name": "list" } } + ] + }, + { + "name": "commit", + "description": "Create new image based on the changed container", + "args": [ + { + "name": "container", + "generatorName": "all_podman_containers" + }, + { "name": "[image]" } + ], + "options": [ + { "name": [ + "-a", + "--author" + ], "description": "Set the author for the image committed", "args": { "name": "string" } }, + { + "name": [ + "-c", + "--change" + ], + "description": "Apply the given instruction to the created image (CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | ONBUILD | STOPSIGNAL | USER | VOLUME | WORKDIR)", + "args": { "name": "list" } + }, + { + "name": "--config", + "description": "File containing a container configuration to merge into the image", + "args": { "name": "file", "template": "filepaths" } + }, + { "name": [ + "-f", + "--format" + ], "description": "Format of the image manifest and metadata (default \"oci\")", "args": { "name": "format" } }, + { + "name": "--iidfile", + "description": "File to write the image ID to", + "args": { "name": "file", "template": "filepaths" } + }, + { + "name": "--include-volumes", + "description": "Include container volumes as image volumes" + }, + { "name": [ + "-m", + "--message" + ], "description": "Set commit message for imported image", "args": { "name": "string" } }, + { "name": [ + "-p", + "--pause" + ], "description": "Pause container during commit" }, + { "name": [ + "-q", + "--quiet" + ], "description": "Suppress output" }, + { "name": [ + "-s", + "--squash" + ], "description": "Squash newly built layers into a single new layer" } + ] + }, + { + "name": "compose", + "description": "Run compose workloads via an external provider such as docker-compose or podman-compose", + "loadSpec": "docker-compose" + }, + { + "name": "container", + "description": "Manage containers", + "subcommands": [ + { + "name": "attach", + "description": "Attach to a running container" + }, + { + "name": "checkpoint", + "description": "Checkpoint one or more running containers" + }, + { + "name": "cleanup", + "description": "Clean up network and mountpoints of one or more containers" + }, + { + "name": "clone", + "description": "Clone an existing container" + }, + { + "name": "commit", + "description": "Create new image based on the changed container" + }, + { + "name": "cp", + "description": "Copy files/folders between a container and the local filesystem" + }, + { + "name": "create", + "description": "Create but do not start a container" + }, + { + "name": "diff", + "description": "Display the changes to the container's file system" + }, + { + "name": "exec", + "description": "Run a process in a running container" + }, + { + "name": "exists", + "description": "Check if a container exists in local storage" + }, + { + "name": "export", + "description": "Export container's filesystem contents as a tar archive" + }, + { + "name": "init", + "description": "Initialize one or more containers" + }, + { + "name": "inspect", + "description": "Display a container's configuration" + }, + { + "name": "kill", + "description": "Kill one or more running containers with a specific signal" + }, + { "name": "list", "description": "List containers" }, + { + "name": "logs", + "description": "Fetch the logs of one or more containers" + }, + { + "name": "mount", + "description": "Mount a working container's root filesystem" + }, + { + "name": "pause", + "description": "Pause all the processes in one or more containers" + }, + { + "name": "port", + "description": "List port mappings or a specific mapping for the container" + }, + { + "name": "prune", + "description": "Remove all stopped containers" + }, + { "name": "ps", "description": "List containers" }, + { + "name": "rename", + "description": "Rename an existing container" + }, + { + "name": "restart", + "description": "Restart one or more containers" + }, + { + "name": "restore", + "description": "Restore one or more containers from a checkpoint" + }, + { + "name": "rm", + "description": "Remove one or more containers" + }, + { + "name": "run", + "description": "Run a command in a new container" + }, + { + "name": "runlabel", + "description": "Execute a command as described by a container-image label" + }, + { + "name": "start", + "description": "Start one or more containers" + }, + { + "name": "stats", + "description": "Display a live stream of container resource usage statistics" + }, + { + "name": "stop", + "description": "Stop one or more containers" + }, + { + "name": "top", + "description": "Display the running processes of a container" + }, + { + "name": "unmount", + "description": "Unmount working container's root filesystem" + }, + { + "name": "unpause", + "description": "Unpause the processes in one or more containers" + }, + { + "name": "update", + "description": "Update an existing container" + }, + { + "name": "wait", + "description": "Block on one or more containers" + } + ] + }, + { + "name": "cp", + "description": "Copy files/folders between a container and the local filesystem", + "args": [ + { "name": "[CONTAINER:]SRC_PATH" }, + { "name": "[CONTAINER:]DEST_PATH" }], + "options": [ + { "name": [ + "-a", + "--archive" + ], "description": "Chown copied files to the primary uid/gid of the destination container (default true)" }, + { + "name": "--overwrite", + "description": "Allow overwriting directories with non-directories and vice versa" + } + ] + }, + { + "name": "create", + "description": "Create but do not start a container", + "args": [ + { "name": "image", "generatorName": "podman_images" }, + { "name": "command", "isCommand": true } + ], + "options": [ + { + "name": "--add-host", + "description": "Add a custom host-to-IP mapping (host:ip)", + "args": { "name": "strings" } + }, + { + "name": "--annotation", + "description": "Add annotations to container (key=value)", + "args": { "name": "list" } + }, + { "name": [ + "-a", + "--attach" + ], "description": "Attach to STDIN, STDOUT or STDERR", "args": { "name": "strings" } }, + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--cap-add", + "description": "Add capabilities to the container", + "args": { "name": "strings" } + }, + { + "name": "--cap-drop", + "description": "Drop capabilities from the container", + "args": { "name": "strings" } + }, + { + "name": "--cgroup-parent", + "description": "Optional parent cgroup for the container", + "args": { "name": "string" } + }, + { + "name": "--cgroupns", + "description": "Cgroup namespace to use", + "args": { "name": "string" } + }, + { + "name": "--cgroups", + "description": "Control container cgroup configuration (\"enabled\"|\"disabled\"|\"no-conmon\"|\"split\") (default \"enabled\")", + "args": { "name": "string" } + }, + { + "name": "--cidfile", + "description": "Write the container ID to the file", + "args": { "name": "string", "template": "filepaths" } + }, + { "name": [ + "-c", + "--cpu-shares" + ], "description": "CPU shares (relative weight)", "args": { "name": "uint" } }, + { + "name": "--cpus", + "description": "Number of CPUs (default 0.000, meaning no limit)", + "args": { "name": "float" } + }, + { + "name": "--cpuset-cpus", + "description": "CPUs in which to allow execution (0-3, 0,1)", + "args": { "name": "string" } + }, + { + "name": "--device", + "description": "Add a host device to the container", + "args": { "name": "strings" } + }, + { + "name": "--dns", + "description": "Set custom DNS servers", + "args": { "name": "strings" } + }, + { + "name": "--dns-option", + "description": "Set custom DNS options", + "args": { "name": "strings" } + }, + { + "name": "--dns-search", + "description": "Set custom DNS search domains", + "args": { "name": "strings" } + }, + { + "name": "--entrypoint", + "description": "Overwrite the default ENTRYPOINT of the image", + "args": { "name": "string" } + }, + { "name": [ + "-e", + "--env" + ], "description": "Set environment variables in container", "args": { "name": "strings" } }, + { + "name": "--env-file", + "description": "Read in a file of environment variables", + "args": { "name": "strings", "template": "filepaths" } + }, + { + "name": "--expose", + "description": "Expose a port or a range of ports", + "args": { "name": "strings" } + }, + { + "name": "--gpus", + "description": "GPU devices to add to the container ('all' to pass all GPUs)", + "args": { "name": "strings" } + }, + { + "name": "--group-add", + "description": "Add additional groups to the primary container process", + "args": { "name": "strings" } + }, + { + "name": "--health-cmd", + "description": "Set a healthcheck command for the container ('none' disables the existing healthcheck)", + "args": { "name": "string" } + }, + { + "name": "--health-interval", + "description": "Set an interval for the healthcheck (default \"30s\")", + "args": { "name": "string" } + }, + { + "name": "--health-retries", + "description": "Number of retries allowed before a healthcheck is considered unhealthy (default 3)", + "args": { "name": "uint" } + }, + { + "name": "--health-timeout", + "description": "Maximum time allowed to complete the healthcheck before it is considered failed (default \"30s\")", + "args": { "name": "string" } + }, + { "name": [ + "-h", + "--hostname" + ], "description": "Set container hostname", "args": { "name": "string" } }, + { + "name": "--init", + "description": "Run an init binary inside the container that forwards signals and reaps processes" + }, + { "name": [ + "-i", + "--interactive" + ], "description": "Make STDIN available to the contained process" }, + { + "name": "--ip", + "description": "Specify a static IPv4 address for the container", + "args": { "name": "string" } + }, + { + "name": "--ipc", + "description": "IPC namespace to use", + "args": { "name": "string" } + }, + { "name": [ + "-l", + "--label" + ], "description": "Set metadata on container", "args": { "name": "strings" } }, + { + "name": "--label-file", + "description": "Read in a line delimited file of labels", + "args": { "name": "strings", "template": "filepaths" } + }, + { + "name": "--log-driver", + "description": "Logging driver for the container (default \"k8s-file\")", + "args": { "name": "string" } + }, + { + "name": "--log-opt", + "description": "Logging driver options", + "args": { "name": "strings" } + }, + { + "name": "--mac-address", + "description": "Container MAC address (e.g. 92:d0:c6:0a:29:33)", + "args": { "name": "string" } + }, + { "name": [ + "-m", + "--memory" + ], "description": "Memory limit (format: [])", "args": { "name": "string" } }, + { + "name": "--memory-swap", + "description": "Swap limit equal to memory plus swap: '-1' to enable unlimited swap", + "args": { "name": "string" } + }, + { + "name": "--mount", + "description": "Attach a filesystem mount to the container", + "args": { "name": "string" } + }, + { + "name": "--name", + "description": "Assign a name to the container", + "args": { "name": "string" } + }, + { + "name": "--network", + "description": "Connect a container to a network", + "args": { "name": "strings" } + }, + { + "name": "--no-healthcheck", + "description": "Disable healthchecks on container" + }, + { + "name": "--pid", + "description": "PID namespace to use", + "args": { "name": "string" } + }, + { + "name": "--platform", + "description": "Specify the platform for selecting the image (conflicts with --arch and --os)", + "args": { "name": "string" } + }, + { + "name": "--pod", + "description": "Run container in an existing pod", + "args": { "name": "string" } + }, + { + "name": "--privileged", + "description": "Give extended privileges to container" + }, + { "name": [ + "-p", + "--publish" + ], "description": "Publish a container's port, or a range of ports, to the host", "args": { "name": "strings" } }, + { "name": [ + "-P", + "--publish-all" + ], "description": "Publish all exposed ports to random ports on the host interface" }, + { + "name": "--pull", + "description": "Pull image policy (\"always\"|\"missing\"|\"never\"|\"newer\") (default \"missing\")", + "args": { "name": "string" } + }, + { + "name": "--read-only", + "description": "Make containers root filesystem read-only" + }, + { + "name": "--replace", + "description": "If a container with the same name exists, replace it" + }, + { + "name": "--restart", + "description": "Restart policy to apply when a container exits (\"always\"|\"no\"|\"never\"|\"on-failure\"|\"unless-stopped\")", + "args": { "name": "string" } + }, + { + "name": "--rm", + "description": "Remove container (and any anonymous unnamed volume) after it exits" + }, + { + "name": "--secret", + "description": "Add secret to container", + "args": { "name": "strings" } + }, + { + "name": "--security-opt", + "description": "Security options", + "args": { "name": "strings" } + }, + { + "name": "--shm-size", + "description": "Size of /dev/shm (default \"65536k\")", + "args": { "name": "string" } + }, + { + "name": "--stop-signal", + "description": "Signal to stop a container (default SIGTERM)", + "args": { "name": "string" } + }, + { + "name": "--stop-timeout", + "description": "Seconds to wait before forcibly stopping the container (default 10)", + "args": { "name": "uint" } + }, + { + "name": "--sysctl", + "description": "Sysctl options", + "args": { "name": "strings" } + }, + { + "name": "--systemd", + "description": "Run container in systemd mode (\"true\"|\"false\"|\"always\") (default \"true\")", + "args": { "name": "string" } + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when pulling images" + }, + { + "name": "--tmpfs", + "description": "Mount a temporary filesystem (tmpfs) into a container", + "args": { "name": "tmpfs" } + }, + { "name": [ + "-t", + "--tty" + ], "description": "Allocate a pseudo-TTY for container" }, + { + "name": "--tz", + "description": "Set timezone in container", + "args": { "name": "string" } + }, + { + "name": "--ulimit", + "description": "Ulimit options", + "args": { "name": "strings" } + }, + { + "name": "--umask", + "description": "Set umask in container (default \"0022\")", + "args": { "name": "string" } + }, + { "name": [ + "-u", + "--user" + ], "description": "Username or UID (format: [:])", "args": { "name": "string" } }, + { + "name": "--userns", + "description": "User namespace to use", + "args": { "name": "string" } + }, + { + "name": "--uts", + "description": "UTS namespace to use", + "args": { "name": "string" } + }, + { "name": [ + "-v", + "--volume" + ], "description": "Bind mount a volume into the container", "args": { "name": "strings" } }, + { + "name": "--volumes-from", + "description": "Mount volumes from the specified container(s)", + "args": { "name": "strings" } + }, + { "name": [ + "-w", + "--workdir" + ], "description": "Working directory inside the container", "args": { "name": "string" } } + ] + }, + { + "name": "diff", + "description": "Display the changes to the object's file system", + "args": [ + { "name": "container or image", "generatorName": [ + "all_podman_containers", + "podman_images" + ] }, + { "name": "[container or image]" }], + "options": [ + { + "name": "--format", + "description": "Change the output format (json)", + "args": { "name": "string" } + }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" } + ] + }, + { + "name": "events", + "description": "Show podman system events", + "options": [ + { "name": [ + "-f", + "--filter" + ], "description": "Filter output", "args": { "name": "string" } }, + { + "name": "--format", + "description": "Format the output using a Go template", + "args": { "name": "string" } + }, + { + "name": "--no-trunc", + "description": "Do not truncate the output (default true)" + }, + { + "name": "--since", + "description": "Show all events created since timestamp", + "args": { "name": "string" } + }, + { + "name": "--stream", + "description": "Stream events and do not exit when returning the last known event (default true)" + }, + { + "name": "--until", + "description": "Show all events until timestamp", + "args": { "name": "string" } + } + ] + }, + { + "name": "exec", + "description": "Run a process in a running container", + "args": [ + { + "name": "container", + "generatorName": "running_podman_containers" + }, + { "name": "command", "isCommand": true } + ], + "options": [ + { "name": [ + "-d", + "--detach" + ], "description": "Run the exec session in detached mode (backgrounded)" }, + { + "name": "--detach-keys", + "description": "Select the key sequence for detaching a container (default \"ctrl-p,ctrl-q\")", + "args": { "name": "string" } + }, + { "name": [ + "-e", + "--env" + ], "description": "Set environment variables", "args": { "name": "list" } }, + { + "name": "--env-file", + "description": "Read in a file of environment variables", + "args": { "name": "list", "template": "filepaths" } + }, + { "name": [ + "-i", + "--interactive" + ], "description": "Make STDIN available to the contained process" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { + "name": "--privileged", + "description": "Give the process extended Linux capabilities inside the container" + }, + { "name": [ + "-t", + "--tty" + ], "description": "Allocate a pseudo-TTY" }, + { "name": [ + "-u", + "--user" + ], "description": "Set the username or UID (and optionally the groupname or GID) for the specified command", "args": { "name": "string" } }, + { "name": [ + "-w", + "--workdir" + ], "description": "Working directory inside the container", "args": { "name": "string" } } + ] + }, + { + "name": "export", + "description": "Export container's filesystem contents as a tar archive", + "args": { + "name": "container", + "generatorName": "all_podman_containers" + }, + "options": [ + { "name": [ + "-o", + "--output" + ], "description": "Write to a specified file (default: stdout, which must be redirected)", "args": { "name": "string", "template": "filepaths" } }] + }, + { + "name": "farm", + "description": "Farm out builds to remote machines", + "subcommands": [ + { + "name": "build", + "description": "Build a container image for multiple architectures" + }, + { "name": "create", "description": "Create a new farm" }, + { "name": "list", "description": "List all existing farms" }, + { "name": "remove", "description": "Remove one or more farms" }, + { "name": "update", "description": "Update an existing farm" } + ] + }, + { + "name": "generate", + "description": "Generate structured data based on containers, pods or volumes", + "subcommands": [ + { + "name": "kube", + "description": "Generate Kubernetes YAML from containers, pods or volumes", + "args": { + "name": "container, pod or volume", + "generatorName": [ + "all_podman_containers", + "podman_pods", + "podman_volumes" + ], + "isVariadic": true + }, + "options": [ + { "name": [ + "-f", + "--filename" + ], "description": "Write output to the specified path", "args": { "name": "string", "template": "filepaths" } }, + { + "name": "--podman-only", + "description": "Add podman-only reserved annotations to the generated YAML file (cannot be used by Kubernetes)" + }, + { "name": [ + "-r", + "--replicas" + ], "description": "Set the replicas number for Deployment kind (default 1)", "args": { "name": "int32" } }, + { "name": [ + "-s", + "--service" + ], "description": "Generate YAML for a Kubernetes service object" }, + { "name": [ + "-t", + "--type" + ], "description": "Generate YAML for the given Kubernetes kind (default \"pod\")", "args": { "name": "string" } } + ] + }, + { + "name": "spec", + "description": "Generate Specgen JSON based on containers or pods", + "args": { "name": "container or pod", "generatorName": [ + "all_podman_containers", + "podman_pods" + ] } + }, + { + "name": "systemd", + "description": "[DEPRECATED] Generate systemd units", + "args": { "name": "container or pod", "generatorName": [ + "all_podman_containers", + "podman_pods" + ] } + } + ] + }, + { + "name": "healthcheck", + "description": "Manage health checks on containers", + "subcommands": [ + { + "name": "run", + "description": "Run the health check of a container", + "args": { + "name": "container", + "generatorName": "running_podman_containers" + } + } + ] + }, + { + "name": "history", + "description": "Show history of a specified image", + "args": { "name": "image", "generatorName": "podman_images" }, + "options": [ + { + "name": "--format", + "description": "Change the output to JSON or a Go template", + "args": { "name": "string" } + }, + { "name": [ + "-H", + "--human" + ], "description": "Display sizes and dates in human readable format (default true)" }, + { + "name": "--no-trunc", + "description": "Do not truncate the output" + }, + { "name": [ + "-q", + "--quiet" + ], "description": "Display the numeric IDs only" } + ] + }, + { + "name": "image", + "description": "Manage images", + "subcommands": [ + { + "name": "build", + "description": "Build an image using instructions from Containerfiles" + }, + { + "name": "diff", + "description": "Inspect changes to the image's file systems" + }, + { + "name": "exists", + "description": "Check if an image exists in local storage" + }, + { + "name": "history", + "description": "Show history of a specified image" + }, + { + "name": "import", + "description": "Import a tarball to create a filesystem image" + }, + { + "name": "inspect", + "description": "Display the configuration of an image" + }, + { + "name": "list", + "description": "List images in local storage" + }, + { + "name": "load", + "description": "Load image(s) from a tar archive" + }, + { + "name": "mount", + "description": "Mount an image's root filesystem" + }, + { "name": "prune", "description": "Remove unused images" }, + { + "name": "pull", + "description": "Pull an image from a registry" + }, + { + "name": "push", + "description": "Push an image to a specified destination" + }, + { + "name": "rm", + "description": "Remove one or more images from local storage" + }, + { + "name": "save", + "description": "Save image(s) to an archive" + }, + { "name": "scp", "description": "Securely copy images" }, + { + "name": "search", + "description": "Search registry for image" + }, + { "name": "sign", "description": "Sign an image" }, + { + "name": "tag", + "description": "Add an additional name to a local image" + }, + { + "name": "tree", + "description": "Print layer hierarchy of an image in a tree format" + }, + { + "name": "trust", + "description": "Manage container image trust policy" + }, + { + "name": "unmount", + "description": "Unmount an image's root filesystem" + }, + { + "name": "untag", + "description": "Remove a name from a local image" + } + ] + }, + { + "name": "images", + "description": "List images in local storage", + "args": { "name": "[image]", "generatorName": "podman_images" }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Show all images (default hides intermediate images)" }, + { "name": "--digests", "description": "Show digests" }, + { "name": [ + "-f", + "--filter" + ], "description": "Filter output based on conditions provided", "args": { "name": "filter" } }, + { + "name": "--format", + "description": "Change the output format to JSON or a Go template", + "args": { "name": "string" } + }, + { + "name": "--history", + "description": "Display the image name history" + }, + { + "name": "--no-trunc", + "description": "Do not truncate output" + }, + { "name": [ + "-n", + "--noheading" + ], "description": "Do not print column headings" }, + { "name": [ + "-q", + "--quiet" + ], "description": "Display only image IDs" }, + { + "name": "--sort", + "description": "Sort by created, id, repository, size, tag (default \"created\")", + "args": { "name": "string" } + } + ] + }, + { + "name": "import", + "description": "Import a tarball to create a filesystem image", + "args": [ + { "name": "path", "template": "filepaths" }, + { "name": "[reference]" }], + "options": [ + { + "name": "--arch", + "description": "Set the architecture of the imported image", + "args": { "name": "string" } + }, + { + "name": [ + "-c", + "--change" + ], + "description": "Apply the given instruction to the created image (CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | ONBUILD | STOPSIGNAL | USER | VOLUME | WORKDIR)", + "args": { "name": "list" } + }, + { "name": [ + "-m", + "--message" + ], "description": "Set commit message for imported image", "args": { "name": "string" } }, + { + "name": "--os", + "description": "Set the OS of the imported image", + "args": { "name": "string" } + }, + { "name": [ + "-q", + "--quiet" + ], "description": "Suppress output" }, + { + "name": "--variant", + "description": "Set the variant of the imported image", + "args": { "name": "string" } + } + ] + }, + { + "name": "info", + "description": "Display podman system information", + "options": [ + { "name": [ + "-f", + "--format" + ], "description": "Change the output format to JSON or a Go template", "args": { "name": "string" } }] + }, + { + "name": "init", + "description": "Initialize one or more containers", + "args": { + "name": "container", + "generatorName": "all_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Initialize all containers" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" } + ] + }, + { + "name": "inspect", + "description": "Display the configuration of object denoted by ID", + "args": { + "name": "container, image, pod, network or volume", + "generatorName": [ + "all_podman_containers", + "podman_images", + "podman_pods", + "podman_networks", + "podman_volumes" + ], + "isVariadic": true + }, + "options": [ + { "name": [ + "-f", + "--format" + ], "description": "Format the output to a Go template or json (default \"json\")", "args": { "name": "string" } }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { "name": [ + "-s", + "--size" + ], "description": "Display total file size" }, + { "name": [ + "-t", + "--type" + ], "description": "Specify inspect-object type (default \"all\")", "args": { "name": "string" } } + ] + }, + { + "name": "kill", + "description": "Kill one or more running containers with a specific signal", + "args": { + "name": "container", + "generatorName": "running_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Signal all running containers" }, + { + "name": "--cidfile", + "description": "Read the container ID from the file", + "args": { "name": "string", "template": "filepaths" } + }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { "name": [ + "-s", + "--signal" + ], "description": "Signal to send to the container (default \"KILL\")", "args": { "name": "string" } } + ] + }, + { + "name": "kube", + "description": "Play containers, pods or volumes from a structured file", + "subcommands": [ + { + "name": "apply", + "description": "Deploy a podman container, pod, volume, or Kubernetes yaml to a Kubernetes cluster", + "args": { + "name": "container, pod or volume", + "generatorName": [ + "all_podman_containers", + "podman_pods", + "podman_volumes" + ], + "isVariadic": true + } + }, + { + "name": "down", + "description": "Remove pods based on Kubernetes YAML", + "args": { "name": "KUBEFILE|-", "template": "filepaths" }, + "options": [ + { "name": "--force", "description": "Remove volumes" }] + }, + { + "name": "generate", + "description": "Generate Kubernetes YAML from containers, pods or volumes", + "args": { + "name": "container, pod or volume", + "generatorName": [ + "all_podman_containers", + "podman_pods", + "podman_volumes" + ], + "isVariadic": true + } + }, + { + "name": "play", + "description": "Play a pod or volume based on Kubernetes YAML", + "args": { "name": "KUBEFILE|-", "template": "filepaths" }, + "options": [ + { + "name": "--annotation", + "description": "Add annotations to pods (key=value)", + "args": { "name": "list" } + }, + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { + "name": "string", + "template": "filepaths" + } + }, + { + "name": "--build", + "description": "Build all images in a YAML (given Containerfiles exist)" + }, + { + "name": "--configmap", + "description": "Pathname of a YAML file containing a Kubernetes configmap", + "args": { + "name": "pathname", + "template": "filepaths" + } + }, + { + "name": "--force", + "description": "Remove volumes as part of --down" + }, + { + "name": "--network", + "description": "Connect pod to network(s) or network mode", + "args": { "name": "list" } + }, + { + "name": "--no-hosts", + "description": "Do not create /etc/hosts within the pod's containers, use the version from the image instead" + }, + { + "name": "--publish-all", + "description": "Whether to publish all ports defined in the K8S YAML file (containerPort, hostPort)" + }, + { "name": [ + "-q", + "--quiet" + ], "description": "Suppress output information when pulling images" }, + { + "name": "--replace", + "description": "Delete and recreate pods defined in the YAML file" + }, + { + "name": "--start", + "description": "Start the pod after creating it (default true)" + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when contacting registries (default true)" + }, + { "name": [ + "-w", + "--wait" + ], "description": "Clean up all objects created when a SIGTERM is received or the pods exit" } + ] + } + ] + }, + { + "name": "load", + "description": "Load image(s) from a tar archive", + "options": [ + { "name": [ + "-i", + "--input" + ], "description": "Read from specified archive file (default: stdin)", "args": { "name": "string", "template": "filepaths" } }, + { "name": [ + "-q", + "--quiet" + ], "description": "Suppress the output" } + ] + }, + { + "name": "login", + "description": "Log in to a container registry", + "args": { "name": "[registry]" }, + "options": [ + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--cert-dir", + "description": "Use certificates at the specified path to access the registry", + "args": { "name": "string", "template": "folders" } + }, + { + "name": "--get-login", + "description": "Return the current login user for the registry" + }, + { "name": [ + "-p", + "--password" + ], "description": "Password for registry", "args": { "name": "string" } }, + { + "name": "--password-stdin", + "description": "Take the password from stdin" + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when contacting registries" + }, + { "name": [ + "-u", + "--username" + ], "description": "Username for registry", "args": { "name": "string" } } + ] + }, + { + "name": "logout", + "description": "Log out of a container registry", + "args": { "name": "[registry]" }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Remove the cached credentials for all registries in the auth file" }, + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { "name": "string", "template": "filepaths" } + } + ] + }, + { + "name": "logs", + "description": "Fetch the logs of one or more containers", + "args": { + "name": "container", + "generatorName": "all_podman_containers", + "isVariadic": true + }, + "options": [ + { + "name": "--color", + "description": "Output the containers with different colors in the log" + }, + { "name": [ + "-f", + "--follow" + ], "description": "Follow log output (default false)" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { "name": [ + "-n", + "--names" + ], "description": "Output the container name in the log" }, + { + "name": "--since", + "description": "Show logs since TIMESTAMP", + "args": { "name": "string" } + }, + { + "name": "--tail", + "description": "Output the specified number of LINES at the end of the logs (default -1, prints all lines)", + "args": { "name": "int" } + }, + { "name": [ + "-t", + "--timestamps" + ], "description": "Output the timestamps in the log" }, + { + "name": "--until", + "description": "Show logs until TIMESTAMP", + "args": { "name": "string" } + } + ] + }, + { + "name": "machine", + "description": "Manage a virtual machine", + "subcommands": [ + { "name": "info", "description": "Display machine host info" }, + { + "name": "init", + "description": "Initialize a virtual machine", + "args": { "name": "[name]" }, + "options": [ + { + "name": "--cpus", + "description": "Number of CPUs (default 4)", + "args": { "name": "uint" } + }, + { + "name": "--disk-size", + "description": "Disk size in GiB (default 100)", + "args": { "name": "uint" } + }, + { + "name": "--image", + "description": "Bootable image for machine", + "args": { "name": "string" } + }, + { "name": [ + "-m", + "--memory" + ], "description": "Memory in MiB (default 2048)", "args": { "name": "uint" } }, + { "name": "--now", "description": "Start machine now" }, + { + "name": "--playbook", + "description": "Run an Ansible playbook after first boot", + "args": { + "name": "string", + "template": "filepaths" + } + }, + { + "name": "--rootful", + "description": "Whether this machine should prefer rootful container execution" + }, + { + "name": "--timezone", + "description": "Set timezone (default \"local\")", + "args": { "name": "string" } + }, + { + "name": "--username", + "description": "Username used in image (default \"core\")", + "args": { "name": "string" } + }, + { "name": [ + "-v", + "--volume" + ], "description": "Volumes to mount, source:target", "args": { "name": "strings" } } + ] + }, + { + "name": "inspect", + "description": "Inspect an existing machine", + "args": { + "name": "[machine]", + "generatorName": "podman_machines", + "isVariadic": true + } + }, + { + "name": [ + "list", + "ls" + ], + "description": "List machines", + "options": [ + { + "name": "--all-providers", + "description": "Show machines from all providers" + }, + { + "name": "--format", + "description": "Format machine output using JSON or a Go template", + "args": { "name": "string" } + }, + { "name": [ + "-n", + "--noheading" + ], "description": "Do not print headers" }, + { "name": [ + "-q", + "--quiet" + ], "description": "Show only machine names" } + ] + }, + { + "name": "os", + "description": "Manage a Podman virtual machine's OS" + }, + { "name": "reset", "description": "Remove all machines" }, + { + "name": "rm", + "description": "Remove an existing machine", + "args": { + "name": "[machine]", + "generatorName": "podman_machines" + }, + "options": [ + { "name": [ + "-f", + "--force" + ], "description": "Stop and do not prompt before removing" }, + { + "name": "--save-ignition", + "description": "Do not delete ignition file" + }, + { + "name": "--save-image", + "description": "Do not delete the image file" + } + ] + }, + { + "name": "set", + "description": "Set a virtual machine setting", + "args": { + "name": "[name]", + "generatorName": "podman_machines" + }, + "options": [ + { + "name": "--cpus", + "description": "Number of CPUs", + "args": { "name": "uint" } + }, + { + "name": "--disk-size", + "description": "Disk size in GiB", + "args": { "name": "uint" } + }, + { "name": [ + "-m", + "--memory" + ], "description": "Memory in MiB", "args": { "name": "uint" } }, + { + "name": "--rootful", + "description": "Whether this machine should prefer rootful container execution" + }, + { + "name": "--user-mode-networking", + "description": "Whether this machine should use user-mode networking" + } + ] + }, + { + "name": "ssh", + "description": "SSH into an existing machine", + "args": [ + { + "name": "[name]", + "generatorName": "podman_machines" + }, + { "name": "command", "isCommand": true } + ], + "options": [ + { + "name": "--username", + "description": "Username to use when ssh-ing into the VM", + "args": { "name": "string" } + } + ] + }, + { + "name": "start", + "description": "Start an existing machine", + "args": { + "name": "[machine]", + "generatorName": "podman_machines" + }, + "options": [ + { + "name": "--no-info", + "description": "Suppress informational tips" + }, + { "name": [ + "-q", + "--quiet" + ], "description": "Suppress machine starting status output" } + ] + }, + { + "name": "stop", + "description": "Stop an existing machine", + "args": { + "name": "[machine]", + "generatorName": "podman_machines" + } + } + ] + }, + { + "name": "manifest", + "description": "Manipulate manifest lists and image indexes", + "subcommands": [ + { + "name": "add", + "description": "Add images or artifacts to a manifest list or image index", + "args": [ + { "name": "list" }, + { + "name": "image or artifact", + "generatorName": "podman_images", + "isVariadic": true + } + ], + "options": [ + { + "name": "--all", + "description": "Add all of the list's images if the image is a list" + }, + { + "name": "--arch", + "description": "Override the architecture of the specified image", + "args": { "name": "architecture" } + }, + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { + "name": "string", + "template": "filepaths" + } + }, + { + "name": "--os", + "description": "Override the OS of the specified image", + "args": { "name": "OS" } + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when accessing the registry (default true)" + }, + { + "name": "--variant", + "description": "Override the variant of the specified image", + "args": { "name": "variant" } + } + ] + }, + { + "name": "annotate", + "description": "Add or update information about an entry in a manifest list or image index", + "args": [ + { "name": "list" }, + { "name": "image" }] + }, + { + "name": "create", + "description": "Create manifest list or image index", + "args": [ + { "name": "list" }, + { + "name": "[image]", + "generatorName": "podman_images", + "isVariadic": true + } + ], + "options": [ + { + "name": "--all", + "description": "Add all of the lists' images if the images to add are lists" + }, + { "name": [ + "-a", + "--amend" + ], "description": "Modify an existing list if one with the desired name already exists" }, + { + "name": "--annotation", + "description": "Set annotations on the new list", + "args": { "name": "list" } + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when accessing the registry (default true)" + } + ] + }, + { + "name": "exists", + "description": "Check if a manifest list exists in local storage", + "args": { "name": "list" } + }, + { + "name": "inspect", + "description": "Display the contents of a manifest list or image index", + "args": { "name": "list" } + }, + { + "name": "push", + "description": "Push a manifest list or image index to a registry", + "args": [ + { "name": "list" }, + { "name": "destination" }] + }, + { + "name": "remove", + "description": "Remove an item from a manifest list or image index", + "args": [ + { "name": "list" }, + { "name": "digest" }] + }, + { + "name": "rm", + "description": "Remove manifest list or image index from local storage", + "args": { "name": "list", "isVariadic": true } + } + ] + }, + { + "name": "mount", + "description": "Mount a working container's root filesystem", + "args": { + "name": "[container]", + "generatorName": "all_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Mount all containers" }, + { + "name": "--format", + "description": "Print the mounted containers in specified format (json)", + "args": { "name": "string" } + }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { + "name": "--no-trunc", + "description": "Do not truncate output" + } + ] + }, + { + "name": "network", + "description": "Manage networks", + "subcommands": [ + { + "name": "connect", + "description": "Add container to a network", + "args": [ + { + "name": "network", + "generatorName": "podman_networks" + }, + { + "name": "container", + "generatorName": "all_podman_containers" + } + ], + "options": [ + { + "name": "--alias", + "description": "Network scoped alias for container", + "args": { "name": "strings" } + }, + { + "name": "--ip", + "description": "Set a static IPv4 address for this container network", + "args": { "name": "ip" } + }, + { + "name": "--ip6", + "description": "Set a static IPv6 address for this container network", + "args": { "name": "ip" } + }, + { + "name": "--mac-address", + "description": "Set a static MAC address for this container network", + "args": { "name": "string" } + } + ] + }, + { + "name": "create", + "description": "Create networks for containers and pods", + "args": { "name": "[name]" }, + "options": [ + { + "name": "--disable-dns", + "description": "Disable dns plugin" + }, + { + "name": "--dns", + "description": "DNS servers this network will use", + "args": { "name": "strings" } + }, + { "name": [ + "-d", + "--driver" + ], "description": "Driver to manage the network (default \"bridge\")", "args": { "name": "string" } }, + { + "name": "--gateway", + "description": "IPv4 or IPv6 gateway for the subnet", + "args": { "name": "ipSlice" } + }, + { + "name": "--ignore", + "description": "Don't fail if network already exists" + }, + { + "name": "--internal", + "description": "Restrict external access from this network" + }, + { + "name": "--ip-range", + "description": "Allocate container IP from range", + "args": { "name": "string" } + }, + { + "name": "--ipv6", + "description": "Enable IPv6 networking" + }, + { + "name": "--label", + "description": "Set metadata on a network", + "args": { "name": "list" } + }, + { "name": [ + "-o", + "--opt" + ], "description": "Set driver specific options", "args": { "name": "list" } }, + { + "name": "--subnet", + "description": "Subnets in CIDR format", + "args": { "name": "string" } + } + ] + }, + { + "name": "disconnect", + "description": "Disconnect a container from a network", + "args": [ + { + "name": "network", + "generatorName": "podman_networks" + }, + { + "name": "container", + "generatorName": "all_podman_containers" + } + ], + "options": [{ "name": [ + "-f", + "--force" + ], "description": "Force removal of container from network" }] + }, + { + "name": "exists", + "description": "Check if network exists", + "args": { + "name": "network", + "generatorName": "podman_networks" + } + }, + { + "name": "inspect", + "description": "Inspect network", + "args": { + "name": "network", + "generatorName": "podman_networks", + "isVariadic": true + } + }, + { + "name": "ls", + "description": "List networks", + "options": [ + { "name": [ + "-f", + "--filter" + ], "description": "Provide filter values (e.g. 'name=podman')", "args": { "name": "list" } }, + { + "name": "--format", + "description": "Pretty-print networks to JSON or using a Go template", + "args": { "name": "string" } + }, + { + "name": "--no-trunc", + "description": "Do not truncate the network ID" + }, + { "name": [ + "-n", + "--noheading" + ], "description": "Do not print headers" }, + { "name": [ + "-q", + "--quiet" + ], "description": "Display only names" } + ] + }, + { "name": "prune", "description": "Prune unused networks" }, + { + "name": "reload", + "description": "Reload firewall rules for one or more containers" + }, + { + "name": "rm", + "description": "Remove networks", + "args": { + "name": "network", + "generatorName": "podman_networks", + "isVariadic": true + }, + "options": [ + { "name": [ + "-f", + "--force" + ], "description": "Remove any containers using the network" }, + { "name": [ + "-t", + "--time" + ], "description": "Seconds to wait for running containers to stop before killing them (default 10)", "args": { "name": "int" } } + ] + }, + { + "name": "update", + "description": "Update an existing podman network", + "args": { + "name": "network", + "generatorName": "podman_networks" + } + } + ] + }, + { + "name": "pause", + "description": "Pause all the processes in one or more containers", + "args": { + "name": "container", + "generatorName": "running_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Pause all running containers" }, + { + "name": "--cidfile", + "description": "Read the container ID from the file", + "args": { "name": "string", "template": "filepaths" } + }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" } + ] + }, + { + "name": "pod", + "description": "Manage pods", + "subcommands": [ + { + "name": "clone", + "description": "Clone an existing pod", + "args": { "name": "pod", "generatorName": "podman_pods" } + }, + { + "name": "create", + "description": "Create a new empty pod", + "args": { "name": "[name]" }, + "options": [ + { + "name": "--add-host", + "description": "Add a custom host-to-IP mapping (host:ip)", + "args": { "name": "strings" } + }, + { + "name": "--exit-policy", + "description": "Behaviour when the last container exits (default \"continue\")", + "args": { "name": "string" } + }, + { + "name": "--infra", + "description": "Create an infra container associated with the pod to share namespaces with (default true)" + }, + { + "name": "--infra-image", + "description": "Image to use to override built-in infra container", + "args": { "name": "string" } + }, + { + "name": "--infra-name", + "description": "Assign a name to the infra container", + "args": { "name": "string" } + }, + { + "name": "--ip", + "description": "Specify a static IPv4 address for the pod", + "args": { "name": "string" } + }, + { "name": [ + "-l", + "--label" + ], "description": "Set metadata on the pod", "args": { "name": "strings" } }, + { "name": [ + "-n", + "--name" + ], "description": "Assign a name to the pod", "args": { "name": "string" } }, + { + "name": "--network", + "description": "Connect the pod to a network", + "args": { "name": "strings" } + }, + { "name": [ + "-p", + "--publish" + ], "description": "Publish a container's port, or a range of ports, to the host", "args": { "name": "strings" } }, + { + "name": "--replace", + "description": "If a pod with the same name exists, replace it" + }, + { + "name": "--restart", + "description": "Restart policy to apply when a container exits (\"always\"|\"no\"|\"never\"|\"on-failure\"|\"unless-stopped\")", + "args": { "name": "string" } + }, + { + "name": "--share", + "description": "A comma delimited list of kernel namespaces the pod will share (default \"ipc,net,uts\")", + "args": { "name": "string" } + }, + { "name": [ + "-v", + "--volume" + ], "description": "Bind mount a volume into all containers in the pod", "args": { "name": "strings" } } + ] + }, + { + "name": "exists", + "description": "Check if a pod exists in local storage", + "args": { "name": "pod", "generatorName": "podman_pods" } + }, + { + "name": "inspect", + "description": "Display a pod configuration", + "args": { + "name": "pod", + "generatorName": "podman_pods", + "isVariadic": true + }, + "options": [ + { "name": [ + "-f", + "--format" + ], "description": "Format the output to a Go template or json (default \"json\")", "args": { "name": "string" } }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" } + ] + }, + { + "name": "kill", + "description": "Send the specified signal or SIGKILL to containers in pod", + "args": { + "name": "pod", + "generatorName": "podman_pods", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Kill all containers in all pods" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { "name": [ + "-s", + "--signal" + ], "description": "Signal to send to the containers in the pod (default \"KILL\")", "args": { "name": "string" } } + ] + }, + { + "name": "logs", + "description": "Fetch logs for pod with one or more containers", + "args": { "name": "pod", "generatorName": "podman_pods" }, + "options": [ + { + "name": "--color", + "description": "Output the containers within a pod with different colors in the log" + }, + { "name": [ + "-c", + "--container" + ], "description": "Filter logs by container name or id which belongs to the pod", "args": { "name": "string", "generatorName": "all_podman_containers" } }, + { "name": [ + "-f", + "--follow" + ], "description": "Follow log output" }, + { "name": [ + "-n", + "--names" + ], "description": "Output container names instead of container IDs in the log" }, + { + "name": "--since", + "description": "Show logs since TIMESTAMP", + "args": { "name": "string" } + }, + { + "name": "--tail", + "description": "Output the specified number of LINES at the end of the logs (default -1)", + "args": { "name": "int" } + }, + { "name": [ + "-t", + "--timestamps" + ], "description": "Output the timestamps in the log" }, + { + "name": "--until", + "description": "Show logs until TIMESTAMP", + "args": { "name": "string" } + } + ] + }, + { + "name": "pause", + "description": "Pause one or more pods", + "args": { + "name": "pod", + "generatorName": "podman_pods", + "isVariadic": true + }, + "options": [{ "name": [ + "-a", + "--all" + ], "description": "Pause all running pods" }] + }, + { + "name": "prune", + "description": "Remove all stopped pods and their containers", + "options": [{ "name": [ + "-f", + "--force" + ], "description": "Do not prompt for confirmation" }] + }, + { + "name": "ps", + "description": "List pods", + "options": [ + { + "name": "--ctr-ids", + "description": "Display the container UUIDs" + }, + { + "name": "--ctr-names", + "description": "Display the container names" + }, + { + "name": "--ctr-status", + "description": "Display the container status" + }, + { "name": [ + "-f", + "--filter" + ], "description": "Filter output based on conditions given", "args": { "name": "strings" } }, + { + "name": "--format", + "description": "Pretty-print pods to JSON or using a Go template", + "args": { "name": "string" } + }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { + "name": "--no-trunc", + "description": "Do not truncate pod and container IDs" + }, + { "name": [ + "-n", + "--noheading" + ], "description": "Do not print headers" }, + { + "name": "--ns", + "description": "Display namespace information of the pod" + }, + { "name": [ + "-q", + "--quiet" + ], "description": "Print the numeric IDs of the pods only" }, + { + "name": "--sort", + "description": "Sort output by created, id, name, or number (default \"created\")", + "args": { "name": "string" } + } + ] + }, + { + "name": "restart", + "description": "Restart one or more pods", + "args": { + "name": "pod", + "generatorName": "podman_pods", + "isVariadic": true + }, + "options": [{ "name": [ + "-a", + "--all" + ], "description": "Restart all pods" }] + }, + { + "name": "rm", + "description": "Remove one or more pods", + "args": { + "name": "pod", + "generatorName": "podman_pods", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Remove all pods" }, + { "name": [ + "-f", + "--force" + ], "description": "Force removal of a running pod by first stopping all containers, then removing them" }, + { "name": [ + "-i", + "--ignore" + ], "description": "Ignore errors when a specified pod is missing" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { "name": [ + "-t", + "--time" + ], "description": "Seconds to wait for pod stop before killing the container (default 10)", "args": { "name": "int" } } + ] + }, + { + "name": "start", + "description": "Start one or more pods", + "args": { + "name": "pod", + "generatorName": "podman_pods", + "isVariadic": true + }, + "options": [{ "name": [ + "-a", + "--all" + ], "description": "Restart all running pods" }] + }, + { + "name": "stats", + "description": "Display a live stream of resource usage statistics for the containers in one or more pods", + "args": { + "name": "[pod]", + "generatorName": "podman_pods", + "isVariadic": true + } + }, + { + "name": "stop", + "description": "Stop one or more pods", + "args": { + "name": "pod", + "generatorName": "podman_pods", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Stop all running pods" }, + { "name": [ + "-i", + "--ignore" + ], "description": "Ignore errors when a specified pod is missing" }, + { "name": [ + "-t", + "--time" + ], "description": "Seconds to wait for pod stop before killing the container (default 10)", "args": { "name": "int" } } + ] + }, + { + "name": "top", + "description": "Display the running processes of containers in a pod", + "args": { "name": "pod", "generatorName": "podman_pods" } + }, + { + "name": "unpause", + "description": "Unpause one or more pods", + "args": { + "name": "pod", + "generatorName": "podman_pods", + "isVariadic": true + }, + "options": [{ "name": [ + "-a", + "--all" + ], "description": "Unpause all paused pods" }] + } + ] + }, + { + "name": "port", + "description": "List port mappings or a specific mapping for the container", + "args": [ + { + "name": "container", + "generatorName": "all_podman_containers" + }, + { "name": "[PRIVATE_PORT[/PROTO]]" } + ], + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Display port information for all containers" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" } + ] + }, + { + "name": "ps", + "description": "List containers", + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Show all the containers, default is only running containers" }, + { + "name": "--external", + "description": "Show containers in storage not controlled by Podman" + }, + { "name": [ + "-f", + "--filter" + ], "description": "Filter output based on conditions given", "args": { "name": "strings" } }, + { + "name": "--format", + "description": "Pretty-print containers to JSON or using a Go template", + "args": { "name": "string" } + }, + { "name": [ + "-n", + "--last" + ], "description": "Print the n last created containers (all states) (default -1)", "args": { "name": "int" } }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { + "name": "--no-trunc", + "description": "Display the extended information" + }, + { + "name": "--noheading", + "description": "Do not print headers" + }, + { + "name": "--ns", + "description": "Display namespace information" + }, + { "name": [ + "-p", + "--pod" + ], "description": "Print the ID and name of the pod the containers are associated with" }, + { "name": [ + "-q", + "--quiet" + ], "description": "Print the numeric IDs of the containers only" }, + { "name": [ + "-s", + "--size" + ], "description": "Display the total file sizes" }, + { + "name": "--sort", + "description": "Sort output by: command, created, id, image, names, runningfor, size, status", + "args": { "name": "string" } + }, + { + "name": "--sync", + "description": "Sync container state with the OCI runtime" + }, + { "name": [ + "-w", + "--watch" + ], "description": "Watch the ps output on an interval in seconds", "args": { "name": "uint" } } + ] + }, + { + "name": "pull", + "description": "Pull an image from a registry", + "args": { "name": "image", "isVariadic": true }, + "options": [ + { "name": [ + "-a", + "--all-tags" + ], "description": "All tagged images in the repository will be pulled" }, + { + "name": "--arch", + "description": "Use ARCH instead of the architecture of the machine for choosing images", + "args": { "name": "ARCH" } + }, + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--cert-dir", + "description": "Pathname of a directory containing TLS certificates and keys", + "args": { "name": "pathname", "template": "folders" } + }, + { + "name": "--creds", + "description": "Credentials (USERNAME:PASSWORD) to use for authenticating to a registry", + "args": { "name": "credentials" } + }, + { + "name": "--os", + "description": "Use OS instead of the running OS for choosing images", + "args": { "name": "OS" } + }, + { + "name": "--platform", + "description": "Specify the platform for selecting the image (conflicts with arch and os)", + "args": { "name": "string" } + }, + { "name": [ + "-q", + "--quiet" + ], "description": "Suppress output information when pulling images" }, + { + "name": "--retry", + "description": "Number of times to retry in case of failure when performing pull (default 3)", + "args": { "name": "uint" } + }, + { + "name": "--retry-delay", + "description": "Delay between retries in case of pull failures", + "args": { "name": "string" } + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when contacting registries (default true)" + }, + { + "name": "--variant", + "description": "Use VARIANT instead of the running architecture variant for choosing images", + "args": { "name": "string" } + } + ] + }, + { + "name": "push", + "description": "Push an image to a specified destination", + "args": [ + { "name": "image", "generatorName": "podman_images" }, + { "name": "[destination]" }], + "options": [ + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--cert-dir", + "description": "Path to a directory containing TLS certificates and keys", + "args": { "name": "string", "template": "folders" } + }, + { + "name": "--compression-format", + "description": "Compression format to use (default \"gzip\")", + "args": { "name": "string" } + }, + { + "name": "--creds", + "description": "Credentials (USERNAME:PASSWORD) to use for authenticating to a registry", + "args": { "name": "credentials" } + }, + { + "name": "--digestfile", + "description": "Write the digest of the pushed image to the specified file", + "args": { "name": "string", "template": "filepaths" } + }, + { "name": [ + "-f", + "--format" + ], "description": "Manifest type (oci, v2s2, or v2s1) to use in the destination", "args": { "name": "string" } }, + { "name": [ + "-q", + "--quiet" + ], "description": "Suppress output information when pushing images" }, + { + "name": "--remove-signatures", + "description": "Discard any pre-existing signatures in the image" + }, + { + "name": "--retry", + "description": "Number of times to retry in case of failure when performing push (default 3)", + "args": { "name": "uint" } + }, + { + "name": "--retry-delay", + "description": "Delay between retries in case of push failures", + "args": { "name": "string" } + }, + { + "name": "--sign-by", + "description": "Add a signature at the destination using the specified key", + "args": { "name": "string" } + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when contacting registries (default true)" + } + ] + }, + { + "name": "rename", + "description": "Rename an existing container", + "args": [ + { + "name": "container", + "generatorName": "all_podman_containers" + }, + { "name": "name" } + ] + }, + { + "name": "restart", + "description": "Restart one or more containers", + "args": { + "name": "container", + "generatorName": "all_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Restart all non-running containers" }, + { + "name": "--cidfile", + "description": "Read the container ID from the file", + "args": { "name": "string", "template": "filepaths" } + }, + { "name": [ + "-f", + "--filter" + ], "description": "Filter output based on conditions given", "args": { "name": "strings" } }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { + "name": "--running", + "description": "Restart only running containers" + }, + { "name": [ + "-t", + "--time" + ], "description": "Seconds to wait for stop before killing the container (default 10)", "args": { "name": "int" } } + ] + }, + { + "name": "rm", + "description": "Remove one or more containers", + "args": { + "name": "container", + "generatorName": "all_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Remove all containers" }, + { + "name": "--cidfile", + "description": "Read the container ID from the file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--depend", + "description": "Remove container and all containers that depend on the selected container" + }, + { + "name": "--filter", + "description": "Filter output based on conditions given", + "args": { "name": "strings" } + }, + { "name": [ + "-f", + "--force" + ], "description": "Force removal of a running or unusable container" }, + { "name": [ + "-i", + "--ignore" + ], "description": "Ignore errors when a specified container is missing" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { "name": [ + "-t", + "--time" + ], "description": "Seconds to wait for stop before killing the container (default 10)", "args": { "name": "int" } }, + { "name": [ + "-v", + "--volumes" + ], "description": "Remove anonymous volumes associated with the container" } + ] + }, + { + "name": "rmi", + "description": "Remove one or more images from local storage", + "args": { + "name": "image", + "generatorName": "podman_images", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Remove all images" }, + { "name": [ + "-f", + "--force" + ], "description": "Force removal of the image" }, + { "name": [ + "-i", + "--ignore" + ], "description": "Ignore errors if a specified image does not exist" }, + { + "name": "--no-prune", + "description": "Do not remove dangling images" + } + ] + }, + { + "name": "run", + "description": "Run a command in a new container", + "args": [ + { "name": "image", "generatorName": "podman_images" }, + { "name": "command", "isCommand": true } + ], + "options": [ + { + "name": "--add-host", + "description": "Add a custom host-to-IP mapping (host:ip)", + "args": { "name": "strings" } + }, + { + "name": "--annotation", + "description": "Add annotations to container (key=value)", + "args": { "name": "list" } + }, + { "name": [ + "-a", + "--attach" + ], "description": "Attach to STDIN, STDOUT or STDERR", "args": { "name": "strings" } }, + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--cap-add", + "description": "Add capabilities to the container", + "args": { "name": "strings" } + }, + { + "name": "--cap-drop", + "description": "Drop capabilities from the container", + "args": { "name": "strings" } + }, + { + "name": "--cgroup-parent", + "description": "Optional parent cgroup for the container", + "args": { "name": "string" } + }, + { + "name": "--cgroupns", + "description": "Cgroup namespace to use", + "args": { "name": "string" } + }, + { + "name": "--cidfile", + "description": "Write the container ID to the file", + "args": { "name": "string", "template": "filepaths" } + }, + { "name": [ + "-c", + "--cpu-shares" + ], "description": "CPU shares (relative weight)", "args": { "name": "uint" } }, + { + "name": "--cpus", + "description": "Number of CPUs (default 0.000, meaning no limit)", + "args": { "name": "float" } + }, + { + "name": "--cpuset-cpus", + "description": "CPUs in which to allow execution (0-3, 0,1)", + "args": { "name": "string" } + }, + { "name": [ + "-d", + "--detach" + ], "description": "Run container in background and print container ID" }, + { + "name": "--detach-keys", + "description": "Override the key sequence for detaching a container (default \"ctrl-p,ctrl-q\")", + "args": { "name": "string" } + }, + { + "name": "--device", + "description": "Add a host device to the container", + "args": { "name": "strings" } + }, + { + "name": "--dns", + "description": "Set custom DNS servers", + "args": { "name": "strings" } + }, + { + "name": "--dns-option", + "description": "Set custom DNS options", + "args": { "name": "strings" } + }, + { + "name": "--dns-search", + "description": "Set custom DNS search domains", + "args": { "name": "strings" } + }, + { + "name": "--entrypoint", + "description": "Overwrite the default ENTRYPOINT of the image", + "args": { "name": "string" } + }, + { "name": [ + "-e", + "--env" + ], "description": "Set environment variables in container", "args": { "name": "strings" } }, + { + "name": "--env-file", + "description": "Read in a file of environment variables", + "args": { "name": "strings", "template": "filepaths" } + }, + { + "name": "--expose", + "description": "Expose a port or a range of ports", + "args": { "name": "strings" } + }, + { + "name": "--gpus", + "description": "GPU devices to add to the container ('all' to pass all GPUs)", + "args": { "name": "strings" } + }, + { + "name": "--group-add", + "description": "Add additional groups to the primary container process", + "args": { "name": "strings" } + }, + { + "name": "--health-cmd", + "description": "Set a healthcheck command for the container ('none' disables the existing healthcheck)", + "args": { "name": "string" } + }, + { + "name": "--health-interval", + "description": "Set an interval for the healthcheck (default \"30s\")", + "args": { "name": "string" } + }, + { + "name": "--health-retries", + "description": "Number of retries allowed before a healthcheck is considered unhealthy (default 3)", + "args": { "name": "uint" } + }, + { + "name": "--health-timeout", + "description": "Maximum time allowed to complete the healthcheck before it is considered failed (default \"30s\")", + "args": { "name": "string" } + }, + { "name": [ + "-h", + "--hostname" + ], "description": "Set container hostname", "args": { "name": "string" } }, + { + "name": "--init", + "description": "Run an init binary inside the container that forwards signals and reaps processes" + }, + { "name": [ + "-i", + "--interactive" + ], "description": "Make STDIN available to the contained process" }, + { + "name": "--ip", + "description": "Specify a static IPv4 address for the container", + "args": { "name": "string" } + }, + { + "name": "--ipc", + "description": "IPC namespace to use", + "args": { "name": "string" } + }, + { "name": [ + "-l", + "--label" + ], "description": "Set metadata on container", "args": { "name": "strings" } }, + { + "name": "--label-file", + "description": "Read in a line delimited file of labels", + "args": { "name": "strings", "template": "filepaths" } + }, + { + "name": "--log-driver", + "description": "Logging driver for the container (default \"k8s-file\")", + "args": { "name": "string" } + }, + { + "name": "--log-opt", + "description": "Logging driver options", + "args": { "name": "strings" } + }, + { + "name": "--mac-address", + "description": "Container MAC address (e.g. 92:d0:c6:0a:29:33)", + "args": { "name": "string" } + }, + { "name": [ + "-m", + "--memory" + ], "description": "Memory limit (format: [])", "args": { "name": "string" } }, + { + "name": "--memory-swap", + "description": "Swap limit equal to memory plus swap: '-1' to enable unlimited swap", + "args": { "name": "string" } + }, + { + "name": "--mount", + "description": "Attach a filesystem mount to the container", + "args": { "name": "string" } + }, + { + "name": "--name", + "description": "Assign a name to the container", + "args": { "name": "string" } + }, + { + "name": "--network", + "description": "Connect a container to a network", + "args": { "name": "strings" } + }, + { + "name": "--no-healthcheck", + "description": "Disable healthchecks on container" + }, + { + "name": "--pid", + "description": "PID namespace to use", + "args": { "name": "string" } + }, + { + "name": "--platform", + "description": "Specify the platform for selecting the image (conflicts with --arch and --os)", + "args": { "name": "string" } + }, + { + "name": "--pod", + "description": "Run container in an existing pod", + "args": { "name": "string", "generatorName": "podman_pods" } + }, + { + "name": "--privileged", + "description": "Give extended privileges to container" + }, + { "name": [ + "-p", + "--publish" + ], "description": "Publish a container's port, or a range of ports, to the host", "args": { "name": "strings" } }, + { "name": [ + "-P", + "--publish-all" + ], "description": "Publish all exposed ports to random ports on the host interface" }, + { + "name": "--pull", + "description": "Pull image policy (\"always\"|\"missing\"|\"never\"|\"newer\") (default \"missing\")", + "args": { "name": "string" } + }, + { "name": [ + "-q", + "--quiet" + ], "description": "Suppress output information when pulling images" }, + { + "name": "--read-only", + "description": "Make containers root filesystem read-only" + }, + { + "name": "--replace", + "description": "If a container with the same name exists, replace it" + }, + { + "name": "--restart", + "description": "Restart policy to apply when a container exits (\"always\"|\"no\"|\"never\"|\"on-failure\"|\"unless-stopped\")", + "args": { "name": "string" } + }, + { + "name": "--rm", + "description": "Remove container (and any anonymous unnamed volume) after it exits" + }, + { + "name": "--rmi", + "description": "Remove image unless used by other containers (implies --rm)" + }, + { + "name": "--rootfs", + "description": "The first argument is not an image but the rootfs to the exploded container" + }, + { + "name": "--secret", + "description": "Add secret to container", + "args": { "name": "strings" } + }, + { + "name": "--security-opt", + "description": "Security options", + "args": { "name": "strings" } + }, + { + "name": "--shm-size", + "description": "Size of /dev/shm (default \"65536k\")", + "args": { "name": "string" } + }, + { + "name": "--sig-proxy", + "description": "Proxy received signals to the process (default true)" + }, + { + "name": "--stop-signal", + "description": "Signal to stop a container (default SIGTERM)", + "args": { "name": "string" } + }, + { + "name": "--stop-timeout", + "description": "Seconds to wait before forcibly stopping the container (default 10)", + "args": { "name": "uint" } + }, + { + "name": "--sysctl", + "description": "Sysctl options", + "args": { "name": "strings" } + }, + { + "name": "--systemd", + "description": "Run container in systemd mode (\"true\"|\"false\"|\"always\") (default \"true\")", + "args": { "name": "string" } + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when pulling images" + }, + { + "name": "--tmpfs", + "description": "Mount a temporary filesystem (tmpfs) into a container", + "args": { "name": "tmpfs" } + }, + { "name": [ + "-t", + "--tty" + ], "description": "Allocate a pseudo-TTY for container" }, + { + "name": "--tz", + "description": "Set timezone in container", + "args": { "name": "string" } + }, + { + "name": "--ulimit", + "description": "Ulimit options", + "args": { "name": "strings" } + }, + { + "name": "--umask", + "description": "Set umask in container (default \"0022\")", + "args": { "name": "string" } + }, + { "name": [ + "-u", + "--user" + ], "description": "Username or UID (format: [:])", "args": { "name": "string" } }, + { + "name": "--userns", + "description": "User namespace to use", + "args": { "name": "string" } + }, + { + "name": "--uts", + "description": "UTS namespace to use", + "args": { "name": "string" } + }, + { "name": [ + "-v", + "--volume" + ], "description": "Bind mount a volume into the container", "args": { "name": "strings" } }, + { + "name": "--volumes-from", + "description": "Mount volumes from the specified container(s)", + "args": { "name": "strings" } + }, + { "name": [ + "-w", + "--workdir" + ], "description": "Working directory inside the container", "args": { "name": "string" } } + ] + }, + { + "name": "save", + "description": "Save image(s) to an archive", + "args": { + "name": "image", + "generatorName": "podman_images", + "isVariadic": true + }, + "options": [ + { + "name": "--compress", + "description": "Compress tarball image layers when saving to a directory using the 'dir' transport" + }, + { + "name": "--format", + "description": "Save image to oci-archive, oci-dir, docker-archive, or docker-dir (default \"docker-archive\")", + "args": { "name": "string" } + }, + { "name": [ + "-m", + "--multi-image-archive" + ], "description": "Interpret additional arguments as images not tags and create a multi-image-archive" }, + { "name": [ + "-o", + "--output" + ], "description": "Write to a specified file (default: stdout, which must be redirected)", "args": { "name": "string", "template": "filepaths" } }, + { "name": [ + "-q", + "--quiet" + ], "description": "Suppress the output" }, + { + "name": "--uncompressed", + "description": "Accept uncompressed layers when copying OCI images" + } + ] + }, + { + "name": "search", + "description": "Search registry for image", + "args": { "name": "term" }, + "options": [ + { + "name": "--authfile", + "description": "Path of the authentication file", + "args": { "name": "string", "template": "filepaths" } + }, + { + "name": "--cert-dir", + "description": "Pathname of a directory containing TLS certificates and keys", + "args": { "name": "pathname", "template": "folders" } + }, + { + "name": "--compatible", + "description": "List stars, official and automated columns (Docker compatibility)" + }, + { + "name": "--creds", + "description": "Credentials (USERNAME:PASSWORD) to use for authenticating to a registry", + "args": { "name": "credentials" } + }, + { "name": [ + "-f", + "--filter" + ], "description": "Filter output based on conditions provided", "args": { "name": "strings" } }, + { + "name": "--format", + "description": "Change the output format to JSON or a Go template", + "args": { "name": "string" } + }, + { + "name": "--limit", + "description": "Limit the number of results", + "args": { "name": "int" } + }, + { + "name": "--list-tags", + "description": "List the tags of the input registry" + }, + { + "name": "--no-trunc", + "description": "Do not truncate the output" + }, + { + "name": "--tls-verify", + "description": "Require HTTPS and verify certificates when contacting registries (default true)" + } + ] + }, + { + "name": "secret", + "description": "Manage secrets", + "subcommands": [ + { + "name": "create", + "description": "Create a new secret", + "args": [ + { "name": "name" }, + { "name": "file|-", "template": "filepaths" }], + "options": [ + { "name": [ + "-d", + "--driver" + ], "description": "Specify secret driver (default \"file\")", "args": { "name": "string" } }, + { + "name": "--driver-opts", + "description": "Specify driver specific options", + "args": { "name": "map" } + }, + { + "name": "--env", + "description": "Read secret data from environment variable" + }, + { "name": [ + "-l", + "--label" + ], "description": "Specify labels on the secret", "args": { "name": "strings" } }, + { + "name": "--replace", + "description": "If a secret with the same name exists, replace it" + } + ] + }, + { + "name": "exists", + "description": "Check if a secret exists in local storage", + "args": { + "name": "secret", + "generatorName": "podman_secrets" + } + }, + { + "name": "inspect", + "description": "Inspect a secret", + "args": { + "name": "secret", + "generatorName": "podman_secrets", + "isVariadic": true + } + }, + { + "name": "ls", + "description": "List secrets", + "options": [ + { "name": [ + "-f", + "--filter" + ], "description": "Filter secret output", "args": { "name": "strings" } }, + { + "name": "--format", + "description": "Format secret output using a Go template", + "args": { "name": "string" } + }, + { "name": [ + "-n", + "--noheading" + ], "description": "Do not print headers" }, + { "name": [ + "-q", + "--quiet" + ], "description": "Print secret IDs only" } + ] + }, + { + "name": "rm", + "description": "Remove one or more secrets", + "args": { + "name": "secret", + "generatorName": "podman_secrets", + "isVariadic": true + } + } + ] + }, + { + "name": "start", + "description": "Start one or more containers", + "args": { + "name": "container", + "generatorName": "all_podman_containers", + "isVariadic": true + }, + "options": [ + { + "name": "--all", + "description": "Start all containers regardless of their state or configuration" + }, + { "name": [ + "-a", + "--attach" + ], "description": "Attach container's STDOUT and STDERR" }, + { + "name": "--detach-keys", + "description": "Select the key sequence for detaching a container (default \"ctrl-p,ctrl-q\")", + "args": { "name": "string" } + }, + { "name": [ + "-f", + "--filter" + ], "description": "Filter output based on conditions given", "args": { "name": "strings" } }, + { "name": [ + "-i", + "--interactive" + ], "description": "Make STDIN available to the contained process" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { + "name": "--sig-proxy", + "description": "Proxy received signals to the process (default true if attaching, false otherwise)" + } + ] + }, + { + "name": "stats", + "description": "Display a live stream of container resource usage statistics", + "args": { + "name": "[container]", + "generatorName": "running_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Show all containers, not just running ones" }, + { + "name": "--format", + "description": "Pretty-print container statistics to JSON or using a Go template", + "args": { "name": "string" } + }, + { "name": [ + "-i", + "--interval" + ], "description": "Time in seconds between stats reports (default 5)", "args": { "name": "int" } }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { + "name": "--no-reset", + "description": "Disable resetting the screen between intervals" + }, + { + "name": "--no-stream", + "description": "Disable streaming stats and only pull the first result" + }, + { + "name": "--no-trunc", + "description": "Do not truncate output" + } + ] + }, + { + "name": "stop", + "description": "Stop one or more containers", + "args": { + "name": "container", + "generatorName": "running_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Stop all running containers" }, + { + "name": "--cidfile", + "description": "Read the container ID from the file", + "args": { "name": "string", "template": "filepaths" } + }, + { "name": [ + "-f", + "--filter" + ], "description": "Filter output based on conditions given", "args": { "name": "strings" } }, + { "name": [ + "-i", + "--ignore" + ], "description": "Ignore errors when a specified container is missing" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }, + { "name": [ + "-t", + "--time" + ], "description": "Seconds to wait for stop before killing the container (default 10)", "args": { "name": "int" } } + ] + }, + { + "name": "system", + "description": "Manage podman", + "subcommands": [ + { "name": "check", "description": "Check storage consistency" }, + { + "name": "connection", + "description": "Manage remote API service destinations", + "subcommands": [ + { + "name": "add", + "description": "Record destination for the Podman service" + }, + { + "name": "default", + "description": "Set named destination as default" + }, + { + "name": "list", + "description": "List destination for the Podman service(s)" + }, + { + "name": "remove", + "description": "Delete named destination" + }, + { + "name": "rename", + "description": "Rename \"old\" to \"new\"" + } + ] + }, + { + "name": "df", + "description": "Show podman disk usage", + "options": [ + { + "name": "--format", + "description": "Pretty-print images using a Go template", + "args": { "name": "string" } + }, + { "name": [ + "-v", + "--verbose" + ], "description": "Show detailed information on disk usage" } + ] + }, + { + "name": "events", + "description": "Show podman system events" + }, + { + "name": "info", + "description": "Display podman system information" + }, + { "name": "migrate", "description": "Migrate containers" }, + { + "name": "prune", + "description": "Remove unused data", + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Remove all unused data" }, + { + "name": "--build", + "description": "Remove build containers" + }, + { + "name": "--external", + "description": "Remove container data in storage not controlled by podman" + }, + { + "name": "--filter", + "description": "Provide filter values (e.g. 'label==')", + "args": { "name": "strings" } + }, + { "name": [ + "-f", + "--force" + ], "description": "Do not prompt for confirmation (default false)" }, + { "name": "--volumes", "description": "Prune volumes" } + ] + }, + { "name": "renumber", "description": "Migrate lock numbers" }, + { "name": "reset", "description": "Reset podman storage" }, + { "name": "service", "description": "Run API service" } + ] + }, + { + "name": "tag", + "description": "Add an additional name to a local image", + "args": [ + { "name": "image", "generatorName": "podman_images" }, + { "name": "target_name", "isVariadic": true } + ] + }, + { + "name": "top", + "description": "Display the running processes of a container", + "args": { + "name": "container", + "generatorName": "running_podman_containers" + }, + "options": [{ "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" }] + }, + { + "name": "unmount", + "description": "Unmount working container's root filesystem", + "args": { + "name": "container", + "generatorName": "all_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Unmount all of the currently mounted containers" }, + { "name": [ + "-f", + "--force" + ], "description": "Force the complete unmount of the specified mounted containers" }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" } + ] + }, + { + "name": "unpause", + "description": "Unpause the processes in one or more containers", + "args": { + "name": "container", + "generatorName": "paused_podman_containers", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Unpause all paused containers" }, + { + "name": "--cidfile", + "description": "Read the container ID from the file", + "args": { "name": "string", "template": "filepaths" } + }, + { "name": [ + "-f", + "--filter" + ], "description": "Filter output based on conditions given", "args": { "name": "strings" } }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" } + ] + }, + { + "name": "unshare", + "description": "Run a command in a modified user namespace", + "args": { "name": "command", "isCommand": true }, + "options": [ + { + "name": "--rootless-netns", + "description": "Join the rootless network namespace used for CNI and netavark networking" + } + ] + }, + { + "name": "untag", + "description": "Remove a name from a local image", + "args": { + "name": "image", + "generatorName": "podman_images", + "isVariadic": true + } + }, + { + "name": "update", + "description": "Update an existing container", + "args": { + "name": "container", + "generatorName": "all_podman_containers" + }, + "options": [ + { "name": [ + "-c", + "--cpu-shares" + ], "description": "CPU shares (relative weight)", "args": { "name": "uint" } }, + { + "name": "--cpus", + "description": "Number of CPUs (default 0.000, meaning no limit)", + "args": { "name": "float" } + }, + { + "name": "--cpuset-cpus", + "description": "CPUs in which to allow execution (0-3, 0,1)", + "args": { "name": "string" } + }, + { + "name": "--health-cmd", + "description": "Set a healthcheck command for the container ('none' disables the existing healthcheck)", + "args": { "name": "string" } + }, + { + "name": "--health-interval", + "description": "Set an interval for the healthcheck (default \"30s\")", + "args": { "name": "string" } + }, + { + "name": "--health-retries", + "description": "Number of retries allowed before a healthcheck is considered unhealthy (default 3)", + "args": { "name": "uint" } + }, + { + "name": "--health-timeout", + "description": "Maximum time allowed to complete the healthcheck before it is considered failed (default \"30s\")", + "args": { "name": "string" } + }, + { "name": [ + "-m", + "--memory" + ], "description": "Memory limit (format: [])", "args": { "name": "string" } }, + { + "name": "--memory-swap", + "description": "Swap limit equal to memory plus swap: '-1' to enable unlimited swap", + "args": { "name": "string" } + }, + { + "name": "--no-healthcheck", + "description": "Disable healthchecks on container" + }, + { + "name": "--pids-limit", + "description": "Tune container pids limit (set -1 for unlimited)", + "args": { "name": "int" } + }, + { + "name": "--restart", + "description": "Restart policy to apply when a container exits (\"always\"|\"no\"|\"never\"|\"on-failure\"|\"unless-stopped\")", + "args": { "name": "string" } + } + ] + }, + { + "name": "version", + "description": "Display the Podman version information", + "options": [{ "name": [ + "-f", + "--format" + ], "description": "Change the output format to JSON or a Go template", "args": { "name": "string" } }] + }, + { + "name": "volume", + "description": "Manage volumes", + "subcommands": [ + { + "name": "create", + "description": "Create a new volume", + "args": { "name": "[name]" }, + "options": [ + { "name": [ + "-d", + "--driver" + ], "description": "Specify volume driver name (default \"local\")", "args": { "name": "string" } }, + { + "name": "--ignore", + "description": "Don't fail if volume already exists" + }, + { "name": [ + "-l", + "--label" + ], "description": "Set metadata for a volume", "args": { "name": "strings" } }, + { "name": [ + "-o", + "--opt" + ], "description": "Set driver specific options", "args": { "name": "strings" } } + ] + }, + { + "name": "exists", + "description": "Check if volume exists", + "args": { + "name": "volume", + "generatorName": "podman_volumes" + } + }, + { + "name": "export", + "description": "Export volumes", + "args": { + "name": "volume", + "generatorName": "podman_volumes" + } + }, + { + "name": "import", + "description": "Import a tarball contents into a podman volume", + "args": [ + { "name": "volume", "generatorName": "podman_volumes" }, + { "name": "source", "template": "filepaths" } + ] + }, + { + "name": "inspect", + "description": "Display detailed information on one or more volumes", + "args": { + "name": "volume", + "generatorName": "podman_volumes", + "isVariadic": true + }, + "options": [{ "name": [ + "-f", + "--format" + ], "description": "Format volume output using a Go template", "args": { "name": "string" } }] + }, + { + "name": "ls", + "description": "List volumes", + "options": [ + { "name": [ + "-f", + "--filter" + ], "description": "Filter volume output", "args": { "name": "strings" } }, + { + "name": "--format", + "description": "Format volume output using a Go template", + "args": { "name": "string" } + }, + { "name": [ + "-n", + "--noheading" + ], "description": "Do not print headers" }, + { "name": [ + "-q", + "--quiet" + ], "description": "Print volume output in quiet mode" } + ] + }, + { + "name": "mount", + "description": "Mount volume", + "args": { + "name": "volume", + "generatorName": "podman_volumes" + } + }, + { + "name": "prune", + "description": "Remove all unused volumes", + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Remove all volumes" }, + { "name": [ + "-f", + "--force" + ], "description": "Do not prompt for confirmation" } + ] + }, + { + "name": "reload", + "description": "Reload all volumes from volume plugins" + }, + { + "name": "rm", + "description": "Remove one or more volumes", + "args": { + "name": "volume", + "generatorName": "podman_volumes", + "isVariadic": true + }, + "options": [ + { "name": [ + "-a", + "--all" + ], "description": "Remove all volumes" }, + { "name": [ + "-f", + "--force" + ], "description": "Remove a volume by force, even if it is being used by a container" }, + { "name": [ + "-t", + "--time" + ], "description": "Seconds to wait for running containers to stop before killing them (default 10)", "args": { "name": "int" } } + ] + }, + { + "name": "unmount", + "description": "Unmount volume", + "args": { + "name": "volume", + "generatorName": "podman_volumes" + } + } + ] + }, + { + "name": "wait", + "description": "Block on one or more containers", + "args": { + "name": "container", + "generatorName": "all_podman_containers", + "isVariadic": true + }, + "options": [ + { + "name": "--condition", + "description": "Condition to wait on", + "args": { "name": "strings" } + }, + { + "name": "--ignore", + "description": "Ignore if a container does not exist" + }, + { "name": [ + "-i", + "--interval" + ], "description": "Time interval to wait before polling for completion (default \"250ms\")", "args": { "name": "string" } }, + { "name": [ + "-l", + "--latest" + ], "description": "Act on the latest container podman is aware of (not supported with --remote)" } + ] + } + ] +} diff --git a/command-signatures/src/generators/mod.rs b/command-signatures/src/generators/mod.rs index 791890b9..bd0e5c48 100644 --- a/command-signatures/src/generators/mod.rs +++ b/command-signatures/src/generators/mod.rs @@ -175,6 +175,9 @@ mod pip; mod pkill; #[cfg(test)] mod pkill_tests; +mod podman; +#[cfg(test)] +mod podman_tests; mod powershell; mod pprof; mod pyenv; @@ -244,6 +247,7 @@ pub fn dynamic_command_signature_data() -> HashMap, + image: String, +} + +pub(crate) fn post_process_podman_ps(output: &str) -> GeneratorResults { + output + .trim() + .split('\n') + .filter(|line| !line.is_empty()) + .filter_map(|line| { + let container: PodmanContainerOutput = serde_json::from_str(line).ok()?; + let name = container.names.first()?.clone(); + Some( + Suggestion::with_description(name.clone(), "Container") + .with_display_name(Some(format!("{} ({})", name, container.image))) + .with_icon(IconType::DockerContainer), + ) + }) + .collect_unordered_results() +} + +/// `podman images --format '{{ json . }}'` mixes casing: `repository`/`tag` are +/// lower-cased while most other fields (e.g. `Id`, `Size`) are PascalCase. +#[derive(Debug, Deserialize)] +struct PodmanImageOutput { + #[serde(default)] + repository: Option, + #[serde(default)] + tag: Option, +} + +pub(crate) fn post_process_podman_images(output: &str) -> GeneratorResults { + output + .trim() + .split('\n') + .filter(|line| !line.is_empty()) + .filter_map(|line| { + let image: PodmanImageOutput = serde_json::from_str(line).ok()?; + let repository = image.repository?; + if repository == "" { + return None; + } + let tag = image.tag.filter(|tag| tag != ""); + Some(match tag { + Some(tag) => Suggestion::with_description(repository, tag), + None => Suggestion::new(repository), + }) + .map(|suggestion| suggestion.with_icon(IconType::DockerImage)) + }) + .collect_unordered_results() +} + +/// Parses the pipe-separated output of `podman pod ps --format '{{.Name}}|{{.Status}}'`. +pub(crate) fn post_process_podman_pods(output: &str) -> GeneratorResults { + output + .trim() + .split('\n') + .filter(|line| !line.is_empty()) + .filter_map(|line| { + let mut parts = line.splitn(2, '|'); + let name = parts.next()?.trim(); + if name.is_empty() { + return None; + } + let status = parts.next().unwrap_or("").trim(); + Some(Suggestion::with_description(name, status)) + }) + .collect_unordered_results() +} + +#[derive(Debug, Deserialize)] +#[serde(rename_all = "PascalCase")] +struct PodmanVolumeOutput { + name: String, + driver: String, +} + +pub(crate) fn post_process_podman_volumes(output: &str) -> GeneratorResults { + output + .trim() + .split('\n') + .filter(|line| !line.is_empty()) + .filter_map(|line| { + let volume: PodmanVolumeOutput = serde_json::from_str(line).ok()?; + Some(Suggestion::with_description(volume.name, volume.driver)) + }) + .collect_unordered_results() +} + +/// `podman network ls --format '{{ json . }}'` uses lower snake_case field names. +#[derive(Debug, Deserialize)] +struct PodmanNetworkOutput { + name: String, + driver: String, +} + +pub(crate) fn post_process_podman_networks(output: &str) -> GeneratorResults { + output + .trim() + .split('\n') + .filter(|line| !line.is_empty()) + .filter_map(|line| { + let network: PodmanNetworkOutput = serde_json::from_str(line).ok()?; + Some(Suggestion::with_description(network.name, network.driver)) + }) + .collect_unordered_results() +} + +#[derive(Debug, Deserialize)] +struct PodmanSecretOutput { + #[serde(rename = "Name")] + name: String, + #[serde(rename = "Driver")] + driver: String, +} + +pub(crate) fn post_process_podman_secrets(output: &str) -> GeneratorResults { + output + .trim() + .split('\n') + .filter(|line| !line.is_empty()) + .filter_map(|line| { + let secret: PodmanSecretOutput = serde_json::from_str(line).ok()?; + Some(Suggestion::with_description(secret.name, secret.driver)) + }) + .collect_unordered_results() +} + +/// `podman machine list --format json` prints a single JSON array (unlike the +/// newline-delimited JSON objects most other `podman ... ls` commands print). +#[derive(Debug, Deserialize)] +struct PodmanMachineOutput { + #[serde(rename = "Name")] + name: String, + #[serde(rename = "VMType")] + vm_type: String, + #[serde(rename = "Running")] + running: bool, +} + +pub(crate) fn post_process_podman_machines(output: &str) -> GeneratorResults { + let trimmed = output.trim(); + if trimmed.is_empty() { + return GeneratorResults::default(); + } + + let machines: Vec = match serde_json::from_str(trimmed) { + Ok(machines) => machines, + Err(err) => { + log::warn!( + "Unable to deserialize podman machine output with err {:?}", + err + ); + return GeneratorResults::default(); + } + }; + + machines + .into_iter() + .map(|machine| { + let status = if machine.running { + "running" + } else { + "stopped" + }; + Suggestion::with_description(machine.name, format!("{} - {}", machine.vm_type, status)) + }) + .collect_unordered_results() +} + +pub fn generator() -> CommandSignatureGenerators { + CommandSignatureGenerators::new("podman") + .add_generator( + "running_podman_containers", + Generator::script( + CommandBuilder::single_command("podman ps --format '{{ json . }}'"), + post_process_podman_ps, + ), + ) + .add_generator( + "all_podman_containers", + Generator::script( + CommandBuilder::single_command("podman ps -a --format '{{ json . }}'"), + post_process_podman_ps, + ), + ) + .add_generator( + "paused_podman_containers", + Generator::script( + CommandBuilder::single_command( + "podman ps --filter status=paused --format '{{ json . }}'", + ), + post_process_podman_ps, + ), + ) + .add_generator( + "podman_images", + Generator::script( + CommandBuilder::single_command("podman images --format '{{ json . }}'"), + post_process_podman_images, + ), + ) + .add_generator( + "podman_pods", + Generator::script( + CommandBuilder::single_command("podman pod ps --format '{{.Name}}|{{.Status}}'"), + post_process_podman_pods, + ), + ) + .add_generator( + "podman_volumes", + Generator::script( + CommandBuilder::single_command("podman volume ls --format '{{ json . }}'"), + post_process_podman_volumes, + ), + ) + .add_generator( + "podman_networks", + Generator::script( + CommandBuilder::single_command("podman network ls --format '{{ json . }}'"), + post_process_podman_networks, + ), + ) + .add_generator( + "podman_secrets", + Generator::script( + CommandBuilder::single_command("podman secret ls --format '{{ json . }}'"), + post_process_podman_secrets, + ), + ) + .add_generator( + "podman_machines", + Generator::script( + CommandBuilder::single_command("podman machine list --format json"), + post_process_podman_machines, + ), + ) +} diff --git a/command-signatures/src/generators/podman_tests.rs b/command-signatures/src/generators/podman_tests.rs new file mode 100644 index 00000000..927b0e66 --- /dev/null +++ b/command-signatures/src/generators/podman_tests.rs @@ -0,0 +1,141 @@ +use super::podman::{ + post_process_podman_images, post_process_podman_machines, post_process_podman_networks, + post_process_podman_pods, post_process_podman_ps, post_process_podman_secrets, + post_process_podman_volumes, +}; + +/// Captured from `podman ps -a --format '{{ json . }}'` on podman 5.4.2. +const PS_OUTPUT: &str = r#"{"AutoRemove":false,"Command":["sleep","300"],"Created":"2026-09-09T18:06:22.031132143Z","CreatedAt":"","CIDFile":"","Exited":false,"ExitedAt":-62135596800,"ExitCode":0,"ExposedPorts":null,"Id":"961ebd04c842","Image":"docker.io/library/alpine:latest","ImageID":"d529dd0c6e55","IsInfra":false,"Labels":null,"Mounts":[],"Names":["test-ctr"],"Namespaces":{},"Networks":[],"Pid":0,"Pod":"","PodName":"","Ports":null,"Restarts":0,"Size":null,"StartedAt":-62135596800,"State":"created","Status":""}"#; + +#[test] +fn test_post_process_podman_ps_parses_real_output() { + let results = post_process_podman_ps(PS_OUTPUT); + + assert_eq!(results.suggestions.len(), 1); + assert_eq!(results.suggestions[0].exact_string, "test-ctr"); + assert_eq!( + results.suggestions[0].display_name.as_deref(), + Some("test-ctr (docker.io/library/alpine:latest)") + ); +} + +#[test] +fn test_post_process_podman_ps_empty_output() { + assert!(post_process_podman_ps("").suggestions.is_empty()); +} + +/// `podman images --format '{{ json . }}'` mixes casing: `repository`/`tag` are +/// lower-cased while most other fields (e.g. `Id`, `Size`) are PascalCase. +const IMAGES_OUTPUT: &str = r#"{"repository":"docker.io/library/alpine","tag":"latest","Id":"d529dd0c6e55","ParentId":"","RepoTags":["docker.io/library/alpine:latest"],"RepoDigests":[],"Created":1781568089,"Size":8709729,"SharedSize":0,"VirtualSize":8709729,"Labels":null,"Containers":2,"Digest":"sha256:abc","History":[],"Names":[]}"#; + +#[test] +fn test_post_process_podman_images_parses_real_output() { + let results = post_process_podman_images(IMAGES_OUTPUT); + + assert_eq!(results.suggestions.len(), 1); + assert_eq!( + results.suggestions[0].exact_string, + "docker.io/library/alpine" + ); + assert_eq!( + results.suggestions[0].description.as_deref(), + Some("latest") + ); +} + +#[test] +fn test_post_process_podman_images_skips_none_repository() { + let output = r#"{"repository":"","tag":""}"#; + assert!(post_process_podman_images(output).suggestions.is_empty()); +} + +#[test] +fn test_post_process_podman_pods_parses_pipe_separated_rows() { + let output = "mypod|Running\n\nother-pod|Exited"; + let results = post_process_podman_pods(output); + let names: Vec<&str> = results + .suggestions + .iter() + .map(|suggestion| suggestion.exact_string.as_str()) + .collect(); + + assert_eq!(names, vec!["mypod", "other-pod"]); + assert_eq!( + results.suggestions[0].description.as_deref(), + Some("Running") + ); +} + +#[test] +fn test_post_process_podman_pods_empty_output() { + assert!(post_process_podman_pods("").suggestions.is_empty()); +} + +/// Captured from `podman volume ls --format '{{ json . }}'` on podman 5.4.2. +const VOLUME_OUTPUT: &str = r#"{"Name":"test-vol","Driver":"local","Mountpoint":"/x","CreatedAt":"2026-09-09T18:06:40Z","Labels":{},"Scope":"local","Options":{},"MountCount":0,"NeedsCopyUp":true,"NeedsChown":true,"LockNumber":2}"#; + +#[test] +fn test_post_process_podman_volumes_parses_real_output() { + let results = post_process_podman_volumes(VOLUME_OUTPUT); + + assert_eq!(results.suggestions.len(), 1); + assert_eq!(results.suggestions[0].exact_string, "test-vol"); + assert_eq!(results.suggestions[0].description.as_deref(), Some("local")); +} + +/// Captured from `podman network ls --format '{{ json . }}'` on podman 5.4.2. Unlike most +/// other podman list commands, network fields are lower snake_case, not PascalCase. +const NETWORK_OUTPUT: &str = r#"{"name":"podman","id":"2f259bab93aa","driver":"bridge","network_interface":"podman0","created":"2026-09-09T18:06:41Z","subnets":[],"ipv6_enabled":false,"internal":false,"dns_enabled":false,"ipam_options":{}}"#; + +#[test] +fn test_post_process_podman_networks_parses_real_output() { + let results = post_process_podman_networks(NETWORK_OUTPUT); + + assert_eq!(results.suggestions.len(), 1); + assert_eq!(results.suggestions[0].exact_string, "podman"); + assert_eq!( + results.suggestions[0].description.as_deref(), + Some("bridge") + ); +} + +/// Captured from `podman secret ls --format '{{ json . }}'` on podman 5.4.2. +const SECRET_OUTPUT: &str = r#"{"ID":"a9b29ea1a8fc","Name":"test-secret","Driver":"file","CreatedAt":"now","UpdatedAt":"now"}"#; + +#[test] +fn test_post_process_podman_secrets_parses_real_output() { + let results = post_process_podman_secrets(SECRET_OUTPUT); + + assert_eq!(results.suggestions.len(), 1); + assert_eq!(results.suggestions[0].exact_string, "test-secret"); + assert_eq!(results.suggestions[0].description.as_deref(), Some("file")); +} + +/// `podman machine list --format json` prints a single JSON array of objects, matching +/// the example in the official `podman-machine-list` documentation. +const MACHINE_OUTPUT: &str = r#"[{"Name":"podman-machine-default","Default":false,"Created":"2021-12-27T10:36:14Z","Running":false,"LastUp":"2021-12-27T11:22:50Z","Stream":"default","VMType":"qemu","CPUs":1,"Memory":"2147483648","DiskSize":"10737418240"}]"#; + +#[test] +fn test_post_process_podman_machines_parses_real_output() { + let results = post_process_podman_machines(MACHINE_OUTPUT); + + assert_eq!(results.suggestions.len(), 1); + assert_eq!( + results.suggestions[0].exact_string, + "podman-machine-default" + ); + assert_eq!( + results.suggestions[0].description.as_deref(), + Some("qemu - stopped") + ); +} + +#[test] +fn test_post_process_podman_machines_empty_output() { + assert!(post_process_podman_machines("").suggestions.is_empty()); +} + +#[test] +fn test_post_process_podman_machines_empty_array() { + assert!(post_process_podman_machines("[]").suggestions.is_empty()); +}