MCPcopy
hub / github.com/learnhouse/learnhouse / getRunningContainers

Function getRunningContainers

apps/cli/tests/helpers.ts:54–61  ·  view source on GitHub ↗
(nameFilter: string)

Source from the content-addressed store, hash-verified

52
53/** Returns the names of running containers matching a substring */
54export function getRunningContainers(nameFilter: string): string[] {
55 const r = spawnSync(
56 'docker',
57 ['ps', '--filter', `name=${nameFilter}`, '--format', '{{.Names}}'],
58 { encoding: 'utf-8' },
59 )
60 return r.status === 0 ? r.stdout.trim().split('\n').filter(Boolean) : []
61}
62
63/** Run a command inside a compose service and return stdout */
64export function composeExec(cwd: string, service: string, cmd: string): string {

Callers 3

appRunningFunction · 0.85
appContainerFunction · 0.85

Calls 1

filterMethod · 0.80

Tested by 2

appRunningFunction · 0.68
appContainerFunction · 0.68