1
头图

Hello everyone, I am Qiufeng, and the tool I want to bring to you today is an npm tool I wrote recently. mmt is based on MacOS + iTerm2. The purpose is to improve the efficiency in daily life. Next, I will show you some commonly used scenarios.

Scenario 1: Single project with multiple warehouses

I don’t know if you have encountered such a scenario. When your project has two warehouses, front and back, you always need to remember multiple commands or multiple directories, and you need to open multiple terminal windows. For example, when I developed "Wood and Resume", I would have such troubles. It is obviously a very repetitive action, but every time I develop it, I have to enter the path + startup command . The repetition of these steps is completely unnecessary.

The above is the first pain point of my development of mmt. After using mmt, you can save the above trivial process. The following is an example to illustrate:

Your front-end project path: path/case1-front Start command: npm run start

Your backend project path: pathcase1-backend Start command: npm run dev

Use mmt to declare:

 > cd path/case1-front

> mmt add case1 start

> cd path/case1-backend

> mmt add case1 dev

Run in any command window

 > mmt run case1

The effect is as follows:

case1.gif

It is as smooth as flowing clouds and water, and you no longer have to enter those boring and repetitive commands.

Scenario 2: Multi-project multi-warehouse

When you maintain a project with multiple technology stacks alone, the startup command is always easy to confuse. The startup command for a Vue project may be npm run serve , while for a React project it is npm run start , some The item may also be npm run dev . Using mmt smoothes out this difference and you don't have to memorize your project path.

for example:

Your project 1: projec1-vue, start command npm run serve

Your project 1: projec2-react, start command npm run start

Use mmt to declare:

 > cd path/projec1-vue

> mmt add project1 serve

> cd path/projec2-react

> mmt add project2 start

in any command window

 > mmt run project1

> mmt run project2

The effect is as follows:

case2.gif

Scenario 3: Script Aliases

When you want to run some process line work synchronously, you can use the add-sync method. For example, one of my local projects needs to rely on two container environments e8a47b8aed91 and e0d433a26388. At this time, running mmt will automatically execute the command .

 > mmt add-sync project1-dep "docker restart e8a47b8aed91"

> mmt add-sync project1-dep "docker restart e0d433a26388"

From any command window, you can start two docker instances

 > mmt run project1-dep

图片

In order to take the script reusability to a higher level, you can also export the configuration and share it with your friends.

图片

The above is the basic introduction of mmt. For more functions, you can check the github address: https://github.com/hua1995116/mmt

If you think it is helpful to you, please mention Star.

The tool is easy to use, of course, it must be accompanied by a good domain name. I specially bought a domain name mmt.run that is more in line with the positioning of this tool.

图片

图片


程序员秋风
3k 声望3.9k 粉丝

JavaScript开发爱好者,全栈工程师。