Skip to content

[Feature]: Make the filee command easier for scripts and AI agents to drive #753

Closed

Description

@SeoJCalive

What would you like Filee to do?

Make a few small additions to the filee command so scripts and AI coding agents (Claude Code, Codex, Cursor, Copilot) can use an installed Filee as a local tool without parsing console text. Existing output stays as it is; these mostly add to it (the one change is in item 1).

  1. JSON for formats and presets: accept --json and print one JSON document. For formats <format>, list what it converts to now and what it would convert to with optional engines. Today --json is accepted there but ignored, and the text table comes out, so those two calls would start printing JSON instead.
  2. Why a file failed, as data: in convert --json, add the existing error key (for example error.no_route) to failed files. When a conversion only needs an optional engine, also list which engines would make it possible.
  3. Which engines converted a file (optional): the ids of the converters that actually ran for each file in convert --json (a route can have several steps, and it can change while running). Core would need to record them on FileResult, so only if you want it.
  4. A short guide for agents: one page telling an agent how to call filee (always --json and -o, exit code 0 means nothing failed so check converted/state/outputs, point the user to Settings → Engines when an engine is missing). It could be an Agent Skills SKILL.md in the repo, a short section on filee.sh/cli, or both.

1 and 2 are the main part. 4 would be written against them.

Why / when would you use it?

filee is already a good fit for this: it runs offline, needs no prompts, has convert --json and clear exit codes, and Setup puts it on PATH. The gaps are in the places where a program has to decide what to do next.

Can this file become X? Answering this means splitting text like:

Markdown (md, markdown) converts to:
  png, jpg, webp, ... pdf, docx, ... txtz
With optional engines (install them in Filee, Settings → Engines):
  hwp, pptx, pptm, ... tcr

Is it impossible, or does it just need an engine? Without optional engines, md → pptx (listed above as possible with an engine; Pandoc does it) fails the same way as txt → mp3, which no engine can do:

"error": "No engine can do this conversion (md \u2192 pptx)"
"error": "No engine can do this conversion (txt \u2192 mp3)"

A caller can't tell these apart from the conversion JSON alone; it has to parse the formats text or guess what to try next, instead of telling the user "install Pandoc in Settings → Engines". filee formats already knows the difference, but convert doesn't show it.

The same additions help plain shell and PowerShell scripts, not only AI tools.

Ideas for how it could work

A possible shape (names are up to you):

// filee formats md --json
{ "format": "md", "to": ["pdf", "docx", "html"], "withOptionalEngines": ["pptx", "mobi"] }

// a failed file in filee convert doc.md --to pptx --json
{ "source": "doc.md", "state": "failed", "outputs": [],
  "error": "No engine can do this conversion (md → pptx)",
  "errorKey": "error.no_route", "needsEngines": ["pandoc"] }
  • Compatibility: existing convert --json keys, states and exit codes stay as they are, and output without --json doesn't change. The only change is that formats --json and presets --json print JSON instead of ignoring the flag. Messages stay in English, as decided in i18n(cli): add European Portuguese and preserve JSON output #552. New behaviour gets tests in Filee.Cli.Tests.
  • Engine ids: the ids already used for engines and engine priority (pandoc, libreoffice, …). needsEngines would only name engines offered in Settings → Engines (the EngineDownloads.Packages list), never bundled or system parts like 7-Zip or the Windows JPEG XR codec. It's the missing ones on one route that works once they're installed (all of them together, not alternatives). The JSON list of "with optional engines" targets in item 1 would use the same rule.
  • No MCP server: a local MCP server would only wrap filee and be one more thing to maintain. With JSON output and exit codes the command can be used directly.
  • Not included: installing engines from the command line, and a --dry-run mode (1 and 2 cover most of what it would show).

I'd like to work on this myself. I'd send 1 and 2 together as one PR, then 3 and 4 separately if you want them. A few things I'd like your call on:

  1. Scope: is this okay to do, and how far (1–4)?
  2. Engines per file (3): worth recording them on FileResult in Core?
  3. Agent guide (4): in the repo as SKILL.md, on filee.sh/cli, or both?

Please let me know whether I can go ahead with this. If you have any thoughts, I'll take them into account.

Activity

  1. KnifeLemon commented on Oct 29, 2026

    @KnifeLemon
    Owner

    @SeoJCalive 좋은 제안이에요. 맡아 주세요.

    범위

    1. formats --json: feat(cli): add --json to 'formats' #759(@yavuzmeteafsar)에서 이미 만들어졌어요. CI가 끝나면 머지할게요. 필드는 id, name, category, extensions, writable이고, 한 형식을 물으면 targets, withEngines가 붙어요. 이 PR에서는 **presets --json**만 같은 모양으로 맞춰 주세요.
    2. 실패 이유를 데이터로: 진행해 주세요. errorKey와 needsEngines는 제안하신 규칙 그대로 좋아요. needsEngines는 설정 → 엔진에서 받을 수 있는 엔진만, 한 경로에 필요한 것 전부예요. 그리고 formats의 withEngines와 같은 판단을 쓰면 돼요.
    3. 파일별로 실제 돌았던 엔진: 지금은 보류해요. 1·2가 들어간 뒤에 실제로 필요한 경우가 보이면 그때 정해요.
    4. 에이전트용 안내: 1·2가 머지된 뒤에 정해요.

    기존 동작

    • 기존 convert --json 키, 상태, 종료 코드는 그대로 두세요.
    • 메시지는 #552에서 정한 대로 영어예요.

    PR은 1·2를 하나로 올려 주시면 돼요.

  2. SeoJCalive commented on Oct 30, 2026

    @SeoJCalive
    CollaboratorAuthor

    @KnifeLemon #773 리뷰와 머지 감사합니다. 1·2가 들어갔으니 4번(에이전트용 안내)을 어떻게 할지 여쭤볼게요.

    1. 위치: 저장소 안에 Agent Skills 형식의 SKILL.md를 하나 두려고 해요(예: skills/filee/SKILL.md). 사용자가 자기 에이전트에 그대로 가져가 쓰는 파일이에요. filee.sh/cli에도 짧은 절을 넣고 싶으시면 문안을 함께 드릴게요.
    2. 내용: 한 페이지 정도로, 늘 --json과 -o를 쓰고, 종료 코드 0은 "실패 없음"이라 converted·state·outputs로 결과를 확인하고, formats <형식> --json으로 미리 가능한지 보고, 실패 파일에 needsEngines가 있으면 설정 → 엔진을 안내하라는 내용이에요.

    이렇게 진행해도 될까요?

  3. KnifeLemon commented on Oct 30, 2026

    @KnifeLemon
    Owner

    @SeoJCalive 네, 그렇게 진행해 주세요. 👍

    1. 위치

    • 저장소의 skills/filee/SKILL.md로 해 주세요.
    • filee.sh/cli 쪽은 저희가 맡을게요. PR 설명에 짧은 절(2~3문단) 문안을 같이 넣어 주시면 그대로 옮길게요.

    2. 내용
    제안하신 그대로 좋아요. 몇 가지만 덧붙여 주세요.

    • 설치 확인: filee version으로 Filee가 깔려 있는지 먼저 확인하고, 없으면 filee.sh에서 받으라고 안내하기.
    • -o를 쓰는 이유: 결과가 원본 옆이 아니라 정해진 폴더에 모여서 에이전트가 찾기 쉽다는 점을 한 줄로.
    • 예시 둘:
      • 한 파일 변환
      • needsEngines가 붙은 실패를 사용자에게 어떻게 안내하는지 (설정 → 엔진)

    3. 범위

    • 코드 변경 없이 문서 하나예요. 명령과 JSON 필드는 실제 CLI 출력과 맞는지 테스트 한 번으로 확인해 주세요.
    • 3번(실제로 돈 엔진 목록)은 계속 보류해요.
  4. SeoJCalive commented on Oct 30, 2026

    @SeoJCalive
    CollaboratorAuthor

    @KnifeLemon 4번 PR 올립니다. skills/filee/SKILL.md 하나만 추가했고, 명령과 JSON 필드는 이 브랜치로 빌드한 CLI 출력과 대조했어요. filee.sh/cli에 넣을 문단 3개는 PR 설명의 "For filee.sh/cli"에 있어요. 3번은 계속 보류라서 PR은 Part of #753으로 이슈를 열어 둡니다.

  5. KnifeLemon commented on Oct 30, 2026

    @KnifeLemon
    Owner

    정리하면 이렇게 끝났어요.

    항목 상태
    1. formats --json / presets --json #759, #773으로 머지
    2. 실패 이유를 데이터로 (errorKey, needsEngines) #773으로 머지
    3. 파일별로 실제 돈 엔진 보류. 필요한 경우가 생기면 새 이슈로
    4. 에이전트용 안내 (skills/filee/SKILL.md) #804로 머지. filee.sh/cli 문안은 사이트에 반영 예정

    filee help의 종료 코드 설명은 #818에서 고쳐요. 수고 많으셨어요, @SeoJCalive! 이 이슈는 닫을게요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions