{"id":16385245,"url":"https://github.com/hua1995116/mmt","last_synced_at":"2025-03-16T16:30:56.901Z","repository":{"id":40298333,"uuid":"461879739","full_name":"hua1995116/mmt","owner":"hua1995116","description":"A tool that automatically opens multiple panes to execute multiple commands in MacOS + iTerm2","archived":false,"fork":false,"pushed_at":"2022-05-17T11:02:22.000Z","size":1264,"stargazers_count":64,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-12T04:14:01.949Z","etag":null,"topics":["command-line","iterm2","nodejs"],"latest_commit_sha":null,"homepage":"https://mmt.run","language":"TypeScript","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/hua1995116.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.buymeacoffee.com/qiufeng"]}},"created_at":"2022-02-21T13:43:53.000Z","updated_at":"2024-07-17T13:05:52.000Z","dependencies_parsed_at":"2022-07-16T18:16:55.264Z","dependency_job_id":null,"html_url":"https://github.com/hua1995116/mmt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hua1995116%2Fmmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hua1995116%2Fmmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hua1995116%2Fmmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hua1995116%2Fmmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hua1995116","download_url":"https://codeload.github.com/hua1995116/mmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221665843,"owners_count":16860316,"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":["command-line","iterm2","nodejs"],"created_at":"2024-10-11T04:14:03.688Z","updated_at":"2024-10-27T10:54:50.003Z","avatar_url":"https://github.com/hua1995116.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/qiufeng"],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./source/mmt-logo.png\" width=\"300\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://npmcharts.com/compare/mmt?minimal=true\" rel=\"nofollow\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/mmt.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/mmt\" rel=\"nofollow\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/mmt.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/mmt\" rel=\"nofollow\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/mmt.svg?style=flat\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nRead this in other languages: [简体中文](./README_zh.md) | English\n\n# Introduction\n\nMMT (Manage Multiple Task) is a tool that automatically opens multiple panes to execute multiple commands in MacOS + iTerm2. It only needs to be defined once and run permanently.\n\n\n# Installation\n```\nnpm i -g mmt\n```\n## Use\n\n### Case1: Single project with multiple repositories\n\nWhen your project has two projects, front and back, you always need to remember multiple commands or multiple directories, and opening multiple windows will always be troublesome.\n\nyour front end project：case1-front, launch command: `npm run start`\n\nyour backend project: case1-backend, launch command: `npm run dev`\n\nDeclaration using mmt:\n```\n\u003e cd path/case1-front\n\u003e mmt add case1 start\n\u003e cd path/case1-backend\n\u003e mmt add case1 dev\n```\n\nIn any command window:\n```\n\u003e mmt run case1\n```\n\nThe effect is the following(Automatically open multiple windows and execute commands in the corresponding windows):\n\n![](./source/case1.gif)\n\n### Case2: Multiple projects and multiple repositories\n\nWhen you maintain a project with multiple technology stacks alone, you can't remember all the startup command. The start command for a Vue project may be `npm run serve`, while for a React project it is `npm run start`, and some projects may also be `npm run dev`. Using mmt can smooth out this difference and you don't have to memorize your project path.\n\nyour project1: projec1-vue, launch command `npm run serve`\nyour project2: projec2-react, launch command `npm run start`\n\nDeclaration using mmt:\n```\n\u003e cd path/projec1-vue\n\u003e mmt add project1 serve\n\u003e cd path/projec2-react\n\u003e mmt add project2 start\n```\n\nIn any command window:\n```\n\u003e mmt run project1\n\u003e mmt run project2\n```\n\nThe effect is the following:\n\n![](./source/case2.gif)\n\n### Case3: Script alias\n\nWhen you want to run some pipeline work synchronously, you can use the `add-sync`. For example, one of my local projects needs to depend on two container environments e8a47b8aed91 and e0d433a26388. At this time, running mmt will automatically execute the command。\n\n\n```\n\u003e mmt add-sync project1-dep \"docker restart e8a47b8aed91\"\n\u003e mmt add-sync project1-dep \"docker restart e0d433a26388\"\n```\n\nIn any command window:\n```\n\u003e mmt run project1-dep\n```\n\n![](./source/case3.gif)\n\n## API\n\n### add\n\nSupport platform: Mac/Linux\n\nAdd an asynchronous task, the task will start with a new tab page.\n\nCommon scenarios:\n\nWhen we have a full stack service, we need to start the frontend and backend. At this time, we need to switch tab pages every time, and then start two services.\n\nFor example, my other project \"Mujicv\" is a full-stack project. At this time, I can do this if I want to quickly start the front-end and back-end.\n```\nmmt add muji \"cd frontend/path \u0026\u0026 npm run start\";\nmmt add muji \"cd server/path \u0026\u0026 npm run dev\";\n\nmmt run muji\n```\nAt this point, two new tab pages will be opened to run the front-end and back-end services.\n\n### add-sync\n\nAdd a synchronization task, the task will be executed directly on the current page.\n\nCommon scenarios:\n\nFor example, whenever we need to switch projects, there are some pre-made environments and mmt can help us handle those situations. For example, one of my local projects needs to depend on two container environments e8a47b8aed91 and e0d433a26388. At this time, running mmt will automatically execute the command.\n\n```\nmmt add-sync start-docker \"docker restart e8a47b8aed91\";\nmmt add-sync start-docker \"docker restart e0d433a26388\";\n\nmmt run start-docker\n\n\u003e docker restart e8a47b8aed91\n\u003e docker restart e0d433a26388\n```\n\n### ls\n\nList what commands the current task has.\n\n```\nmmt ls muji\n\n\u003e cd frontend/path \u0026\u0026 npm run start\n\u003e cd server/path \u0026\u0026 npm run dev\n\n```\n\n### rm\nDelete a task.\n\n`mmt rm \u003ctask\u003e`\n\n```\nmmt rm muji\n\u003e delete muji task success!\n```\n\n### run\n\nRun a task.\n\n`mmt run \u003ctask\u003e`\n\n```\nmmt run muji\n```\n\n### export\n\n`mmt export \u003ctask\u003e`\n\nExport all configurations.\n```\nmmt export all\n```\n\nExport a single configuration.\n\n```\nmmt export muji\n```\n\n\n\n## License\n\nMIT\n\nCopyright (c) 2022- 蓝色的秋风\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhua1995116%2Fmmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhua1995116%2Fmmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhua1995116%2Fmmt/lists"}