Skip to content

Latest commit

 

History

History
113 lines (79 loc) · 1.88 KB

File metadata and controls

113 lines (79 loc) · 1.88 KB

lsdrive 快速开始指南

初始化配置

# 生成默认配置文件
cargo run -- init

# 或者使用自定义路径
cargo run -- init --output my-config.toml

基本使用

启动服务器

# 使用默认配置启动服务器
cargo run -- server

# 指定端口和主机
cargo run -- server --port 8000 --host 0.0.0.0

# 使用自定义配置文件
cargo run -- --config my-config.toml server

文件系统操作

# 列出根目录内容
cargo run -- fs list

# 列出指定目录(详细信息)
cargo run -- fs list /path/to/directory --long

# 查看文件信息
cargo run -- fs stat /path/to/file

# 创建目录
cargo run -- fs mkdir /new/directory

# 删除文件或目录
cargo run -- fs remove /path/to/delete --recursive

# 复制文件
cargo run -- fs copy /source/file /destination/file

# 移动文件
cargo run -- fs move /old/location /new/location

搜索功能

# 搜索文件
cargo run -- search "filename"

# 限制搜索结果数量
cargo run -- search "pattern" --limit 10

插件管理

# 列出所有插件
cargo run -- plugin list

# 查看插件信息
cargo run -- plugin info plugin-id

# 启用插件
cargo run -- plugin enable plugin-id

# 禁用插件
cargo run -- plugin disable plugin-id

系统信息

# 查看系统信息
cargo run -- info

开发模式

# 编译项目
cargo build

# 运行测试
cargo test

# 检查代码
cargo check

# 格式化代码
cargo fmt

# 代码检查
cargo clippy

配置文件说明

配置文件使用 TOML 格式,默认位置为 lsdrive.toml。主要配置项:

  • database_url: SQLite 数据库文件路径
  • local_storage_path: 本地存储根目录
  • plugin_dir: 插件目录路径
  • server.host: 服务器绑定地址
  • server.port: 服务器端口
  • logging.level: 日志级别 (error, warn, info, debug, trace)