# l-tool CLI Reference

A versatile command-line tool for JavaScript project management, image processing, PDF operations, Git utilities, and FFmpeg video processing.

## Installation

```bash
cargo install l-tool
```

## Quick Reference

| Module | Command | Description |
|--------|---------|-------------|
| `js` | `l-tool js upgrade` | Upgrade dependencies to latest versions |
| `image` | `l-tool image convert` | Usage: l-tool image convert [OPTIONS] <INPUT> |
| `image` | `l-tool image compress` | Usage: l-tool image compress [OPTIONS] <INPUT> |
| `pdf` | `l-tool pdf bundle` | Usage: l-tool pdf bundle [OPTIONS] |
| `git` | `l-tool git rewrite-ignore` | Remove files from history that are currently ignored |
| `git` | `l-tool git bak-remotes` | Batch backup all remote branches to local bak-{date}/{branch} |
| `ffmpeg` | `l-tool ffmpeg compress` | Lossless video compression |
| `ffmpeg` | `l-tool ffmpeg cut` | Cut video by time range |
| `ffmpeg` | `l-tool ffmpeg split` | Split video into segments by fixed interval |
| `ffmpeg` | `l-tool ffmpeg speed` | Change video playback speed |
| `ffmpeg` | `l-tool ffmpeg remove-audio` | Remove audio track from video |
| `completion` | `l-tool completion` | Shell completion support for the CLI |

## `js` — JavaScript related commands

### `js upgrade` — Upgrade dependencies to latest versions

```
Upgrade dependencies to latest versions

Usage: l-tool js upgrade [OPTIONS]

Options:
      --prod-only  Only upgrade regular dependencies (excludes devDependencies)
      --dev-only   Only upgrade dev dependencies (excludes regular dependencies)
  -h, --help       Print help
```

## `image` — Image processing commands

### `image convert` — Usage: l-tool image convert [OPTIONS] <INPUT>

```
Usage: l-tool image convert [OPTIONS] <INPUT>

Arguments:
  <INPUT>  

Options:
  -f, --format <FORMAT>      [default: png] [possible values: png, jpeg, webp, gif, tiff, avif, bmp, dds, exr, ff, hdr, ico, pnm, qoi, tga]
      --out-name <OUT_NAME>  
      --out-dir <OUT_DIR>    
  -h, --help                 Print help
```

### `image compress` — Usage: l-tool image compress [OPTIONS] <INPUT>

```
Usage: l-tool image compress [OPTIONS] <INPUT>

Arguments:
  <INPUT>  

Options:
  -f, --format <FORMAT>        [possible values: png, jpeg, webp, gif, tiff, avif, bmp, dds, exr, ff, hdr, ico, pnm, qoi, tga]
      --out-name <OUT_NAME>    
      --out-dir <OUT_DIR>      
      --quality <QUALITY>      [default: 80]
      --png-level <PNG_LEVEL>  [default: default] [possible values: fast, default, best]
  -h, --help                   Print help
```

## `pdf` — PDF processing commands

### `pdf bundle` — Usage: l-tool pdf bundle [OPTIONS]

```
Usage: l-tool pdf bundle [OPTIONS]

Options:
  -i, --input <INPUTS>             多次传入以追加多个输入文件。支持 "path" 或 "path:angle" (如 "image.png:90")
      --dir <DIR>                  目录模式：收集目录下的所有支持的文件
  -o, --output <OUTPUT>            输出文件路径（相对当前目录或绝对路径） [default: l-tool-pdf-bundle.pdf]
      --paper <PAPER>              纸张规格，默认 A4 [default: a4] [possible values: a4, letter, legal]
      --orientation <ORIENTATION>  方向，默认竖向 [default: portrait] [possible values: portrait, landscape]
      --sort <SORT>                排序方式，默认按名称 [default: name] [possible values: none, name]
      --rotate <ROTATE>            全局旋转角度 (90, 180, 270)。如果输入文件指定了单独的角度 (如 path:90)，则优先使用单独角度。
  -h, --help                       Print help
```

## `git` — Git related commands

### `git rewrite-ignore` — Remove files from history that are currently ignored

```
Remove files from history that are currently ignored

Usage: l-tool git rewrite-ignore [OPTIONS]

Options:
  -y, --yes   Skip confirmation
  -h, --help  Print help
```

### `git bak-remotes` — Batch backup all remote branches to local bak-{date}/{branch}

```
Batch backup all remote branches to local bak-{date}/{branch}

Usage: l-tool git bak-remotes [OPTIONS]

Options:
  -r, --remote <REMOTE>  Remote name (default: origin)
  -d, --date <DATE>      Date string for backup prefix (default: today, e.g., 2026-04-01)
  -f, --force            Force overwrite existing backup branches
  -u, --only-updated     Only backup branches that have new commits since last backup
  -h, --help             Print help
```

## `ffmpeg` — FFmpeg video processing commands

### `ffmpeg compress` — Lossless video compression

```
Lossless video compression

Usage: l-tool ffmpeg compress [OPTIONS] <INPUT>

Arguments:
  <INPUT>  Input video file path

Options:
  -o, --output <OUTPUT>  Output file path
  -f, --format <FORMAT>  Output format (default: auto-select smallest) [possible values: mp4, mkv, webm, mov, avi]
  -h, --help             Print help
```

### `ffmpeg cut` — Cut video by time range

```
Cut video by time range

Usage: l-tool ffmpeg cut [OPTIONS] --start <START> --end <END> <INPUT>

Arguments:
  <INPUT>  Input video file path

Options:
  -s, --start <START>    Start time (format: HH:MM:SS, MM:SS, or SS)
  -e, --end <END>        End time (format: HH:MM:SS, MM:SS, or SS)
  -o, --output <OUTPUT>  Output file path
  -h, --help             Print help
```

### `ffmpeg split` — Split video into segments by fixed interval

```
Split video into segments by fixed interval

Usage: l-tool ffmpeg split [OPTIONS] --interval <INTERVAL> <INPUT>

Arguments:
  <INPUT>  Input video file path

Options:
  -i, --interval <INTERVAL>  Interval per segment (e.g., 30s, 5m, 1h, or HH:MM:SS)
  -o, --out-dir <OUT_DIR>    Output directory
  -h, --help                 Print help
```

### `ffmpeg speed` — Change video playback speed

```
Change video playback speed

Usage: l-tool ffmpeg speed [OPTIONS] --speed <SPEED> <INPUT>

Arguments:
  <INPUT>  Input video file path

Options:
  -s, --speed <SPEED>    Speed multiplier (0.25 to 4.0, e.g., 2.0 for 2x speed, 0.5 for half speed)
  -o, --output <OUTPUT>  Output file path
  -a, --keep-audio       Keep audio (adjust tempo to match speed)
  -h, --help             Print help
```

### `ffmpeg remove-audio` — Remove audio track from video

```
Remove audio track from video

Usage: l-tool ffmpeg remove-audio [OPTIONS] <INPUT>

Arguments:
  <INPUT>  Input video file path

Options:
  -o, --output <OUTPUT>  Output file path
  -h, --help             Print help
```

## `completion` — Shell completion support for the CLI

```
Shell completion support for the CLI

Usage: l-tool completion [OPTIONS]

Options:
      --shell <SHELL>            [possible values: bash, zsh, fish, powershell, elvish]
      --output-dir <OUTPUT_DIR>  
      --print-only               
  -h, --help                     Print help
```

---

*Generated from `l-tool v0.1.2` on 2026-04-03*
