apache / apache/fesod

[Enhancement] Apache Fesod CLI Tool Support

Open
#746 3 comments 1 reaction 1 assignee Claimed by @liugddx View on GitHub
enhancement
Dominant language
Java
Stars
6.2k
Forks
532
Avg merge
1d 3h
Merged PRs (30d)
42

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/fesod/issues) and found nothing similar.

### Motivation

## Summary

Develop a command-line interface tool for Apache Fesod to enable spreadsheet processing without writing code, supporting format conversion, data extraction, and batch operations.

## Motivation

Users need a CLI tool to:

- Convert spreadsheet formats quickly (xlsx ↔ xls ↔ csv ↔ ods)
- Extract data to JSON/CSV for pipelines
- Process files in shell scripts and CI/CD
- Use Fesod without Java programming

## Proposed Commands

```
# Read and output as JSON
fesod read data. xlsx --format json --sheet 0

# Convert formats
fesod convert input.xls output.xlsx

# Write from JSON/CSV
fesod write data. json output.xlsx --input-format json

# Show file info
fesod info data. xlsx
```

Key Options
- --format : Output format
- --sheet : Specify sheet
- --output : Output file path
- --config : Use config file

## Technical Approach

### Stack

- CLI Framework: [picocli](https://picocli.info/)
- Build: Maven assembly plugin for executable JAR
- Java: 8+ compatible

### Project Structure

```
fesod-cli/
├── src/main/java/org/apache/fesod/cli/
│ ├── FesodCli.java
│ ├── commands/
│ │ ├── ReadCommand.java
│ │ ├── WriteCommand.java
│ │ ├── ConvertCommand.java
│ │ └── InfoCommand.java
│ └── formatters/
│ ├── JsonFormatter.java
│ └── CsvFormatter.java
└── pom.xml
```
### Configuration Support

YAML config file (~/.fesod/config.yaml):

```
defaults:
output_format: json
encoding: UTF-8

read:
auto_trim: true
ignore_empty_rows: true
```

### Solution

_No response_

### Alternatives

_No response_

### Anything else?

_No response_

### Are you willing to submit a PR?

- [x] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.