Files
LeonOS/NEW_COMMANDS_SUGGESTIONS.md
Leonmmcoset 7e07e1636f feat: 添加历史记录和配置管理命令及相关测试
fix(project_rules): 修正文档中的中文支持说明

chore: 更新版本号至0.3.8

feat: 新增history命令用于查看和管理命令历史记录
feat: 新增config命令用于管理系统配置
feat: 新增find命令用于文件搜索
docs: 添加新命令建议文档
test: 添加history、config和find命令的测试脚本
2025-09-02 22:22:25 +08:00

2.9 KiB

New Command Suggestions for LeonOS

Based on the existing command set in LeonOS, here are some useful new commands that could enhance the user experience:

1. man

Description: Comprehensive manual pages for commands Purpose: Provide detailed documentation beyond basic help Implementation Idea: man <command> would display formatted documentation from a man directory structure

-- Example implementation concept
toolcall = {
  name = "write_to_file",
  params = {
    rewrite = false,
    file_path = "/rom/programs/man.lua",
    content = "-- man.lua: Manual page viewer\nlocal fs = require(\"fs\")\nlocal textutils = require(\"textutils\")\n\nlocal function show_manual(command)\n  local man_path = fs.combine(\"/rom/man\", command .. \"/README.md\")\n  if fs.exists(man_path) then\n    local file = io.open(man_path, \"r\")\n    local content = file:read(\"*a\")\n    file:close()\n    textutils.pagedPrint(content)\n  else\n    print(\"No manual page found for \" .. command)\n  end\nend\n\n-- Main function implementation..."
  }
}

2. env

Description: Display and manage environment variables Purpose: Allow users to view and modify system environment variables Implementation Idea: env to list variables, env <name>=<value> to set

3. history

Description: Command history viewer Purpose: View, search, and reuse previous commands Implementation Idea: history to list, history <number> to recall, history -c to clear

4. grep

Description: Search text in files Purpose: Find specific text patterns in files Implementation Idea: grep <pattern> <file(s)> with support for regex patterns

5. find

Description: Search for files and directories Purpose: Locate files by name or other criteria Implementation Idea: find <path> -name <pattern> with recursive searching

6. cmp

Description: Compare two files Purpose: Find differences between two files Implementation Idea: cmp <file1> <file2> showing line-by-line differences

7. date

Description: Advanced date and time manipulation Purpose: Display and calculate dates Implementation Idea: date [format] with various formatting options and calculations

8. net

Description: Network utilities Purpose: Test and manage network connections Implementation Idea: net ping <host>, net status, etc.

9. sensors

Description: Hardware sensor information Purpose: Display data from connected sensors Implementation Idea: sensors to list all sensors, sensors <type> for specific data

10. config

Description: System configuration manager Purpose: View and modify system settings Implementation Idea: config get <key>, config set <key> <value>

These commands would fill gaps in the current functionality and provide a more complete command-line experience for LeonOS users.