{"id":15066022,"url":"https://github.com/iuv/xx","last_synced_at":"2026-03-15T05:43:14.754Z","repository":{"id":105695187,"uuid":"104849045","full_name":"iuv/xx","owner":"iuv","description":"This tool simplifies the use of common shell, docker, and kubernetes commands","archived":false,"fork":false,"pushed_at":"2024-01-25T06:52:20.000Z","size":52567,"stargazers_count":68,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T12:21:28.596Z","etag":null,"topics":["docker","k8s","kubernetes","shell"],"latest_commit_sha":null,"homepage":"http://blog.jisuye.com/xx/","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/iuv.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}},"created_at":"2017-09-26T07:10:11.000Z","updated_at":"2025-01-11T07:21:00.000Z","dependencies_parsed_at":"2024-06-20T21:33:28.296Z","dependency_job_id":"8b964328-8b7b-4356-b311-f5fb435aee3f","html_url":"https://github.com/iuv/xx","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iuv%2Fxx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iuv%2Fxx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iuv%2Fxx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iuv%2Fxx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iuv","download_url":"https://codeload.github.com/iuv/xx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225975,"owners_count":21068094,"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":["docker","k8s","kubernetes","shell"],"created_at":"2024-09-25T00:59:55.972Z","updated_at":"2026-03-15T05:43:09.722Z","avatar_url":"https://github.com/iuv.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[中文说明](https://github.com/iuv/xx/blob/master/README_ZH.md)\n\n# xx simplified command tool v1.4.0\n![License](https://img.shields.io/badge/license-MIT-4EB1BA)\n[![wiki](https://img.shields.io/badge/Document-Wiki-green)](http://blog.jisuye.com/xx)\n\nThis tool simplifies the use of common shell, docker, and kubernetes commands\n\nThe 0.X version is written in python, and the running environment needs to support py and the sh script to support running. In order to solve the running environment dependency and maintain single-file execution\n\n1.X and later versions will be written in go language\n\nIf you need to compile it yourself, you can clone this repository and run the build.sh script\n## demo\n![demo](https://raw.githubusercontent.com/iuv/xx/master/demo.gif?sanitize=true)\n## installation method\n1. Mac use `wget https://raw.githubusercontent.com/iuv/xx/master/build/mac/x86/xx` to download xx file(x86/arm64)\n2. linux uses `wget https://raw.githubusercontent.com/iuv/xx/master/build/linux/x86/xx` to download xx file(x86/arm/arm64)\n3. Execute `chmod +x xx; ./xx install` to install\n4. You can use the `xx` command\n5. Update using `xx update` command\n6. Use `xx h` for help, `xx zh` for Chinese help\n\n## Use help as follows:\n\n![help](https://raw.githubusercontent.com/iuv/xx/master/xx.svg?sanitize=true)\n\n### shell:\n1. xx ip [port] Get local ip and public network ip (if there is an external network)\n````\n Example result:\n Local IP: 172.16.112.12\n HTTP Server: http://172.16.112.12\n HTTP Server: http://172.16.112.12:8080\n Public Network IP: 8.8.8.8\n optional output\n HTTP Server: http://172.16.112.12:[port]\n````\n2. xx ps [str] Get the process, fuzzy search according to str, and highlight\n\n### docker (parameters are empty and use \"@\" placeholder when subsequent parameters are required):\n1. Run the docker command, use\n```shell\nxx dr [image] [container] [port]\nor\nxx drun [image] [container] [port]\n````\nBy default, the background process is used to start the docker image name supports fuzzy search, container sets the container name, port is the port number of the mapping\nSupport \"8080:8080\" and \"8080\" two methods, \"8080\" will be automatically completed as \"8080:8080\"\n\n2. To query the docker container log command, use\n\n```shell\nxx dl [container] [lines]\nor\nxx dlog [container] [lines]\n````\nQuery container output log, container supports image/container name fuzzy search, lines is the number of output lines, default 100 lines\n\n3. Enter the docker bash command and use\n```shell\nxx de [container]\nor\nxx dexec [container]\n````\nEnter the container bash, container supports image/container name fuzzy search\n\n4. Start the docker container command, use\n```shell\nxx ds [container]\nor\nxx dstart [container]\n````\nStart the container, container supports image/container name fuzzy search\n\n5. Restart the docker command and use\n```shell\nxx drs [container]\nor\nxx drestart [container]\n````\nRestart the container, container supports image/container name fuzzy search\n\n6. Stop the container command and use\n```shell\nxx dk [container]\nor\nxx dstop [container]\n````\nStop the container, container supports image/container name fuzzy search\n\n7. Find the docker image and use\n```shell\nxx di [image]\nor\nxx dimages [image]\n````\nFind images, image supports fuzzy search\n\n8. Pull the docker image and use\n```shell\nxx dpl [imageFullPath]\nor\nxx dpull [imageFullPath]\n````\nPull image, image full path\n\n9. Push the docker image and use\n```shell\nxx dph [image]\nor\nxx dpush [image]\n````\nPush image, image supports fuzzy search\n\n10. Set tag of the docker image and use\n```shell\nxx dt [image] [tag]\nor\nxx dtag [image] [tag]\n````\nImage tagging, image supports fuzzy search, tag is the name of the tag that needs to be tagged\n\n11, docker view all containers, use\n```shell\nxx dps [container]\n````\nView all containers (running and stopped), container supports image/container name fuzzy search\n\n12. Docker deletes the image and the container started using the image, using\n```shell\nxx drm [image]\n````\nDelete the image and all containers started using the image, image supports fuzzy search\n\n13. Docker local-containers copy files to each other, use\n```shell\n# Copy the files in the container to the local\nxx dc [container]:[filePath] [localPath]\n# Copy local files to the container\nxx dc [localPath] [container]:[filePath]\nor\n# Copy the files in the container to the local\nxx dcp [container]:[filePath] [localPath]\n# Copy local files to the container\nxx dcp [localPath] [container]:[filePath]\n````\nDocker local-containers copy files to each other, container name supports fuzzy search filePath container file/folder path localPath local file path eg: xx dc mysql:/tmp/a.sql .\n\n14. Docker saves the image as a local file and uses\n```shell\nxx dsa [image] [fileName]\nor\nxx dsave [image] [fileName]\n````\nDocker saves the image as a local file, image supports fuzzy search for the file name saved by fileName\n\n15. Docker imports images from local files, using\n```shell\nxx dlo [fileName]\nor\nxx dload [fileName]\n````\nDocker imports images from local files, fileName is the file name to be imported\n\n16. Docker saves the running container as an image, using\n```shell\nxx dco [container] [image]\nor\nxx dcommit [container] [image]\n````\nDocker saves the running container as an image, container name supports fuzzy search image saved image name\n\n17, docker view the image creation history, use\n```shell\nxx dh [image]\nor\nxx dhistory [image]\n````\ndocker view the image creation history, image image name supports fuzzy search\n\n18. Docker builds the image (execute in the directory where the Dockerfile is located)\n```shell\nxx db [image]\nor\nxx dbuild [image]\n````\nDocker builds an image and executes it in the directory where the Dockerfile is located. image is the image name\n\n### k8s (\"@\" is used when the parameter is empty and subsequent parameters are required):\n#### 1.exec\n1.1 Enter the pod bash command and use\n```shell\nxx ke [pod] [namespace] [sh]\nor\nxx kexe [pod] [namespace] [sh]\n````\nLog in to pod bash, the pod pod name supports fuzzy search, the namespace to which the namespace belongs supports fuzzy search, sh defaults to bash, and there are special ones that can be passed in (under /bin/ directory)\n\n#### 2.log\n2.1 To query the pod log command, use\n```shell\nxx kl [pod] [namespace] [lines]\nor\nxx klog [pod] [namespace] [lines]\n````\nQuery the pod log, the pod name supports fuzzy search, the namespace to which the namespace belongs supports fuzzy search, lines is the number of output lines, the default is 100 lines\n\n#### 3.query\n3.1 Query the namespace command, use\n```shell\nxx kn [namespace]\nor\nxx kns [namespace]\nor\nxx knamespace [namespace]\n````\nnamespace supports fuzzy search\n\n3.2 To query the pod command, use\n```shell\nxx kp [pod] [namespace]\nor\nxx kpod [pod] [namespace]\n````\npod Fuzzy matching pod, if you want to query all namespace namespaces support fuzzy matching\n\n3.3 Query the deployments command, use\n```shell\nxx kd [deployment] [namespace]\nor\nxx kdeployment [deployment] [namespace]\n````\nDeployment name supports ambiguity, namespace namespace supports ambiguity \n\n3.4 Query the ingress command, use\n```shell\nxx ki [ingress] [namespace]\nor\nxx kingress [ingress] [namespace]\n````\ningress name supports ambiguity, namespace namespace supports ambiguity\n\n3.5 Query the service command, use\n```shell\nxx ks [service] [namespace]\nor\nxx kservice [service] [namespace]\n````\nService name supports ambiguity, namespace namespace supports ambiguity\n\n3.6 Query the configmap command, use\n```shell\nxx kc [configmap] [namespace]\nor\nxx kconfigmap [configmap] [namespace]\n````\nconfigmap names support ambiguity, namespace namespaces support ambiguity\n\n3.7 To query the secret command, use\n```shell\nxx ksec [secret] [namespace]\nor\nxx ksecret [secret] [namespace]\n````\nThe secret name supports ambiguity, and the namespace namespace supports ambiguity\n\n3.8 To query the statefulset command, use\n```shell\nxx kss [statefulset] [namespace]\nor\nxx kstatefulset [statefulset] [namespace]\n````\nStatefulset names support ambiguity, namespace namespaces support ambiguity\n\n3.9 To query the CR command, use\n```shell\nxx kcr [cr] [cr key] [namespace]\n```\ncr type ,cr key support ambiguity, namespace namespaces support ambiguity\n\n#### 4.describe\n4.1 To query the pod describe command, use\n```shell\nxx kpd [pod] [namespace] [key]\nor\nxx kpodd [pod] [namespace] [key]\n````\npod name supports fuzzy search, namespace namespace supports fuzzy search, key use by grep content\n\n4.2 To query the ingress describe command, use\n```shell\nxx kid [ingress] [namespace] [key]\nor\nxx kingressd [ingress] [namespace] [key]\n````\ningress name supports fuzzy search, namespace namespace supports fuzzy search, key use by grep content\n\n4.3 To query the service describe command, use\n```shell\nxx ksd [service] [namespace] [key]\nor\nxx kserviced [service] [namespace] [key]\n````\nThe service name supports fuzzy search, and the namespace namespace supports fuzzy search, key use by grep content\n\n4.4 To query the deployment describe command, use\n```shell\nxx kdd [deployment] [namespace] [key]\nor\nxx kdeploymentd [deployment] [namespace] [key]\n````\nThe deployment name supports fuzzy search, and the namespace namespace supports fuzzy search, key use by grep content\n\n4.5 To query the configmap describe command, use\n```shell\nxx kcd [configmap] [namespace] [key]\nor\nxx kconfigmapd [configmap] [namespace] [key]\n````\nconfigmap name supports fuzzy search, namespace namespace supports fuzzy search, key use by grep content\n\n4.6 To query the secret describe command, use\n```shell\nxx ksecd [secret] [namespace] [key]\nor\nxx ksecretd [secret] [namespace] [key]\n````\nThe secret name supports fuzzy search, and the namespace namespace supports fuzzy search, key use by grep content\n\n4.7 To query the statefulset describe command, use\n```shell\nxx kssd [statefulset] [namespace] [key]\nor\nxx kstatefulsetd [statefulset] [namespace] [key]\n````\nThe statefulset name supports fuzzy search, and the namespace namespace supports fuzzy search, key use by grep content\n\n4.8 To query the CR describe command, use\n```shell\nxx kcrd [cr] [cr key] [namespace] [key]\n```\ncr type ,cr key supports fuzzy search, and the namespace namespace supports fuzzy search, key use by grep content\n\n#### 5.yaml\n5.1 Save the pod yaml command and use\n```shell\nxx kpy [pod] [namespace] [file]\nor\nxx kpody [pod] [namespace] [file]\n````\nPod name supports fuzzy search, namespace namespace supports fuzzy, file is saved to file name\n\n5.2 Save the ingress yaml command and use\n```shell\nxx kiy [ingress] [namespace] [file]\nor\nxx kingressy [ingress] [namespace] [file]\n````\ningress name supports fuzzy search, namespace namespace supports fuzzy, file is saved to file name\n\n5.3 Save the service yaml command and use\n```shell\nxx ksy [service] [namespace] [file]\nor\nxx kservicey [service] [namespace] [file]\n````\nThe service name supports fuzzy search, the namespace namespace supports fuzzy search, and the file is saved to the file name\n\n5.4 Save the deployment yaml command and use\n```shell\nxx kdy [deployment] [namespace] [file]\nor\nxx kdeploymenty [deployment] [namespace] [file]\n````\nThe deployment name supports fuzzy search, the namespace namespace supports fuzzy search, and the file is saved to the file name\n\n5.5 Save the configmap yaml command and use\n```shell\nxx kcy [configmap] [namespace] [file]\nor\nxx kconfigmapy [configmap] [namespace] [file]\n````\nconfigmap name supports fuzzy search, namespace namespace supports fuzzy, file is saved to file name\n\n5.6 Save the secret yaml command and use\n```shell\nxx ksecy [secret] [namespace] [file]\nor\nxx ksecrety [secret] [namespace] [file]\n````\nThe secret name supports fuzzy search, the namespace namespace supports fuzzy search, and the file is saved to the file name\n\n5.7 Save the statefulset yaml command and use\n```shell\nxx kssy [statefulset] [namespace] [file]\nor\nxx kstatefulsety [statefulset] [namespace] [file]\n````\nStatefulset name supports fuzzy search, namespace namespace supports fuzzy, file is saved to filename\n\n5.8 Save the cr yaml command and use\n```shell\nxx kcry [cr] [cr key] [namespace] [file]\n```\ncr type, cr key supports fuzzy search, namespace namespace supports fuzzy, file is saved to filename\n\n#### 6.delete\n6.1 Delete the pod command, use\n```shell\nxx kpdel [pod] [namespace]\nor\nxx kpoddel [pod] [namespace]\n````\npod name supports fuzzy search, namespace namespace supports fuzzy search\n\n6.2 Delete the ingress command, use\n```shell\nxx kidel [ingress] [namespace]\nor\nxx kingressdel [ingress] [namespace]\n````\ningress name supports fuzzy search, namespace namespace supports fuzzy search\n\n6.3 Delete the service command, use\n```shell\nxx ksdel [service] [namespace]\nor\nxx kservicedel [service] [namespace]\n````\nThe service name supports fuzzy search, and the namespace namespace supports fuzzy search\n\n6.4 delete the deployment command, use\n```shell\nxx kddel [deployment] [namespace]\nor\nxx kdeploymentdel [deployment] [namespace]\n````\nThe deployment name supports fuzzy search, and the namespace namespace supports fuzzy search\n\n6.5 delete the configmap command, use\n```shell\nxx kcdel [configmap] [namespace]\nor\nxx kconfigmapdel [configmap] [namespace]\n````\nconfigmap name supports fuzzy search, namespace namespace supports fuzzy\n\n6.6 Delete the secret command and use\n```shell\nxx ksecdel [secret] [namespace]\nor\nxx ksecretdel [secret] [namespace]\n````\nThe secret name supports fuzzy search, and the namespace namespace supports fuzzy search\n\n6.7 Delete the statefulset command and use\n```shell\nxx kssdel [statefulset] [namespace]\nor\nxx kstatefulsetdel [statefulset] [namespace]\n````\nThe statefulset name supports fuzzy search, and the namespace namespace supports fuzzy search\n\n6.8 Delete the cr command and use\n```shell\nxx kcrdel [cr] [cr key] [namespace]\n```\ncr type, cr key supports fuzzy search, and the namespace namespace supports fuzzy search\n\n#### 7.apply\n7.1 Apply the yaml configuration file command, use\n```shell\nxx ka [file]\nor\nxx kapply [file]\n````\nfile yaml configuration file\n\n#### 8.copy\n8.1 To copy the file command from the pod container, use\n```shell\nxx kcopy [pod] [namespace] [srcFile] [saveFile]\n````\nPod name supports fuzzy search, namespace namespace supports fuzzy search, srcFile is the path of the file to be copied in the container, saveFile is the local save path\n\n#### 9.edit\n9.1 To edit the pod command, use\n```shell\nxx kpe [pod] [namespace]\nor\nxx kpode [pod] [namespace]\n```\npod name supports fuzzy search, namespace namespace supports fuzzy search\n\n9.2 edit the ingress command, use\n```shell\nxx kie [ingress] [namespace]\nor\nxx kingresse [ingress] [namespace]\n```\ningress name supports fuzzy search, namespace namespace supports fuzzy search\n\n9.3 edit the service command, use\n```shell\nxx kse [service] [namespace]\nor\nxx kservicee [service] [namespace]\n```\nThe service name supports fuzzy search, and the namespace namespace supports fuzzy search\n\n9.4 edit the deployment command, use\n```shell\nxx kde [deployment] [namespace]\nor\nxx kdeploymente [deployment] [namespace]\n```\nThe deployment name supports fuzzy search, and the namespace namespace supports fuzzy search\n\n9.5 edit the configmap command, use\n```shell\nxx kce [configmap] [namespace]\nor\nxx kconfigmape [configmap] [namespace]\n```\nconfigmap name supports fuzzy search, namespace namespace supports fuzzy\n\n9.6 edit the secret command and use\n```shell\nxx ksece [secret] [namespace]\nor\nxx ksecrete [secret] [namespace]\n```\nThe secret name supports fuzzy search, and the namespace namespace supports fuzzy search\n\n9.7 Edit the statefulset command and use\n```shell\nxx ksse [statefulset] [namespace]\nor\nxx kstatefulsete [statefulset] [namespace]\n```\nThe statefulset name supports fuzzy search, and the namespace namespace supports fuzzy search\n\n9.8 Edit the cr command and use\n```shell\nxx kcre [cr] [cr key] [namespace]\n```\ncr type, cr key supports fuzzy search, and the namespace namespace supports fuzzy search\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiuv%2Fxx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiuv%2Fxx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiuv%2Fxx/lists"}