Skip to content

i_en_mydog_cli

huangjizhong edited this page Aug 27, 2022 · 3 revisions

mydog command line

  1. mydog init Initialize the project
  2. mydog start Start the server
  3. mydog list Server monitoring
  4. mydog stop Shut down the server
  5. mydog remove Shut down some servers
  6. mydog removeT Shut down some server types
  7. mydog cmd Generate the corresponding message number file according to route.ts
  8. mydog send Send messages to the mydog framework

mydog   start

mydog start -d -e env [id1 id2 ...]

Execute this command in the project dist directory. -d means running in the background, -e env is the setting environment, that is, the corresponding configuration in server.ts is selected. id1 id2 means the id of the server to be started. If it is not passed, all will be started. id1 id2 id3 can be abbreviated as id1~3.

mydog   list

mydog list -h host -p port -t cliToken -i 5

mydog monitoring console. -h is the master server host, -p is the master server port number, -t is the key, and -i is the monitoring data interval. Developers can customize the data as follows

app.setConfig("mydogList", () => {
    return [{ "title": "cpu(%)", "value": getCpuUsage() }];
});

image

mydog   stop

mydog stop

Shut down all servers.

mydog   remove

mydog remove id1 [id2 ...]

Shut down id1 and id2 servers

mydog   removeT

mydog removeT serverType1 [serverType2 ...]

Shut down servers of serverType1 and serverType2

mydog   cmd

mydog cmd [ts cs ...]

Executing this command in the project src directory will generate a corresponding message file based on the config/sys/route.ts file:

  1. config/cmd.tsServer usage. When the server actively sends a message to the client, it uses the message number in this file.
  2. Provide the function mydog_cmd in the src/mydog_cli.js file, and you will receive the message of mydog cmd. Developers can generate the client prompt file they need according to the parameters.

mydog   send

mydog send [argv0 argv1 ...]
  1. You can simply send a message to the server.
  2. Provide the function mydog_send in the file src/mydog_cli.js, you will receive the callback message of mydog send, and the developer can make corresponding operations according to the parameters.