Method and equipment for visually executing terminal command under Linux

By developing IDE plug-in or desktop application that visualizes terminal command entry and history traceability in Linux systems, the problems of high learning curve, high error proneness and low visualization of users when executing terminal commands in traditional Linux systems are solved, and a more efficient and intuitive operation experience and better historical traceability function are achieved.

CN119759240APending Publication Date: 2025-04-04KYLIN CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411831349.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In traditional Linux systems, users need to remember command names and parameters when executing terminal commands, and lack an intuitive interface, resulting in steep learning curve, high error-proneness, low visualization, and inconvenient execution output and history traceability.

Method used

Through integrated development environment (IDE) plug-in or desktop application, visual terminal command entry and history traceability functions are provided. Read the terminal command list configuration, generate a visual terminal command list view, generate a parameter visual entry interface based on the terminal command general configuration file, obtain the command parameters entered by the user, and call the system terminal execution commands to listen for execution processes and results, and store the execution history.

Benefits of technology

It lowers the threshold for user usage, reduces command entry errors, provides users with personalized customization needs, improves operation efficiency and user experience, and enhances operation traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759240A_ABST
    Figure CN119759240A_ABST
Patent Text Reader

Abstract

The invention discloses a method and equipment for visually executing a terminal command under Linux. The method comprises the following steps: interacting with a user through an integrated development environment plug-in or a desktop application and calling a system terminal to realize visual execution of the terminal command: reading terminal command list configuration; generating a visual terminal command list view; after a user selects a target terminal command in the visual terminal command list view, generating a parameter visual input interface for each command parameter according to the terminal command general configuration file to obtain a value of the command parameter configured by the user; and calling the system terminal to execute and monitor the execution process, the execution state and the execution result, and storing the execution process, the execution state and the execution result as a command execution history. The invention aims at providing a complete visual terminal command execution function, reducing the use threshold of a user, reducing command input errors, providing personalized customization requirements of the user, improving the operation efficiency and the use experience of the user and improving the operation traceability of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of operating systems, and in particular to a method and device for visually executing terminal commands under Linux. Background Art

[0002] In traditional Linux systems, users usually need to enter and execute various commands through the terminal command line, but this requires a certain learning curve for users who are not familiar with command line operations, and it is easy to make input errors. At the same time, when users trace back the command operation history, they generally use the history command, which has some defects, such as normal terminal exit will not record, command history is confused, command history length is limited, and historical commands do not contain timestamps and command execution results.

[0003] When Linux users execute commands through the terminal, they usually follow the following steps: 1. Open the system terminal and check whether the target command exists (such as the "ls" command). Generally, you can enter l and press tab to associate, or check whether the program exists through "which ls", or directly enter ls and press Enter to judge according to the output information; this requires users to remember the command name, and they may forget the uncommon and complex commands. 2. After the user enters the command, they need to have a sufficient understanding of the command to know which parameters to execute. Usually, you need to execute "ls--help" to view the parameter description, or execute "man ls" to view the command system manual, or search the Internet to view tutorials, etc. The process is cumbersome and difficult to interpret; 3. After obtaining the parameter description, the user needs to ensure that the input parameters are correct during the parameter input process, such as "ls-l", or "ls-al / tmp / ", etc. This requires users to remember the parameter keywords and be clear about the parameter input restrictions. If the character content that is not allowed by the parameter is entered, an error will be reported when the command is executed. The specific error information depends on the specific error reporting mechanism of the command, and may not accurately tell the cause of the error. 4. When users input multiple parameters, there are often dependencies between the parameters. For example, when using the -a parameter, the -s parameter must be specified; when using the -b parameter, the -n parameter must be specified. Special logic is completely supported by reading the documentation, which requires a complex learning process. 5. After executing a command, users can generally view the command history through history; they can view the output information of the execution through the log function of the command itself; but the history records are easily lost and the specific execution details cannot be verified; and they cannot be saved when the terminal exits abnormally; at the same time, the standard output during the execution process, if the command itself is not recorded in the log, will no longer be available after the terminal exits or exceeds the display cache line number. It is impossible to trace the execution history details. Therefore, it is of great significance to develop a method and plug-in with visual terminal command input and usage history tracing functions.

[0004] In traditional Linux systems, although the command line is powerful and flexible, there are several deficiencies and limitations for users who are not familiar with command line operations: 1. Steep learning curve: Command line operations require users to be familiar with the installation and use of various commands, including installation commands, installation dependencies, download sources, parameter options, restrictions and entry rules. For novices, there is a high learning curve and it takes a lot of time and effort to master. 2. High error-proneness: Command line operations are prone to spelling errors, parameter input errors, correlation between parameters and other problems. Once an error occurs, users need to spend time to troubleshoot and solve it, which increases the complexity of the operation and the possibility of errors. 3. Low visualization: Command line operations lack intuitive interfaces and graphical operation elements. Users need to enter commands and parameters through the keyboard. The operation is not intuitive and friendly enough. They often need to use man queries or help parameters to inquire about how to use it. Switching back and forth is cumbersome, especially for non-technical users. 4. Execution output, exception information, result information, etc. are not easy to interpret: During the command execution process, the system has limited feedback on the user's operation, usually only printing out simple text information; when an error occurs, only the error message is printed, and the user does not understand the cause of the error and the corresponding handling method; the execution result information is unclear, and the user does not know the specific execution result and output location; 5. The execution history is not easy to trace: Users may encounter situations where they need to view the process and results of previously executed commands, but in the traditional command line environment, it is not convenient and intuitive to find and trace back historical commands; some standard outputs cannot be traced, and the execution history cannot be queried. Therefore, it is of great significance and demand to develop a method and plug-in for visually executing terminal commands to solve the above problems and improve the user's operating experience and efficiency. Summary of the invention

[0005] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a method and device for visually executing terminal commands under Linux are provided. The present invention aims to provide a complete visual execution terminal command function, lower the user usage threshold, reduce command entry errors, provide users with personalized customization needs, improve users' operating efficiency and usage experience, and improve user operation traceability.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A method for visually executing terminal commands under Linux, comprising interacting with a user through an integrated development environment plug-in or a desktop application and calling a system terminal to implement visual execution of terminal commands:

[0008] Read the terminal command list configuration containing the attribute information of the terminal command;

[0009] Generate a visual terminal command list view according to the terminal command list configuration;

[0010] After the user selects the target terminal command in the visual terminal command list view, a parameter visualization entry interface is generated for each command parameter of the target terminal command according to the terminal command general configuration file, the value of the command parameter configured by the user is obtained through the parameter visualization entry interface, and data is checked according to the parameter entry display check definition in the terminal command general configuration file; after the command parameters of the target terminal command are obtained and pass the data check, the execution continues;

[0011] After combining the target terminal command and its command parameters into a complete terminal command according to the parameter output mode definition of the command parameter in the terminal command general configuration file, calling the system terminal to execute and monitoring the execution process, execution status and execution result of the terminal command executed by the system terminal;

[0012] After the monitored system terminal completes executing the terminal command, the target terminal command and its execution process and execution result information are stored for viewing in the command execution history viewing view based on the integrated development environment plug-in or desktop application.

[0013] Optionally, when reading the terminal command list configuration containing attribute information of the terminal command, the attribute information of the terminal command in the terminal command list configuration includes the command configuration keyword key of the terminal command, the command entry display type type, the command entry name displayName, the command introduction description, the command entry click execution logic metadata, the effective status status, the command available dependency information depends and the command installation configuration information install.

[0014] Optionally, when generating a visual terminal command list view according to the terminal command list configuration, it includes filtering out terminal commands whose effectiveness status is effective and whose current system environment satisfies the command available dependency information depends from the terminal command list configuration, and for each filtered out terminal command, generating a command entry bound to the command configuration keyword key and with the command entry name displayName and the command description description in the visual terminal command list view according to the command entry display type type of the terminal command, binding the command entry click execution logic metadata to the command entry, checking whether the terminal command exists in the current system environment, and if not, installing the terminal command according to the command installation configuration information install.

[0015] Optionally, generating a parameter visualization entry interface according to a terminal command general configuration file includes: reading an input parameter total data structure definition of the command parameter in the terminal command general configuration file, the input parameter total data structure definition including a parameter field name of the command parameter, an input type type, a parameter entry check definition param, a parameter keyword key, a parameter output mode predefined paramHeader, and a parameter effectiveness condition array where, wherein the input type type includes an input area input, a selection select, and a path selection selectPath, a parameter entry check definition param is used to record a parameter entry display check definition ParamConfig for the command parameter, a parameter output mode predefined paramHeader is used to define an output mode predefined for the command parameter, including: outputting a parameter header and a parameter value, outputting only a parameter header, or only Output parameter value, the parameter effectiveness condition array where is the condition for defining the effectiveness of the command parameter; determine whether all conditions in the parameter effectiveness condition array where of the command parameter are satisfied, if so, generate the parameter visualization entry interface of the command parameter according to the parameter field name, input type type, and parameter keyword key in the input parameter total data structure definition of the command parameter and bind the parameter entry check definition param; read the condition judgment parameter data structure definition of the command parameter, the condition judgment parameter data structure definition is used to control the dependency relationship between parameters, and the fields include the condition judgment front parameter name and the condition array value, if the condition judgment front parameter name is not empty and the condition corresponding to any array in the condition array value is satisfied, then display the parameter visualization entry interface of the command parameter to obtain the value of the command parameter configured by the user.

[0016] Optionally, the fields in the parameter entry check definition param include: input content title title, input area value value, input selection area hint holder, input type validation definition validate, selection type validation definition select and default value default, wherein the input type validation definition validate is only defined when the input type type of the command parameter is input area input and is used to check the input area value value, otherwise it is undefined; the selection type validation definition select is only defined when the input type type of the command parameter is select and the path selection selectPath and is used to check the input area value value, otherwise it is undefined; the fields of the input type validation definition validate include whether it can be empty canEmpty, the specified logic check definition spec and the regular expression definition regular, and the regular expression definition regular has a higher priority than the specified logic check spec when defined; the specified logic check definition spec is used to check whether the executable file isExec File, whether it is a path isPath and whether it is a number isNumber; the regular expression defines the regular field including the regular rule reg and the error message msg when the regular rule reg does not match; the selection validation defines the select field including the single-select or multiple-select type pickMany, the multi-parameter separator joinBy, the multi-parameter compound tag isMultiParam, the option selectItems, whether it is a folder fileOrFolder and the open file filter type filters, wherein the multi-parameter separator joinBy is a separator that returns multiple command parameters, the multi-parameter compound tag isMultiParam is used to enter multiple parameters through one option, the option selectItems is an array for defining multiple parameters to be entered, whether it is a folder fileOrFolder is only valid when the input type type is the path selection selectPath, and the open file filter type filters is only used when the input type type is the path selection selectPath and defines the file type suffix used for filtering or displaying.

[0017] Optionally, calling the system terminal to execute and monitoring the execution process, execution status and execution result of the system terminal executing the terminal command refers to starting a process to call the system terminal to execute the complete terminal command through the spawn call of the child process child_process, and obtaining the execution process, execution status and execution result of the system terminal executing the terminal command by monitoring the returned object with the output stream .stdout and the error information stream.

[0018] Optionally, when calling the system terminal to execute and monitoring the execution process, execution status and execution result of the system terminal executing the terminal command, it also includes: when the execution status of the monitored system terminal executing the terminal command, it also includes keyword filtering of the execution status information to obtain a parsing result, and triggering the execution of a specified execution status processing logic when the parsing result meets a preset condition; after the monitored system terminal completes the execution of the terminal command, keyword filtering of the execution result information to obtain a parsing result, and triggering the execution of a specified parsing result processing logic when the parsing result meets the preset condition.

[0019] In addition, the present invention also provides a device for visually executing terminal commands under Linux, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the method for visually executing terminal commands under Linux.

[0020] In addition, the present invention also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the method for visually executing terminal commands under Linux through a processor.

[0021] In addition, the present invention also provides a computer program product, including a computer program or an instruction, wherein the computer program or the instruction is programmed or configured to execute the method for visually executing terminal commands under Linux through a processor.

[0022] Compared with the prior art, the present invention mainly has the following advantages: 1. The method of visually executing terminal commands under Linux of the present invention can provide a complete visual execution terminal command function, lower the user usage threshold, reduce command entry errors, provide users with personalized customization needs, improve users' operating efficiency and usage experience, and improve user operation traceability. 2. The method of visually executing terminal commands under Linux of the present invention can satisfy developers' rapid use of various system tools in a visual way by developing a plug-in based on the above logic in the IDE; of course, the present invention is not limited to IDE plug-ins, and can also be developed into an independent Linux desktop application, or other application plug-ins or built-in implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 Schematic diagram of the basic flow of the method of this embodiment.

[0024] Figure 2 Schematic diagram of the system structure in this embodiment.

[0025] Figure 3 This is a parameter visualization entry interface for command parameters in the input area in this embodiment.

[0026] Figure 4 This is a parameter visualization input interface for selecting the single-choice command parameter of select in this embodiment.

[0027] Figure 5 This is a parameter visualization entry interface for selecting multiple-choice command parameters of select in this embodiment.

[0028] Figure 6 This is a parameter visualization entry interface for the path selection selectPath type command parameter in this embodiment.

[0029] Figure 7 The figure is a schematic diagram of the use process of the integrated development environment (IDE) plug-in in this embodiment. DETAILED DESCRIPTION

[0030] The technical solution of the present invention will be further described in detail below in conjunction with the accompanying drawings.

[0031] like Figure 1 As shown, this embodiment provides a method for visually executing terminal commands under Linux, including interacting with the user through an integrated development environment (IDE) plug-in and calling the system terminal to implement visual execution of terminal commands:

[0032] Read the terminal command list configuration containing the attribute information of the terminal command;

[0033] Generate a visual terminal command list view according to the terminal command list configuration;

[0034] After the user selects the target terminal command in the visual terminal command list view, a parameter visualization entry interface is generated for each command parameter of the target terminal command according to the terminal command general configuration file, the value of the command parameter configured by the user is obtained through the parameter visualization entry interface, and data is checked according to the parameter entry display check definition in the terminal command general configuration file; after the command parameters of the target terminal command are obtained and pass the data check, the execution continues;

[0035] After combining the target terminal command and its command parameters into a complete terminal command according to the parameter output mode definition of the command parameter in the terminal command general configuration file, calling the system terminal to execute and monitoring the execution process, execution status and execution result of the terminal command executed by the system terminal;

[0036] After the monitored system terminal completes executing the terminal command, the target terminal command and its execution process and execution result information are stored for viewing in the command execution history viewing view based on the integrated development environment plug-in or desktop application.

[0037] In this embodiment, when reading the terminal command list configuration containing the attribute information of the terminal command, the attribute information of the terminal command in the terminal command list configuration includes the version, index, introduction, etc. of the terminal command. Specifically, in this embodiment, it includes the command configuration keyword key, command entry display type type, command entry name displayName, command introduction description, command entry click execution logic metadata, effective status status, command available dependency information depends and command installation configuration information install. For example, the attribute information content provided by the list command ls is as follows:

[0038]

[0039]

[0040] In step S2 of this embodiment, when generating a visual terminal command list view according to the terminal command list configuration, it includes filtering out terminal commands whose effective status is effective and whose current system environment satisfies the command available dependency information depends from the terminal command list configuration, and for each filtered out terminal command, generating a command entry in the visual terminal command list view that is bound to the command configuration keyword key and has the command entry name displayName and the command description description according to the command entry display type type of the terminal command, binding the command entry click execution logic metadata to the command entry, checking whether the terminal command exists in the current system environment, and if not, installing the terminal command according to the command installation configuration information install. In addition, Figure 2 As shown, in step S2 of this embodiment, when a visual terminal command list view is generated according to the terminal command list configuration, it also includes generating a newly added visual terminal command view, a command execution history viewing view, a terminal command installation guide view, a terminal command visual entry view, and a terminal command execution interactive view, wherein the newly added visual terminal command view is used to add a new terminal command, the command execution history viewing view is used to view the terminal command execution history, the terminal command installation guide view is used to install the terminal command according to the command installation configuration information install, the terminal command visual entry view is used to construct a parameter visual entry interface, and the terminal command execution interactive view is used to monitor the system terminal, and the command list, installation information, parameter information, etc. can be stored and read through file storage or other storage methods.

[0041] In this embodiment, generating a parameter visualization input interface according to the terminal command general configuration file includes:

[0042] Step 1, read the input parameter total data structure definition of the command parameter in the terminal command general configuration file, the input parameter total data structure definition is as follows:

[0043]

[0044] In the above definition, InputConfig is the input parameter total data structure definition, which includes the parameter field name of the command parameter, the input type type, the parameter entry check definition param, the parameter keyword key, the parameter output mode predefined paramHeader and the parameter effective condition array where, wherein the input type type includes the input area input, the selection select and the path selection selectPath, the parameter entry check definition param is used to record the parameter entry display check definition ParamConfig of the command parameter, the parameter output mode predefined paramHeader is used to define the output mode predefined of the command parameter, including: outputting the parameter header and parameter value, only outputting the parameter header or only outputting the parameter value, and the parameter effective condition array where is the condition for defining the effectiveness of the command parameter, wherein undefined means undefined;

[0045] Step 2, determine whether all conditions in the parameter effectiveness condition array where of the command parameter are met. If so, generate the parameter visualization entry interface of the command parameter according to the parameter field name, input type type, and parameter keyword key in the input parameter total data structure definition of the command parameter and bind the parameter entry check definition param; for example, in this embodiment, the input box, folder selection, single selection, multiple selection, etc. are dynamically rendered according to the configuration file to complete the visualization parameter entry, and the result is as follows Figure 3 to Figure 6 shown. Figure 3 It is the parameter visualization entry interface for the command parameters whose input type is input in the input area. The parameter visualization entry interface includes two interfaces: input type view and input type view error. The input type view is used for normal display, and the input type view error is displayed when the value verification of the input command parameter fails. Figure 4 This is a parameter visualization entry interface for a single-choice command parameter whose input type is select in this embodiment. Figure 5 This is a parameter visualization entry interface for a multiple-choice command parameter whose input type is select in this embodiment. Figure 6 This is a parameter visualization input interface for selecting a selectPath command parameter of the input type type in this embodiment;

[0046] Step 3, read the conditional judgment parameter data structure definition of the command parameter. The conditional judgment parameter data structure definition is used to control the parameters of the dependency relationship between multiple parameters. For example, when the A parameter selection value is a, the B parameter is not displayed for entry; when the A parameter is selected as the value b, the B parameter is displayed for entry. The data structure of the conditional judgment parameter data structure definition in this embodiment is as follows:

[0047]

[0048] The conditional judgment parameter data structure definition is used to control the dependency between parameters. The fields include the conditional judgment pre-parameter name and the condition array value. If the conditional judgment pre-parameter name is not empty and the conditions corresponding to any array in the condition array value are met, the parameter visualization entry interface of the command parameter is displayed to obtain the value of the command parameter configured by the user. Currently, only the association judgment of the entered parameter value is supported; it is mainly used to determine the entry selection of different parameters according to the pre-parameter selection.

[0049] In this embodiment, the data structure of the parameter entry check definition param is ParamConfig, which is defined as follows:

[0050]

[0051] The fields in the above parameter entry check definition param include: input content title, input area value value, input selection area hint holder, input type validation definition validate, selection type validation definition select and default value default, among which the input type validation definition validate is only defined when the input type type of the command parameter is input area input and is used to check the input area value value, otherwise it is undefined; the selection type validation definition select is only defined when the input type type of the command parameter is select and selectPath and is used to check the input area value value, otherwise it is undefined.

[0052] The input validation definition validate can be used to preset the logic for checking parameters for non-empty parameters, special rules, and regular rules, so as to automatically check the input content according to the preset rules and prompt errors when entering parameters. In this embodiment, the data structure of the input validation definition validate is ValidateConfig, which is defined as follows:

[0053]

[0054] The fields of the above input validation definition validate include whether it can be empty canEmpty, the specified logic check definition spec and the regular expression definition regular, and the regular expression definition regular has a higher priority than the specified logic check spec when defined.

[0055] The specified logic check definition spec is used to preset special logic checks such as whether the input content is an executable file, whether it is a path, whether it is a number, etc., so as to automatically check the input content according to the preset rules when entering parameters and prompt errors, etc.

[0056] In this embodiment, the data structure of the specified logic check definition spec is SpecConfig, which is defined as follows:

[0057]

[0058] The above specified logic check definition spec is used to check whether it is an executable file isExecFile, whether it is a path isPath, and whether it is a number isNumber;

[0059] The regular expression definition regular is used to preset the regular expression judgment of the input content, so as to automatically check the input content according to the preset rules and prompt errors when entering parameters. The text parameter regular check takes precedence over the specified logic check. In this embodiment, the data structure of the regular expression definition regular is RegularConfig, which is defined as follows:

[0060]

[0061] The regular field of the regular expression definition includes the regular rule reg and the error message msg when the regular rule reg does not match.

[0062] The select validation defines the structure of setting the selection type parameters, supports single selection, multiple selection, specifying separators, supporting the selection of folders or files, supporting type filtering, etc. In this embodiment, the data structure of the select validation definition select is SelectConfig, which is defined as follows:

[0063]

[0064] The fields defined in the above selection validation include single-select or multi-select type pickMany, multi-parameter separator joinBy, multi-parameter composite tag isMultiParam, option selectItems, whether it is a folder fileOrFolder and open file filter type filters, where single-select or multi-select type pickMany is used to combine multiple options into content or multiple independent parameter check mode, multi-parameter separator joinBy is a separator that returns multiple command parameters, multi-parameter composite tag isMultiParam is used to enter multiple parameters through one option, option selectItems is an array for defining multiple parameters to be entered, whether it is a folder fileOrFolder is only valid when the input type type is path selection selectPath, and the open file filter type filters is only used when the input type type is path selection selectPath and defines the file type suffix used for filtering or displaying.

[0065] In addition, the parameter output mode definition of the command parameter in the terminal command general configuration file presets the parameter format as the output mode when executing the command, so as to better support the various parameter input modes of the tool command in a digital manner. In this embodiment, the parameter output mode is defined as follows:

[0066]

[0067] There are three predefined parameter output modes: 1. Only parameter header, such as -t; 2. Both header and content, such as -fa.txt; 3. Only content, such as a.txt. This definition satisfies these predefined conditions.

[0068] This embodiment implements the above-mentioned parameter visualization entry interface, which not only converts manually input content into a visual selection check or input; it also includes replacing various obscure symbolic parameters with clear Chinese descriptions. For example: ls command, define a select type option, the title is: "Do you want to view hidden files?", "Yes": output -a, "No": do not output. Here, this embodiment selects: "Yes"; then define a selectPath option, specify the selection type as: "Select a folder or file", and pop up a file directory selector with the title "Please select the folder or file to browse". After selecting the target folder or file, the absolute path is returned as a parameter. Here, this embodiment selects: " / tmp / aaa", and the example temporarily ignores more parameters. After two visual selections, this embodiment obtains the final execution command: "ls-a / tmp / aaa". Note that the data structure defined in this embodiment supports more complex data combinations. Assume that an input text input parameter is defined and a parameter header (-t) is defined for the parameter. This embodiment can implement this text entry by configuring the onlyHeader value of the parameter. When the text box pops up and xxx is entered and Enter is pressed, the following is implemented according to the value of onlyHeader: only output the parameter header (-t); output the parameter header and parameter value at the same time (-t xxx); only output the parameter value (xxx).

[0069] As an optional implementation, in this embodiment, calling the system terminal to execute and monitoring the execution process, execution status and execution result of the terminal command executed by the system terminal refers to starting a process to call the system terminal to execute a complete terminal command through the spawn call of the child process child_process, and obtaining the execution process, execution status and execution result of the terminal command executed by the system terminal by monitoring the returned object with the output stream .stdout and the error information stream. Taking Node.js as an example, a process is started to execute a command through the spawn call of child_process, and an object with .stdout and .stderr streams is returned. The current command execution process, status and result information are obtained by monitoring the stream content. The sample code is:

[0070]

[0071] The above sample code executes ls -a / tmp / aaa and listens to the returned object with output stream .stdout and error information stream to obtain the execution process, execution status and execution result of the system terminal executing the terminal command. In this embodiment, the execution command parameters; process output information; result output content are stored in the local execution record json file, and better storage and query support can also be achieved through the local database.

[0072] Referring to the above example code, as an optional implementation mode, in this embodiment, when calling the system terminal to execute and monitoring the execution process, execution status and execution result of the system terminal executing the terminal command, it also includes: when the execution status of the monitored system terminal executing the terminal command, it also includes keyword filtering of the execution status information to obtain the parsing result, and triggering the execution of the specified execution status processing logic (including but not limited to popping up a password input box to enter a password; popping up an error prompt, etc.) when the parsing result meets the preset conditions. The example code is:

[0073] ls.stderr.on('data',(data)=>{

[0074] console.error(`stderr:${data}`); / / Execute status processing logic

[0075] });

[0076] ; After the monitored system terminal completes executing the terminal command, the execution result information is filtered by keywords to obtain the parsing result, and when the parsing result meets the preset conditions, the specified parsing result processing logic (including but not limited to popping up the result file link, opening the result file, etc.) is triggered. The sample code is:

[0077] ls.on('exist',(code)=>{

[0078] console.log(`subprocess exits, exit code ${code}`); / / Parsing result processing logic

[0079] });

[0080] In the integrated development environment (IDE) plug-in, click Query History to view the commands, process information, result records, etc. in the history records; display and view the stored history records. Click Add Terminal Command to enter the configuration information and add it to the terminal command list. In addition, the function of creating a new terminal command is also provided. You can define the structure data of the command according to the instruction document and add it to the command list.

[0081] like Figure 7As shown, in this embodiment, the following operations need to be performed to build the integrated development environment (IDE) plug-in application in this embodiment: S1, define the terminal command list configuration, describe the version, index, and introduction of the terminal command; S2, based on the terminal command list configuration, realize the terminal command list view, including list viewing, adding commands, and historical viewing; S3, define the terminal command general configuration file, describe the terminal parameter formatting data; key information of the execution process, key abnormal information, result file information, etc.; S4, based on the S3 terminal command general configuration file, realize the parameter visualization input interface; 5) S5, call up the built-in system terminal, execute the tool command, and establish the execution process monitoring; S6, monitor and filter the execution process status and standard output; S7, the execution is successful, and the output result is checked according to the prefabricated result information; S8, write the execution command, process information, and result information into the "execution history record"; store the execution command parameters; process output information; and result output content in the local execution record json file, and better storage and query support can also be achieved through the local database. S9, click on the query history to view the commands, process information, result records, etc. of the history records; display and view the history records stored in S8. S10, click Add Terminal Command, you can enter configuration information, and add the terminal command list to provide a new terminal command function. Define the structure data of the command according to the description document, and add it to the command list. You can click to execute S1~S9 functional logic. In this embodiment, when defining the terminal command general configuration file, by analyzing resources such as command help and installation manual, abstractly define the version information, inspection method, installation source and installation command of the terminal command, and execute various parameter information to generate a general configuration. Among them, the parameter definition includes parameter name, parameter description, parameter restriction definition, parameter dependency, etc. In this embodiment, when defining the command list configuration and view, corresponding to the tool general configuration, each time a new tool general configuration is added, the corresponding tool configuration can be added to the command list and displayed on the list view. Click the list view tool to check the tool installation status, guide the download and installation, or enter the tool parameter visual entry view to start the tool entry process. 3. Design the tool parameter visual entry view, dynamically generate the tool visual entry according to the general configuration file, and support input boxes and file, folder selection, single selection, multiple selection, etc. When defining the tool execution monitoring logic in this embodiment, according to different execution states, functions such as pop-up interactive selection operations, error prompts, execution completion prompts, output result file inspection and opening, and execution process storage are implemented to increase the controllability of the command execution process. When implementing the tool execution history module in this embodiment, all execution histories of users can be viewed, including execution commands, execution process information, and execution results.Through the above steps, the system will be able to provide a complete visual execution terminal command function, lower the user's usage threshold, reduce command input errors, provide users with personalized customization needs, improve users' operating efficiency and usage experience, and improve user operation traceability. In this embodiment, by developing a plug-in based on the above logic in the IDE, it can satisfy developers to quickly use various system tools in a visual way; of course, this embodiment is not limited to IDE plug-ins, and can also be developed into an independent Linux desktop application, or other application plug-ins or built-in implementations.

[0082] In summary, the method for visually executing terminal commands under Linux in this embodiment defines a data structure that can define terminal commands as JSON data that supports visual entry; converts manually entered parameters into a variety of visual entry type definitions such as text boxes, selection boxes, check boxes, multiple selection boxes, file directory selectors, etc., supports the definition of parameter name descriptions, introductions, content legality restrictions, and also supports dependencies between parameters. Based on this data structure, according to its type and input content restrictions, legality checks, contextual visible relationships of input selection content and other logic, a set of general visual entry functions is formed, and a command visualization entry process is generated by rendering the data of 1; each time the user executes, a new set of commands can be obtained in a visual way. The method for visually executing terminal commands under Linux in this embodiment executes the obtained commands in an interactive running mode, tracks and records the execution process and results, and forms the ability to perform interactive intervention and execution result records, and perform historical tracing. The method for visually executing terminal commands under Linux in this embodiment solves the problem that various complex command format parameters need to be learned and memorized when using various tool commands through the terminal in the Linux environment, and the requirements such as the legality of the input content need to be manually checked and verified; the learning cost of some interactive processes in the user's terminal command execution process is reduced by presetting logical judgment guidance; it allows users to easily use tools to achieve their goals without using help manuals and obscure and confusing terminal command help information. When the terminal executes commands, we need to trace the execution history through the history command; first of all, this history is unreliable, easy to lose, and cannot correspond to the execution process result information; by establishing an execution history list, the problem of difficult tracing or loss of the execution history is solved; the method for visually executing terminal commands under Linux in this embodiment realizes the specific practice of system command calls based on the IDE environment by developing plug-ins in the IDE; but the present invention is not limited to IDE plug-in development, and can also be achieved by developing independent apps or accessing the data structure and visualization method of the method for visually executing terminal commands under Linux in this embodiment in other software, so as to achieve visual input execution and tracking memory of terminal commands. The method for visually executing terminal commands under Linux in this embodiment solves the difficulties and inconveniences encountered by Linux system users when using terminal commands by implementing a plug-in in the IDE.The method creates a universal configuration file format and realizes the visual entry function of terminal commands under the Linux system based on this configuration; reduces the complexity of tool installation under Linux by presetting command checking mode and command installation boot method, making it easier and more direct for users to install commands; reduces the learning cost of parameter entry, improves the efficiency of command and parameter input, and reduces command input errors by prefabricated parameter descriptions and parameter content format verification; provides interactive processing of the command execution process by presetting command execution process and error message prompt keyword matching and setting corresponding processing logic, improves the user experience and execution efficiency of command execution; realizes the traceability of command execution history by storing command execution process information and result information.

[0083] In addition, this embodiment also provides a device for visually executing terminal commands under Linux, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the method for visually executing terminal commands under Linux.

[0084] In addition, this embodiment also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the method for visually executing terminal commands under Linux through a processor.

[0085] In addition, this embodiment also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the method for visually executing terminal commands under Linux through a processor.

[0086] Those skilled in the art will appreciate that the technical solutions provided by the embodiments of the present application may be in the form of methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0087] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for visually executing terminal commands under Linux, characterized in that: This includes interacting with users through integrated development environment plug-ins or desktop applications and calling the system terminal to implement visual execution of terminal commands: Read the terminal command list configuration containing the attribute information of the terminal command; Generate a visual terminal command list view according to the terminal command list configuration; After the user selects the target terminal command in the visual terminal command list view, a parameter visualization entry interface is generated for each command parameter of the target terminal command according to the terminal command general configuration file, the value of the command parameter configured by the user is obtained through the parameter visualization entry interface, and data is checked according to the parameter entry display check definition in the terminal command general configuration file; after the command parameters of the target terminal command are obtained and pass the data check, the execution continues; After combining the target terminal command and its command parameters into a complete terminal command according to the parameter output mode definition of the command parameter in the terminal command general configuration file, calling the system terminal to execute and monitoring the execution process, execution status and execution result of the terminal command executed by the system terminal; After the monitored system terminal completes executing the terminal command, the target terminal command and its execution process and execution result information are stored for viewing in the command execution history viewing view based on the integrated development environment plug-in or desktop application.

2. The method for visually executing terminal commands under Linux according to claim 1, characterized in that: When reading the terminal command list configuration containing the attribute information of the terminal command, the attribute information of the terminal command in the terminal command list configuration includes the command configuration keyword key of the terminal command, the command entry display type type, the command entry name displayName, the command introduction description, the command entry click execution logic metadata, the effective status status, the command available dependency information depends and the command installation configuration information install.

3. The method for visually executing terminal commands under Linux according to claim 2, characterized in that: When generating a visual terminal command list view according to the terminal command list configuration, it includes filtering out terminal commands whose effectiveness status is effective and whose current system environment satisfies the command available dependency information depends from the terminal command list configuration, and for each filtered out terminal command, generating a command entry bound to the command configuration keyword key and with the command entry name displayName and the command description description in the visual terminal command list view according to the command entry display type type of the terminal command, binding the command entry click execution logic metadata to the command entry, checking whether the terminal command exists in the current system environment, and if not, installing the terminal command according to the command installation configuration information install.

4. The method for visually executing terminal commands under Linux according to claim 1, characterized in that: The generating of the parameter visualization input interface according to the terminal command general configuration file includes: reading the input parameter total data structure definition of the command parameter in the terminal command general configuration file, the input parameter total data structure definition includes the parameter field name of the command parameter, the input type type, the parameter entry check definition param, the parameter keyword key, the parameter output mode predefined paramHeader and the parameter effective condition array where, wherein the input type type includes the input area input, the selection select and the path selection selectPath, the parameter entry check definition param is used to record the parameter entry display check definition ParamConfig of the command parameter, and the parameter output mode predefined paramHeader is used to define the output mode predefined of the command parameter, including: outputting the parameter header and parameter value, outputting only the parameter header or only outputting Parameter value, the parameter effectiveness condition array where is the condition for defining the effectiveness of the command parameter; determine whether all conditions in the parameter effectiveness condition array where of the command parameter are satisfied, if so, generate the parameter visualization entry interface of the command parameter according to the parameter field name, input type type, and parameter keyword key in the input parameter total data structure definition of the command parameter and bind the parameter entry check definition param; read the condition judgment parameter data structure definition of the command parameter, the condition judgment parameter data structure definition is used to control the dependency relationship between parameters, and the fields include the condition judgment front parameter name and the condition array value, if the condition judgment front parameter name is not empty and the condition corresponding to any array in the condition array value is satisfied, then display the parameter visualization entry interface of the command parameter to obtain the value of the command parameter configured by the user.

5. The method for visually executing terminal commands under Linux according to claim 4, characterized in that: The fields in the parameter entry check definition param include: input content title title, input area value value, input selection area hint holder, input type validation definition validate, selection type validation definition select and default value default, wherein the input type validation definition validate is only defined when the input type type of the command parameter is input area input and is used to check the input area value value, otherwise it is undefined; the selection type validation definition select is only defined when the input type type of the command parameter is select and the path selection selectPath and is used to check the input area value value, otherwise it is undefined; the fields of the input type validation definition validate include whether it can be empty canEmpty, the specified logic check definition spec and the regular expression definition regular, and the regular expression definition regular has a higher priority than the specified logic check spec when defined; the specified logic check definition spec is used to check whether the executable file isExecFi le, whether it is a path isPath and whether it is a number isNumber; the regular expression defines that the regular field includes the regular rule reg and the error message msg when the regular rule reg does not match; the selection validation defines that the select field includes the single-select or multiple-select type pickMany, the multi-parameter separator joinBy, the multi-parameter composite tag isMultiParam, the option selectItems, whether it is a folder fileOrFolder and the open file filter type filters, wherein the multi-parameter separator joinBy is a separator that returns multiple command parameters, the multi-parameter composite tag isMultiParam is used to enter multiple parameters through one option, the option selectItems is an array for defining multiple parameters to be entered, whether it is a folder fileOrFolder is only valid when the input type type is the path selection selectPath, and the open file filter type filters is only used when the input type type is the path selection selectPath and defines the file type suffix used for filtering or displaying.

6. The method for visually executing terminal commands under Linux according to claim 1, characterized in that: The calling of the system terminal to execute and monitoring the execution process, execution status and execution result of the terminal command executed by the system terminal refers to starting a process to call the system terminal to execute a complete terminal command through the spawn call of the child process child_process, and obtaining the execution process, execution status and execution result of the terminal command executed by the system terminal by monitoring the returned object with the output stream .stdout and the error information stream.

7. The method for visually executing terminal commands under Linux according to claim 1, characterized in that: When calling the system terminal to execute and monitoring the execution process, execution status and execution result of the system terminal executing the terminal command, it also includes: when the monitored system terminal executes the execution status of the terminal command, it also includes keyword filtering of the execution status information to obtain the parsing result, and triggering the execution of the specified execution status processing logic when the parsing result meets the preset condition; after the monitored system terminal completes the execution of the terminal command, keyword filtering of the execution result information to obtain the parsing result, and triggering the execution of the specified parsing result processing logic when the parsing result meets the preset condition.

8. A device for visually executing terminal commands under Linux, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the method for visually executing terminal commands under Linux as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program or instruction stored therein, characterized in that: The computer program or instruction is programmed or configured to execute the method for visually executing terminal commands under Linux as described in any one of claims 1 to 7 through a processor.

10. A computer program product comprising a computer program or instructions, characterized in that The computer program or instruction is programmed or configured to execute the method for visually executing terminal commands under Linux as described in any one of claims 1 to 7 through a processor.