{"id":20612931,"url":"https://github.com/ntavelis/dockerexec","last_synced_at":"2026-01-08T20:41:23.725Z","repository":{"id":248123266,"uuid":"821094613","full_name":"ntavelis/dockerExec","owner":"ntavelis","description":"Colorful and customizable docker exec bash prompt","archived":false,"fork":false,"pushed_at":"2024-07-30T13:04:10.000Z","size":173,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T05:04:12.253Z","etag":null,"topics":["bash-prompt","developer-tools","devops-tools","docker"],"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/ntavelis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-06-27T19:57:21.000Z","updated_at":"2024-07-30T13:01:37.000Z","dependencies_parsed_at":"2024-07-30T16:15:59.197Z","dependency_job_id":"70646a3f-ac1c-464f-a3e4-f4f87ea40d71","html_url":"https://github.com/ntavelis/dockerExec","commit_stats":null,"previous_names":["ntavelis/dockerexec"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntavelis%2FdockerExec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntavelis%2FdockerExec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntavelis%2FdockerExec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntavelis%2FdockerExec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntavelis","download_url":"https://codeload.github.com/ntavelis/dockerExec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246612494,"owners_count":20805354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bash-prompt","developer-tools","devops-tools","docker"],"created_at":"2024-11-16T11:08:23.121Z","updated_at":"2026-01-08T20:41:18.680Z","avatar_url":"https://github.com/ntavelis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker exec\n\n## Intro\ndockerExec is a CLI tool written in Go that provides an enhanced alternative to docker exec -it \u003ccontainer_id\u003e /bin/bash. It opens a bash session inside a specified Docker container with a customizable and user-friendly prompt.\n\nEssentially transforming this:\\\n![Native docker exec bash session prompt](.docs/docker_native.png)\n\nTo this:\\\n![Docker exec colorful bash prompt](.docs/docker_exec.png)\n\n## Installation\n\n### Go install\nIf you have golang locally, you can install it via go:\n```bash\ngo install github.com/ntavelis/dockerExec/cmd/dockerExec@latest\n```\n### Latest binary\n[Download the latest binary from here](https://github.com/ntavelis/dockerExec/releases/latest), it contains a pre-compiled gzipped binary.\n\nFor instance for, VERSION=v1.0.0 and BINARY=dockerExec_Linux_x86_64\n```bash\nwget https://github.com/ntavelis/dockerExec/releases/download/${VERSION}/${BINARY}.tar.gz -O - |\\\n  tar xz \u0026\u0026 mv dockerExec /usr/bin/dockerExec \u0026\u0026 rm README.md\n```\n\n## Usage\n\n### Basic Usage\nTo open a bash session inside a Docker container with the default prompt style:\n\n```bash\ndockerExec \u003ccontainerID\u003e\n```\n\n### Full usage with flags\nYou can customize the shell, user, prompt style, and prompt symbol using flags:\n```bash\ndockerExec --shell=/bin/bash --user=root --promptStyle=\"\\\\u@\\\\w:\\\\p\" --promptSymbol=\"$\" \u003ccontainerID\u003e\n```\n\n### Flags\n\n* --shell: Specify the shell to use (default: /bin/bash)\n* --user: Specify the user to run the shell as (default: current user)\n* --promptStyle: Customize the prompt style (default: \"👨\\\\\\u ~\u003e 📂\\\\\\w\\r\\n\\\\\\p\")\n* --promptSymbol: Customize the prompt symbol (default: \"\u003e\")\n* --help(-h): Display the help message\n* --version(-v): Display version information\n\n## Customizing the Prompt\n\n### Prompt Style (--promptStyle)\n\nThe --promptStyle flag allows you to customize the appearance of your bash prompt. The following placeholders are supported:\n\n* \\\\\\u: Replaced with the current user\n* \\\\\\w: Replaced with the current working directory\n* \\\\\\p: Replaced with the prompt symbol (passed with the --promptSymbol flag)\n\nNote: Special chars \\n \\r \\t are supported currently and can be used to promptStyle flag\n\n#### Example\n\nIf you want your prompt to display the user and the working directory followed by the prompt symbol, you can set it like this:\n\n```bash\ndockerExec --promptStyle=\"\\\\u@\\\\w:\\\\p\" \u003ccontainerID\u003e\n```\n\n### Prompt Symbol (--promptSymbol)\n\nThe --promptSymbol flag allows you to define a custom symbol to be used at the end of the prompt. This symbol will replace the \\\\p placeholder in the --promptStyle flag.\n\n#### Example\n\n```bash\ndockerExec --promptSymbol=\"$\" \u003ccontainerID\u003e\n```\n\n## Examples of custom prompts to get inspired\n\nThe below commands will customize the prompt, you can add them as alias in your terminal to easily use custom prompt in docker containers.\n\n### Example 1: User at Hostname\n\n```bash\ndockerExec --promptStyle=\"\\\\u@\\\\w:\\\\p\" --promptSymbol=\"\\$\" \u003ccontainerID\u003e\n```\n\n![example prompt1](.docs/prompt1.png)\n\n### Example 2: Minimal Prompt\n\n```bash\ndockerExec --promptStyle=\"\\\\w \\\\p\" --promptSymbol=\"\u003e\" \u003ccontainerID\u003e\n```\n\n![example prompt2](.docs/prompt2.png)\n\n### Example 3: Emoji Prompt\n\n```bash\ndockerExec --promptStyle=\"👤\\\\u 💻\\\\w 📝\\\\p\" --promptSymbol=\"\u003e\" \u003ccontainerID\u003e\n```\n\n![example prompt3](.docs/prompt3.png)\n\n### Example 4: Multiline Prompt\n\n```bash\ndockerExec --promptStyle=\"\\\\u@\\\\w\\n\\r\\\\p\" --promptSymbol=\"\\$\" \u003ccontainerID\u003e\n```\n\n![example prompt4](.docs/prompt4.png)\n\n### Example 5: Prompt with container info\n\n```bash\nexport container_name=$(docker inspect -f '{{.Name}}' cool_container | cut -c 2-)\nexport container_status=$(docker inspect -f '{{.State.Status}}' cool_container)\ndockerExec --promptStyle=\"\\\\u@[$container_name ($container_status)]:\\\\w\\n\\r\\\\p\" --promptSymbol=\"\u003e\" \u003ccontainerID\u003e\n```\n\n![example prompt5](.docs/prompt5.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntavelis%2Fdockerexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntavelis%2Fdockerexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntavelis%2Fdockerexec/lists"}