{"id":24272456,"url":"https://github.com/doppelar0n/docker-compose-exec","last_synced_at":"2026-05-04T17:34:18.692Z","repository":{"id":272071762,"uuid":"915439337","full_name":"doppelar0n/docker-compose-exec","owner":"doppelar0n","description":"A CLI tool for discovering Docker Compose files and their services across multiple directories.   Select a Compose file and service interactively, then execute a custom command on the service.","archived":false,"fork":false,"pushed_at":"2025-06-27T22:09:08.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T23:20:42.176Z","etag":null,"topics":["cli-tool","docker","docker-compose","open-source"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doppelar0n.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-11T21:06:26.000Z","updated_at":"2025-06-27T22:08:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"feff2f39-d5af-49e4-872a-2e0e9b429996","html_url":"https://github.com/doppelar0n/docker-compose-exec","commit_stats":null,"previous_names":["doppelar0n/docker-compose-exec"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/doppelar0n/docker-compose-exec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doppelar0n%2Fdocker-compose-exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doppelar0n%2Fdocker-compose-exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doppelar0n%2Fdocker-compose-exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doppelar0n%2Fdocker-compose-exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doppelar0n","download_url":"https://codeload.github.com/doppelar0n/docker-compose-exec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doppelar0n%2Fdocker-compose-exec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32617954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-tool","docker","docker-compose","open-source"],"created_at":"2025-01-15T18:26:36.060Z","updated_at":"2026-05-04T17:34:18.686Z","avatar_url":"https://github.com/doppelar0n.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-compose-exec\n\nA CLI tool for discovering Docker Compose files and their services across multiple directories.  \nSelect a Compose file and service interactively, then execute a custom command on the service.\n\n## Features\n\n- Automatically searches for Docker Compose files (`docker-compose.yml`, `compose.yml`, etc.) in predefined paths.\n- Interactive terminal-based UI for selecting Compose files and services.\n- Executes a configurable shell command on the selected service.\n\n## Installation\n\n1. Download the latest release binary from the [releases page](https://github.com/doppelar0n/docker-compose-exec/releases).\n    ```bash\n    wget https://github.com/doppelar0n/docker-compose-exec/releases/latest/download/docker-compose-exec-amd64\n    ```\n2. Copy the binary to `/usr/local/bin`:\n    ```bash\n    sudo mv docker-compose-exec-amd64 /usr/local/bin/docker-compose-exec\n    ```\n3. Make the binary executable:\n    ```bash\n    sudo chmod +x /usr/local/bin/docker-compose-exec\n    ```\n\n## Usage\n\nJust run:\n```bash\ndocker-compose-exec\n```\nThis launch the tool with default paths and interactive UI.\n\n### Optional Environment Variables\n\nYou can configure the following environment variables:\n\n- CONTAINER_BASE_PATH\n    Specify paths to search for Docker Compose files (colon-separated). Example:\n    ```bash\n    export CONTAINER_BASE_PATH=\"/path/to/containers:/another/path\"\n    ```\n    Default paths include `/var/container` and `/srv/container`.\n    You can limit the search depth with CONTAINER_BASE_PATH_MAX_DEPTH.\n    ```bash\n    export CONTAINER_BASE_PATH=\"4\"\n    ```\n    Default depth is 2.\n- CONTAINER_EXEC_COMMAND\n    Customize the execution command. Example:\n    ```bash\n    export CONTAINER_EXEC_COMMAND=\"docker compose -f %COMPOSE exec --user root %SERVICE /bin/bash\"\n    ```\n    - `%COMPOSE` will be replaced with the path to the selected Compose file.\n    - `%SERVICE` will be replaced with the selected service.\n- CONTAINER_EXEC_COMMAND_NOT_RUNNING\n    Customize the execution command if the docker container is not running. Example:\n    ```bash\n    export CONTAINER_EXEC_COMMAND_NOT_RUNNING=\"echo %COMPOSE %SERVICE is not running.\"\n    ```\n    - `%COMPOSE` will be replaced with the path to the selected Compose file.\n    - `%SERVICE` will be replaced with the selected service.\n\n## Example\n\nImagine you have the following directory structure:\n\n```bash\n/var/container\n├── project1/\n│   └── docker-compose.yml\n├── project2/\n│   └── compose.yml\n/srv/container\n└── project3/\n    └── docker-compose.yaml\n```\n\nRunning `docker-compose-exec` will:\n- Discover these Compose files.\n- Allow you to select a file (e.g., project1/docker-compose.yml).\n- List available services from the selected file.\n- Execute the configured command (e.g., docker exec) on the chosen service.\n\n### more Examples:\n- Specify custom search paths for Compose files.\n    ```bash\n    CONTAINER_BASE_PATH=\"/var/mycontainers:/srv/containers\" docker-compose-exec\n    ```\n- Use a custom execution command.\n    ```bash\n    CONTAINER_EXEC_COMMAND=\"docker compose -f %COMPOSE exec %SERVICE /bin/bash\" docker-compose-exec\n    ```\n- This is like dry run. (--dry-run)\n    ```bash\n    CONTAINER_EXEC_COMMAND=\"echo %COMPOSE %SERVICE\" docker-compose-exec\n    ```\n- `CONTAINER_EXEC_COMMAND` will only be exec if docker compose service is running. If it is not runing `CONTAINER_EXEC_COMMAND_NOT_RUNNING` will be executed.\n    ```bash\n    CONTAINER_EXEC_COMMAND_NOT_RUNNING=\"echo %COMPOSE %SERVICE is not running\" docker-compose-exec\n    ```\n- You can set the maximum depth of the recursive search for Docker Compose files (default depth is 2).\n    ```bash\n    CONTAINER_BASE_PATH_MAX_DEPTH=\"5\" docker-compose-exec\n    ```\n\n## Command Line Tips\n\n### Run Lint Locally Before Committing\n```bash\ngolangci-lint run -v\n```\n\n### Run the Go Project Locally\n```bash\ngo run .\n```\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request with any enhancements or bug fixes.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoppelar0n%2Fdocker-compose-exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoppelar0n%2Fdocker-compose-exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoppelar0n%2Fdocker-compose-exec/lists"}