[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ACFKZR081Z7QX5XB1ZA2R2":3,"skill-same:01M6ACFKZR081Z7QX5XB1ZA2R2":98},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":29,"publishedAt":54,"linkOnly":55,"markdownContent":56,"markdownBody":57,"frontMatter":58,"refName":59,"commitSha":60,"skillDirectory":61,"forksCount":62,"repositoryHtmlUrl":63,"repositoryHomepageUrl":64,"ownerHtmlUrl":65,"ownerBlogUrl":66,"ownerDescription":6,"updatedAt":67,"install":68,"resources":81},"01M6ACFKZR081Z7QX5XB1ZA2R2","file-to-markdown",null,"Turn almost any file into Markdown plus metadata — PDF, Office, HTML, email, archives, images, audio\u002Fvideo, 1000+ formats — powered by Apache Tika, either via the tika-app CLI (zero setup, one file) or a running tika-server (curl, warm process, many calls). Leads with rmeta (structured, embedded-item-aware output) as the default operation rather than flat concatenated text, since you can't tell whether a file has embedded content from its extension. Covers metadata-only triage, type and language detection, OCR, and output-size discipline for agent context. Use whenever a task involves reading the content of a file whose format you don't want to hand-parse.","apache\u002Ftika","apache","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47359?v=4","01M6AC83E6K4FDKK7HZ8WNMQKE","The Apache Software Foundation","01M6ACEMPJD6J74AGZBFFEGEYV",4145,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftika\u002Fblob\u002Fmain\u002F.skills\u002Fusers\u002Ffile-to-markdown\u002FSKILL.md",[18,23,26],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,9,51,52,53],"file to markdown","file","markdown","Video","parse","hand","you","app","either","default","images","only","discipline","text","Audio","PDF","ocr","server","tika","metadata","content","setup","triage","cli","2026-11-10 10:12:30",false,"---\nname: file-to-markdown\ndescription: >\n  Turn almost any file into Markdown plus metadata — PDF, Office, HTML,\n  email, archives, images, audio\u002Fvideo, 1000+ formats — powered by Apache\n  Tika, either via\n  the tika-app CLI (zero setup, one file) or a running tika-server (curl,\n  warm process, many calls). Leads with rmeta (structured, embedded-item-aware\n  output) as the default operation rather than flat concatenated text, since\n  you can't tell whether a file has embedded content from its extension.\n  Covers metadata-only triage, type and language detection, OCR, and\n  output-size discipline for agent context. Use whenever a task involves\n  reading the content of a file whose format you don't want to hand-parse.\n---\n\n\u003C!--\nLicensed to the Apache Software Foundation (ASF) under one or more\ncontributor license agreements.  See the NOTICE file distributed with\nthis work for additional information regarding copyright ownership.\nThe ASF licenses this file to You under the Apache License, Version 2.0\n(the \"License\"); you may not use this file except in compliance with\nthe License.  You may obtain a copy of the License at\n\n    http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\nLocal override: `$TIKA_SKILLS_LOCAL\u002Ffile-to-markdown\u002FLOCAL.md` (default `~\u002F.tika-skills`),\nread after this file, wins on conflict.\n\n# Using Apache Tika from an agent\n\nApache Tika turns almost any document into text you can read, and reports\nper-document content as **Markdown** by default (4.x) — the format you\nactually want, not raw XML or a wall of HTML tags. See below for why to\nreach for the structured `rmeta` view rather than a flat blob, even when the\nfile looks simple.\n\nThis skill is for reading files, one at a time, inside your normal working\nloop. It is not a batch pipeline — see **Batch processing**, below, for why.\n\n**When NOT to reach for Tika:** if your host can already read the file\nnatively (many agent environments read PDFs and images directly) and you\nonly need its visible text, use that — it's one step, not three. Tika earns\nits place for everything else: `.docx`\u002F`.xlsx`\u002F`.pptx`, email (`.eml`,\n`.msg`) and its attachments, archives, embedded content inside anything,\nmetadata (authors, dates, edit history), OCR, and the long tail of ~1000\nformats nothing else opens.\n\n**Requirements:** Tika 4.x needs **Java 17+** (`java -version` to check).\nNo Java 17? In order of least pain:\n\n1. **Docker installed?** Use the Docker route — zero local Java (see the\n   `file-to-markdown-docker` companion skill, or\n   `docker run apache\u002Ftika:latest-full`).\n2. **No Docker either? Offer to install a user-local Java — ask the user\n   first; never install software silently.** The least invasive option is a\n   Temurin JRE unpacked into a directory the user owns: ~45 MB, no admin\n   rights, no PATH changes, uninstall = delete the directory.\n\n   ```bash\n   mkdir -p ~\u002Ftika-jre && cd ~\u002Ftika-jre\n   curl -L \"https:\u002F\u002Fapi.adoptium.net\u002Fv3\u002Fbinary\u002Flatest\u002F21\u002Fga\u002Flinux\u002Fx64\u002Fjre\u002Fhotspot\u002Fnormal\u002Feclipse\" | tar xz\n   ~\u002Ftika-jre\u002F*\u002Fbin\u002Fjava -jar tika-app.jar --version\n   ```\n\n   Swap `linux`\u002F`x64` in the URL for `mac`|`windows` and `aarch64` as\n   needed (Windows: fetch the `.zip` variant and unzip). If the user prefers\n   a managed install, the system package works too (`temurin-21-jre` via\n   apt, `brew install --cask temurin@21`, `winget install\n   EclipseAdoptium.Temurin.21.JRE`) — that needs admin rights and touches\n   system state, so it's their call, not the default.\nThis skill describes **Tika 4.x**; on a 3.x install the defaults differ\n(3.x outputs XHTML, not Markdown, and some flags changed) — check\n`java -jar tika-app.jar --version` or `curl localhost:9998\u002Fversion` if\nbehavior doesn't match what's described here.\n\n## Which surface: tika-app or tika-server?\n\nFirst gate: **no Java 17 on this machine?** Then this choice is moot — use\nthe Docker route (`file-to-markdown-docker` skill), or offer the user-local\nJRE install (Requirements, above). With Java 17+, two ways to reach Tika —\npick based on how many files you expect to touch in this session.\n\n- **`tika-app` (CLI)** — zero setup, no process to manage, one file per\n  invocation. Each call pays a JVM startup cost (roughly a second). Use this\n  for \"read this one file\" or a handful of files.\n- **`tika-server` (curl)** — a warm process you either already have running\n  (ask, or check `curl -s localhost:9998\u002Fversion`) or start yourself. No\n  per-call JVM cost once it's up. Use this if you're about to read many files\n  in the same session, or a server is already available.\n\nIf unsure and doing more than two or three files, start a server:\n\n```bash\njava -jar tika-server-standard-\u003Cversion>.jar &\n# starts on localhost:9998\n```\n\n**Getting either one:** download the **zip** distribution from\nhttps:\u002F\u002Ftika.apache.org\u002Fdownload.html and run the jar from inside the\nunzipped directory. Do NOT grab just the jar from Maven Central: 4.x jars\nare thin launchers that need the `lib\u002F` directory sitting next to them, and\nfail with `NoClassDefFoundError` on their own. If a jar you've been pointed\nat already works, it's inside a proper distribution — leave it where it is.\n\nBoth surfaces are driven by the same parsing engine — output is identical\neither way for the same handler\u002Fformat choice.\n\n## The core operation: parse one file with `rmeta`\n\nDefault to **`-J` (tika-app) \u002F `\u002Frmeta` (tika-server)**, not plain `\u002Ftika`.\n\n```bash\njava -jar tika-app.jar -J document.pdf           # JSON array, markdown content per entry\ncurl -T document.pdf http:\u002F\u002Flocalhost:9998\u002Frmeta  # same shape\n```\n\nResult is a JSON array: entry 0 is the document itself, entries 1+ are\nanything embedded in it (attachments, embedded images\u002Fobjects, archive\nmembers — if any). Read entry 0's `tk:content` field for the common\nsingle-document case (note the `tk:` prefix — a plain `.content` lookup\nreturns nothing).\n\n**Why rmeta and not plain `\u002Ftika`, even for an ordinary-looking file:** you\ncannot tell whether a file has embedded content from its extension or format\n— a `.pdf` can carry attachments, a `.docx` can carry embedded objects, a\n`.png` can carry XMP-embedded sidecar data, and even a file you're sure is\n\"flat\" you can't actually confirm without parsing it. Plain `\u002Ftika` doesn't\navoid this — it still recursively parses and includes any embedded text,\njust concatenated into one blob with no boundaries, no per-item metadata,\nand no visibility into whether an individual embedded item failed. `rmeta`\nis the *same parse*, structured, at no real extra cost. Reach for plain\n`\u002Ftika`\u002F`-t` deliberately (see below), not as the default.\n\n`-J` combines with `-x`\u002F`-h`\u002F`-t`\u002F`-m` to pick the content format used inside\neach entry (default markdown); the server's equivalent is `\u002Frmeta\u002F\u003Chandler>`\n(`\u002Frmeta\u002Ftext`, `\u002Frmeta\u002Fhtml`, ...).\n\nTo pull embedded items out as actual files (not just their extracted text):\n`\u002Funpack` on the server, or on tika-app `-z`\u002F`--extract` (direct\nattachments, depth 1) or `-Z` (recursive, all depths), with\n`--extract-dir=\u003Cdir>` for the destination. This is not\nformat-specific to office documents — it works on anything Tika can find\nembedded content in: email attachments (`.eml`, `.msg`), archive members\n(`.zip`), PDF attachments, embedded objects\u002Fimages in any office format\n(an inline pasted picture counts), and so on.\n\nWhat lands on disk: the extract dir (default `\u003Cname>-unpacked\u002F`) is a\nFrictionless package — `datapackage.json` (SHA-256 per file),\n`rmeta.json` (the rmeta list), and the embedded files **renumbered**\nunder `unpacked\u002F` (`1.jpg`, ...). Original names are not preserved on disk;\neach `datapackage.json` resource has `tk:resource-name` and `tk:embedded-id`\n(its row in `rmeta.json`). An input\ndirectory gets one such package per file, under its relative path.\n\n`-z`\u002F`-Z` route through Tika Pipes mode rather than the fast synchronous\npath the other flags use — expect several seconds and a burst of\nplugin\u002Fforked-JVM startup logging on stderr; that's normal, not a hang or\nan error.\n\nRead the extracted content selectively (grep, or Read with offset\u002Flimit)\nrather than dumping it into your context wholesale — see **Output\ndiscipline** below.\n\n## Flat concatenated text — when you deliberately don't need structure\n\nIf you specifically want one blob of body text and don't care about\nper-document boundaries, embedded-item metadata, or per-item exception\nvisibility — a quick keyword search, a rough skim — plain output is cheaper:\n\n```bash\njava -jar tika-app.jar document.pdf > document.md   # markdown is the default\ncurl -T document.pdf http:\u002F\u002Flocalhost:9998\u002Ftika > document.md\n# note: the HTTP response Content-Type header says text\u002Fplain even when the\n# body is Markdown — the endpoint you called, not the header, tells you the format\n```\n\nThis still includes embedded document text (see above) — it's just flattened\nin. And its damage behavior is the strongest reason to prefer `rmeta`: a\n*fatal* container exception gets a `422` here (partial content, no detail),\nbut a **recoverable** parse problem — the common case for a damaged or\ntruncated file — returns a plain `200` with **silently truncated content\nand no signal at all**: no status change, no header, nothing in the body.\n`rmeta` on the same file returns `200` too, but *shows* the damage: a\n`tk:exception:warn` (or `tk:exception:container-exception`) entry with the\nstack trace, and possibly fewer array entries than the intact file would\nproduce. Status codes cannot be relied on to detect damage — inspecting\n`tk:exception:*` keys in rmeta output is the detection mechanism.\n\n## Metadata only (fast triage before committing to full content)\n\nCheaper than a full parse when you just need to know what a file is —\nauthor, dates, page count, content-type — before deciding whether to read it.\n\n```bash\njava -jar tika-app.jar -j document.pdf          # JSON metadata, no content\ncurl -T document.pdf http:\u002F\u002Flocalhost:9998\u002Fmeta  # JSON by default\n```\n\nThis doesn't tell you whether the file has embedded content — `\u002Fmeta`\u002F`-j`\ncovers only the container document's own metadata. Some formats surface a\nhint (Office's `msoffice:has-comments`\u002F`has-track-changes`), but the only\nreliable way to know is `rmeta`'s array length:\n`java -jar tika-app.jar -J file | jq 'length'` — `1` means no embedded\nitems; each entry past the first is one embedded item (its\n`tk:embedded-resource-type` says how it's embedded, e.g. `INLINE` for a\npasted-in image vs `ATTACHMENT`).\n\n## Detection: what kind of file is this, without parsing it\n\n```bash\njava -jar tika-app.jar -d document              # prints the media type\ncurl -T document http:\u002F\u002Flocalhost:9998\u002Fdetect     # text\u002Fplain media type\n\njava -jar tika-app.jar -l document.pdf           # language only\ncurl -T document.pdf http:\u002F\u002Flocalhost:9998\u002Flanguage\n```\n\n`\u002Fdetect` and `\u002Flanguage` work even on files with no extension or a\nmisleading one — detection is content-based.\n\n## OCR (scanned PDFs, images, screenshots)\n\nText-layer parsing does nothing for a scanned page or a photo of text — you\nneed OCR, which requires Tesseract to be present. `tika-app`\u002Flocal\n`tika-server` only OCR if Tesseract is installed on the host; there is no\nbundled fallback.\n\n**Guaranteed OCR, no local install:** run the `-full` tika-server Docker\nimage, which bundles Tesseract, GDAL, and fonts:\n\n```bash\ndocker run -d -p 127.0.0.1:9998:9998 apache\u002Ftika:\u003Cversion>-full\ncurl -T scanned.pdf http:\u002F\u002Flocalhost:9998\u002Ftika    # OCR runs automatically\n```\n\nIf a parse of an image-heavy PDF comes back suspiciously short, that's the\nsignal you're missing OCR, not that the file has no text. For mount\u002Fpath\nsetup, confirming OCR actually ran, and other Docker specifics, see the\n`file-to-markdown-docker` skill.\n\n## Output discipline — don't flood your own context\n\nThe most common mistake using Tika from inside an agent loop: piping a large\ndocument's full Markdown\u002FJSON straight into context. A single PDF can produce\nmegabytes of output. Instead:\n\n1. **Redirect to a file, not a variable or inline output.** `> extracted.json`,\n   then read what you need with offset\u002Flimit or grep — don't capture full\n   stdout into your working context by default.\n2. **Triage with metadata or detection first** (above) when you're deciding\n   *whether* to read a file, not just what's in it.\n3. **`rmeta`\u002F`-J` output is compact single-line JSON — use `jq`, not grep, to\n   isolate one entry** (e.g. `jq '.[0].\"tk:content\"'`); a bare grep can find a\n   string but can't tell you which array entry it came from. Add\n   `-r`\u002F`--pretty-print` first if you want it grep-friendly instead. A file\n   with many embedded items (a large `.eml`, a nested archive) can produce a\n   long array either way.\n4. **Ask for `text`\u002F`txt` as the per-entry handler** (`\u002Frmeta\u002Ftext`,\n   `-J -t`) when you only need body text, not formatting — smaller output,\n   same information for most downstream uses (search, keyword extraction,\n   summarization prompts you control the framing of).\n\n## Batch processing — not this skill\n\nIf the task is \"parse thousands of files,\" stop reaching for per-call\ntika-app\u002Fcurl inside your loop — that's the wrong shape (slow, and each\nresult would flood your context in turn). Use tika-app's Tika Pipes mode\ninstead, which is designed for it and writes results to an output directory\n(or a configured emitter) rather than back to you:\n\n```bash\njava -jar tika-app.jar -i \u002Fpath\u002Fto\u002Finput -o \u002Fpath\u002Fto\u002Foutput\n# one JSON-array (rmeta-shaped) output file per input document;\n# add --handler m --content-only for bare .md files instead\n```\n\nThis runs out-of-band; check the output directory or configured emitter for\nresults rather than expecting them in your context. Configuring fetchers,\nemitters, and worker count is beyond this skill's scope — see the Tika Pipes\ndocumentation at https:\u002F\u002Ftika.apache.org\u002Fdocs if you need to set this up.\n\n## Error handling (tika-server)\n\n- **`429`** — the server's worker pool is saturated, not broken. Back off and\n  retry (`Retry-After` header tells you how long).\n- **`503`** with `TIMEOUT`\u002F`OOM`\u002F`UNSPECIFIED_CRASH` — that specific parse\n  failed (the file may be hostile or malformed); the server itself is fine.\n  Retrying the same file will likely fail the same way — move on rather than\n  loop.\n- **`422`** on the raw endpoints (`\u002Ftika`, `\u002Ftika\u002Ftext`, etc.) — a *fatal*\n  container exception; partial content is still in the body. Recoverable\n  parse problems do NOT get a 422 — they return `200` with silently\n  truncated content (see the flat-text section above); only `\u002Frmeta` reveals\n  those, via `tk:exception:*`.\n- **`400`** — malformed request: an unrecognized handler name on\n  `\u002Frmeta\u002F\u003Chandler>` (the message lists the valid set), or an unknown\n  fetcher\u002Femitter on `\u002Fpipes`. Fix the request; retrying unchanged won't\n  help. **Exception:** a wrong handler under `\u002Ftika\u002F...` returns a bare\n  `404`, because `\u002Ftika` has only four literal handler routes.\n- Handler names differ per family: `\u002Frmeta\u002F\u003Chandler>` accepts `text`, `txt`,\n  `html`, `xml`, `body`, `markdown`, `md`, `ignore`; `\u002Ftika\u002F\u003Chandler>` is\n  only `text`, `html`, `xml`, `md` (plus `json`). `\u002Ftika\u002Fmarkdown` is a 404\n  even though `\u002Frmeta\u002Fmarkdown` works.\n- **`429`\u002F`503`** (below) are documented behavior you can't easily reproduce\n  with clean small files — take them on faith until you hit them under load.\n\n## Trust note\n\nTika parses untrusted files safely when it runs in a forked\u002Fisolated process\n— which `tika-server` and `tika-app`'s `-f`\u002F`--fork` mode both do. Calling\nthe library directly in-process on a file you don't trust has no such\nprotection: a hostile file can exhaust memory\u002FCPU or crash the process. If\nyou're not sure a file is safe, use tika-server or `-f`, not an embedded\nparser call.\n","\u003C!--\nLicensed to the Apache Software Foundation (ASF) under one or more\ncontributor license agreements.  See the NOTICE file distributed with\nthis work for additional information regarding copyright ownership.\nThe ASF licenses this file to You under the Apache License, Version 2.0\n(the \"License\"); you may not use this file except in compliance with\nthe License.  You may obtain a copy of the License at\n\n    http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\nLocal override: `$TIKA_SKILLS_LOCAL\u002Ffile-to-markdown\u002FLOCAL.md` (default `~\u002F.tika-skills`),\nread after this file, wins on conflict.\n\n# Using Apache Tika from an agent\n\nApache Tika turns almost any document into text you can read, and reports\nper-document content as **Markdown** by default (4.x) — the format you\nactually want, not raw XML or a wall of HTML tags. See below for why to\nreach for the structured `rmeta` view rather than a flat blob, even when the\nfile looks simple.\n\nThis skill is for reading files, one at a time, inside your normal working\nloop. It is not a batch pipeline — see **Batch processing**, below, for why.\n\n**When NOT to reach for Tika:** if your host can already read the file\nnatively (many agent environments read PDFs and images directly) and you\nonly need its visible text, use that — it's one step, not three. Tika earns\nits place for everything else: `.docx`\u002F`.xlsx`\u002F`.pptx`, email (`.eml`,\n`.msg`) and its attachments, archives, embedded content inside anything,\nmetadata (authors, dates, edit history), OCR, and the long tail of ~1000\nformats nothing else opens.\n\n**Requirements:** Tika 4.x needs **Java 17+** (`java -version` to check).\nNo Java 17? In order of least pain:\n\n1. **Docker installed?** Use the Docker route — zero local Java (see the\n   `file-to-markdown-docker` companion skill, or\n   `docker run apache\u002Ftika:latest-full`).\n2. **No Docker either? Offer to install a user-local Java — ask the user\n   first; never install software silently.** The least invasive option is a\n   Temurin JRE unpacked into a directory the user owns: ~45 MB, no admin\n   rights, no PATH changes, uninstall = delete the directory.\n\n   ```bash\n   mkdir -p ~\u002Ftika-jre && cd ~\u002Ftika-jre\n   curl -L \"https:\u002F\u002Fapi.adoptium.net\u002Fv3\u002Fbinary\u002Flatest\u002F21\u002Fga\u002Flinux\u002Fx64\u002Fjre\u002Fhotspot\u002Fnormal\u002Feclipse\" | tar xz\n   ~\u002Ftika-jre\u002F*\u002Fbin\u002Fjava -jar tika-app.jar --version\n   ```\n\n   Swap `linux`\u002F`x64` in the URL for `mac`|`windows` and `aarch64` as\n   needed (Windows: fetch the `.zip` variant and unzip). If the user prefers\n   a managed install, the system package works too (`temurin-21-jre` via\n   apt, `brew install --cask temurin@21`, `winget install\n   EclipseAdoptium.Temurin.21.JRE`) — that needs admin rights and touches\n   system state, so it's their call, not the default.\nThis skill describes **Tika 4.x**; on a 3.x install the defaults differ\n(3.x outputs XHTML, not Markdown, and some flags changed) — check\n`java -jar tika-app.jar --version` or `curl localhost:9998\u002Fversion` if\nbehavior doesn't match what's described here.\n\n## Which surface: tika-app or tika-server?\n\nFirst gate: **no Java 17 on this machine?** Then this choice is moot — use\nthe Docker route (`file-to-markdown-docker` skill), or offer the user-local\nJRE install (Requirements, above). With Java 17+, two ways to reach Tika —\npick based on how many files you expect to touch in this session.\n\n- **`tika-app` (CLI)** — zero setup, no process to manage, one file per\n  invocation. Each call pays a JVM startup cost (roughly a second). Use this\n  for \"read this one file\" or a handful of files.\n- **`tika-server` (curl)** — a warm process you either already have running\n  (ask, or check `curl -s localhost:9998\u002Fversion`) or start yourself. No\n  per-call JVM cost once it's up. Use this if you're about to read many files\n  in the same session, or a server is already available.\n\nIf unsure and doing more than two or three files, start a server:\n\n```bash\njava -jar tika-server-standard-\u003Cversion>.jar &\n# starts on localhost:9998\n```\n\n**Getting either one:** download the **zip** distribution from\nhttps:\u002F\u002Ftika.apache.org\u002Fdownload.html and run the jar from inside the\nunzipped directory. Do NOT grab just the jar from Maven Central: 4.x jars\nare thin launchers that need the `lib\u002F` directory sitting next to them, and\nfail with `NoClassDefFoundError` on their own. If a jar you've been pointed\nat already works, it's inside a proper distribution — leave it where it is.\n\nBoth surfaces are driven by the same parsing engine — output is identical\neither way for the same handler\u002Fformat choice.\n\n## The core operation: parse one file with `rmeta`\n\nDefault to **`-J` (tika-app) \u002F `\u002Frmeta` (tika-server)**, not plain `\u002Ftika`.\n\n```bash\njava -jar tika-app.jar -J document.pdf           # JSON array, markdown content per entry\ncurl -T document.pdf http:\u002F\u002Flocalhost:9998\u002Frmeta  # same shape\n```\n\nResult is a JSON array: entry 0 is the document itself, entries 1+ are\nanything embedded in it (attachments, embedded images\u002Fobjects, archive\nmembers — if any). Read entry 0's `tk:content` field for the common\nsingle-document case (note the `tk:` prefix — a plain `.content` lookup\nreturns nothing).\n\n**Why rmeta and not plain `\u002Ftika`, even for an ordinary-looking file:** you\ncannot tell whether a file has embedded content from its extension or format\n— a `.pdf` can carry attachments, a `.docx` can carry embedded objects, a\n`.png` can carry XMP-embedded sidecar data, and even a file you're sure is\n\"flat\" you can't actually confirm without parsing it. Plain `\u002Ftika` doesn't\navoid this — it still recursively parses and includes any embedded text,\njust concatenated into one blob with no boundaries, no per-item metadata,\nand no visibility into whether an individual embedded item failed. `rmeta`\nis the *same parse*, structured, at no real extra cost. Reach for plain\n`\u002Ftika`\u002F`-t` deliberately (see below), not as the default.\n\n`-J` combines with `-x`\u002F`-h`\u002F`-t`\u002F`-m` to pick the content format used inside\neach entry (default markdown); the server's equivalent is `\u002Frmeta\u002F\u003Chandler>`\n(`\u002Frmeta\u002Ftext`, `\u002Frmeta\u002Fhtml`, ...).\n\nTo pull embedded items out as actual files (not just their extracted text):\n`\u002Funpack` on the server, or on tika-app `-z`\u002F`--extract` (direct\nattachments, depth 1) or `-Z` (recursive, all depths), with\n`--extract-dir=\u003Cdir>` for the destination. This is not\nformat-specific to office documents — it works on anything Tika can find\nembedded content in: email attachments (`.eml`, `.msg`), archive members\n(`.zip`), PDF attachments, embedded objects\u002Fimages in any office format\n(an inline pasted picture counts), and so on.\n\nWhat lands on disk: the extract dir (default `\u003Cname>-unpacked\u002F`) is a\nFrictionless package — `datapackage.json` (SHA-256 per file),\n`rmeta.json` (the rmeta list), and the embedded files **renumbered**\nunder `unpacked\u002F` (`1.jpg`, ...). Original names are not preserved on disk;\neach `datapackage.json` resource has `tk:resource-name` and `tk:embedded-id`\n(its row in `rmeta.json`). An input\ndirectory gets one such package per file, under its relative path.\n\n`-z`\u002F`-Z` route through Tika Pipes mode rather than the fast synchronous\npath the other flags use — expect several seconds and a burst of\nplugin\u002Fforked-JVM startup logging on stderr; that's normal, not a hang or\nan error.\n\nRead the extracted content selectively (grep, or Read with offset\u002Flimit)\nrather than dumping it into your context wholesale — see **Output\ndiscipline** below.\n\n## Flat concatenated text — when you deliberately don't need structure\n\nIf you specifically want one blob of body text and don't care about\nper-document boundaries, embedded-item metadata, or per-item exception\nvisibility — a quick keyword search, a rough skim — plain output is cheaper:\n\n```bash\njava -jar tika-app.jar document.pdf > document.md   # markdown is the default\ncurl -T document.pdf http:\u002F\u002Flocalhost:9998\u002Ftika > document.md\n# note: the HTTP response Content-Type header says text\u002Fplain even when the\n# body is Markdown — the endpoint you called, not the header, tells you the format\n```\n\nThis still includes embedded document text (see above) — it's just flattened\nin. And its damage behavior is the strongest reason to prefer `rmeta`: a\n*fatal* container exception gets a `422` here (partial content, no detail),\nbut a **recoverable** parse problem — the common case for a damaged or\ntruncated file — returns a plain `200` with **silently truncated content\nand no signal at all**: no status change, no header, nothing in the body.\n`rmeta` on the same file returns `200` too, but *shows* the damage: a\n`tk:exception:warn` (or `tk:exception:container-exception`) entry with the\nstack trace, and possibly fewer array entries than the intact file would\nproduce. Status codes cannot be relied on to detect damage — inspecting\n`tk:exception:*` keys in rmeta output is the detection mechanism.\n\n## Metadata only (fast triage before committing to full content)\n\nCheaper than a full parse when you just need to know what a file is —\nauthor, dates, page count, content-type — before deciding whether to read it.\n\n```bash\njava -jar tika-app.jar -j document.pdf          # JSON metadata, no content\ncurl -T document.pdf http:\u002F\u002Flocalhost:9998\u002Fmeta  # JSON by default\n```\n\nThis doesn't tell you whether the file has embedded content — `\u002Fmeta`\u002F`-j`\ncovers only the container document's own metadata. Some formats surface a\nhint (Office's `msoffice:has-comments`\u002F`has-track-changes`), but the only\nreliable way to know is `rmeta`'s array length:\n`java -jar tika-app.jar -J file | jq 'length'` — `1` means no embedded\nitems; each entry past the first is one embedded item (its\n`tk:embedded-resource-type` says how it's embedded, e.g. `INLINE` for a\npasted-in image vs `ATTACHMENT`).\n\n## Detection: what kind of file is this, without parsing it\n\n```bash\njava -jar tika-app.jar -d document              # prints the media type\ncurl -T document http:\u002F\u002Flocalhost:9998\u002Fdetect     # text\u002Fplain media type\n\njava -jar tika-app.jar -l document.pdf           # language only\ncurl -T document.pdf http:\u002F\u002Flocalhost:9998\u002Flanguage\n```\n\n`\u002Fdetect` and `\u002Flanguage` work even on files with no extension or a\nmisleading one — detection is content-based.\n\n## OCR (scanned PDFs, images, screenshots)\n\nText-layer parsing does nothing for a scanned page or a photo of text — you\nneed OCR, which requires Tesseract to be present. `tika-app`\u002Flocal\n`tika-server` only OCR if Tesseract is installed on the host; there is no\nbundled fallback.\n\n**Guaranteed OCR, no local install:** run the `-full` tika-server Docker\nimage, which bundles Tesseract, GDAL, and fonts:\n\n```bash\ndocker run -d -p 127.0.0.1:9998:9998 apache\u002Ftika:\u003Cversion>-full\ncurl -T scanned.pdf http:\u002F\u002Flocalhost:9998\u002Ftika    # OCR runs automatically\n```\n\nIf a parse of an image-heavy PDF comes back suspiciously short, that's the\nsignal you're missing OCR, not that the file has no text. For mount\u002Fpath\nsetup, confirming OCR actually ran, and other Docker specifics, see the\n`file-to-markdown-docker` skill.\n\n## Output discipline — don't flood your own context\n\nThe most common mistake using Tika from inside an agent loop: piping a large\ndocument's full Markdown\u002FJSON straight into context. A single PDF can produce\nmegabytes of output. Instead:\n\n1. **Redirect to a file, not a variable or inline output.** `> extracted.json`,\n   then read what you need with offset\u002Flimit or grep — don't capture full\n   stdout into your working context by default.\n2. **Triage with metadata or detection first** (above) when you're deciding\n   *whether* to read a file, not just what's in it.\n3. **`rmeta`\u002F`-J` output is compact single-line JSON — use `jq`, not grep, to\n   isolate one entry** (e.g. `jq '.[0].\"tk:content\"'`); a bare grep can find a\n   string but can't tell you which array entry it came from. Add\n   `-r`\u002F`--pretty-print` first if you want it grep-friendly instead. A file\n   with many embedded items (a large `.eml`, a nested archive) can produce a\n   long array either way.\n4. **Ask for `text`\u002F`txt` as the per-entry handler** (`\u002Frmeta\u002Ftext`,\n   `-J -t`) when you only need body text, not formatting — smaller output,\n   same information for most downstream uses (search, keyword extraction,\n   summarization prompts you control the framing of).\n\n## Batch processing — not this skill\n\nIf the task is \"parse thousands of files,\" stop reaching for per-call\ntika-app\u002Fcurl inside your loop — that's the wrong shape (slow, and each\nresult would flood your context in turn). Use tika-app's Tika Pipes mode\ninstead, which is designed for it and writes results to an output directory\n(or a configured emitter) rather than back to you:\n\n```bash\njava -jar tika-app.jar -i \u002Fpath\u002Fto\u002Finput -o \u002Fpath\u002Fto\u002Foutput\n# one JSON-array (rmeta-shaped) output file per input document;\n# add --handler m --content-only for bare .md files instead\n```\n\nThis runs out-of-band; check the output directory or configured emitter for\nresults rather than expecting them in your context. Configuring fetchers,\nemitters, and worker count is beyond this skill's scope — see the Tika Pipes\ndocumentation at https:\u002F\u002Ftika.apache.org\u002Fdocs if you need to set this up.\n\n## Error handling (tika-server)\n\n- **`429`** — the server's worker pool is saturated, not broken. Back off and\n  retry (`Retry-After` header tells you how long).\n- **`503`** with `TIMEOUT`\u002F`OOM`\u002F`UNSPECIFIED_CRASH` — that specific parse\n  failed (the file may be hostile or malformed); the server itself is fine.\n  Retrying the same file will likely fail the same way — move on rather than\n  loop.\n- **`422`** on the raw endpoints (`\u002Ftika`, `\u002Ftika\u002Ftext`, etc.) — a *fatal*\n  container exception; partial content is still in the body. Recoverable\n  parse problems do NOT get a 422 — they return `200` with silently\n  truncated content (see the flat-text section above); only `\u002Frmeta` reveals\n  those, via `tk:exception:*`.\n- **`400`** — malformed request: an unrecognized handler name on\n  `\u002Frmeta\u002F\u003Chandler>` (the message lists the valid set), or an unknown\n  fetcher\u002Femitter on `\u002Fpipes`. Fix the request; retrying unchanged won't\n  help. **Exception:** a wrong handler under `\u002Ftika\u002F...` returns a bare\n  `404`, because `\u002Ftika` has only four literal handler routes.\n- Handler names differ per family: `\u002Frmeta\u002F\u003Chandler>` accepts `text`, `txt`,\n  `html`, `xml`, `body`, `markdown`, `md`, `ignore`; `\u002Ftika\u002F\u003Chandler>` is\n  only `text`, `html`, `xml`, `md` (plus `json`). `\u002Ftika\u002Fmarkdown` is a 404\n  even though `\u002Frmeta\u002Fmarkdown` works.\n- **`429`\u002F`503`** (below) are documented behavior you can't easily reproduce\n  with clean small files — take them on faith until you hit them under load.\n\n## Trust note\n\nTika parses untrusted files safely when it runs in a forked\u002Fisolated process\n— which `tika-server` and `tika-app`'s `-f`\u002F`--fork` mode both do. Calling\nthe library directly in-process on a file you don't trust has no such\nprotection: a hostile file can exhaust memory\u002FCPU or crash the process. If\nyou're not sure a file is safe, use tika-server or `-f`, not an embedded\nparser call.\n",{"name":5,"description":7},"main","9f8b48425fea3630020924f6ae96e98eabb9ce12",".skills\u002Fusers\u002Ffile-to-markdown",1039,"https:\u002F\u002Fgithub.com\u002Fapache\u002Ftika","https:\u002F\u002Ftika.apache.org\u002F","https:\u002F\u002Fgithub.com\u002Fapache","https:\u002F\u002Fwww.apache.org\u002F","2026-11-13 08:35:47",{"source":8,"skillName":5,"commands":69,"prompt":79,"zipAvailable":80},[70,73,76],{"tool":71,"command":72},"npx","npx skills add apache\u002Ftika --skill file-to-markdown",{"tool":74,"command":75},"bunx","bunx skills add apache\u002Ftika --skill file-to-markdown",{"tool":77,"command":78},"pnpm","pnpm dlx skills add apache\u002Ftika --skill file-to-markdown","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fapache\u002Ftika\u002Fblob\u002Fmain\u002F.skills\u002Fusers\u002Ffile-to-markdown\u002FSKILL.md",true,[82,88,94],{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"assets\u002Fdashboard.html","ASSET","资产文件",7208,"https:\u002F\u002Fgithub.com\u002Fgithub\u002Fawesome-copilot\u002Fblob\u002Fmain\u002Fskills\u002Fpr-dashboard\u002Fassets\u002Fdashboard.html",{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"scripts\u002Flib\u002Futils.mjs","SCRIPT","脚本",5122,"https:\u002F\u002Fgithub.com\u002Fgithub\u002Fawesome-copilot\u002Fblob\u002Fmain\u002Fskills\u002Fpr-dashboard\u002Fscripts\u002Flib\u002Futils.mjs",{"path":95,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":96,"sourceHtmlUrl":97},"scripts\u002Fpr-dashboard-cli.mjs",13426,"https:\u002F\u002Fgithub.com\u002Fgithub\u002Fawesome-copilot\u002Fblob\u002Fmain\u002Fskills\u002Fpr-dashboard\u002Fscripts\u002Fpr-dashboard-cli.mjs",[99,125,152,179,204,219],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":109,"publishedAt":54},"01M6ACFHJR3612ZE6RNX1P5WG9","file-to-markdown-docker","Run Apache Tika as a Docker container when you need guaranteed OCR (scanned PDFs, images) or geospatial raster support with zero local install — `apache\u002Ftika:\u003Cversion>-full` bundles Tesseract, GDAL, ImageMagick, and fonts. Also covers the minimal image, port\u002Fvolume\u002Fmemory conventions, the path-identity mount gotcha, and how to confirm OCR actually ran rather than silently returning no text. Powered by Apache Tika. Use when a local `tika-app`\u002F`tika-server` doesn't have Tesseract installed, or you want a disposable, self-contained parsing environment. Companion to the `file-to-markdown` skill, which covers the parsing calls themselves once a server is up.","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftika\u002Fblob\u002Fmain\u002F.skills\u002Fusers\u002Ffile-to-markdown-docker\u002FSKILL.md",[105,106],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":107,"categoryName":108,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署",[110,111,30,32,31,9,112,113,114,115,116,48,40,37,46,117,118,119,120,121,122,36,123,43,124],"file to markdown docker","docker","support","memory","image","run","identity","which","volume","up","local","how to","when","fonts","self",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":132,"publishedAt":54},"01M6ACFE1684DE184VE0D7PQVY","file-forensics","Examine what a file claims about itself and what it actually contains — powered by Apache Tika. True content-based type detection (extensions lie), provenance claims (authors, dates, creating application), revision and tamper signals (PDF incremental updates, tracked changes, hidden slides, zip integrity), hidden and embedded content (attachments, macros), risk indicators (PDF JavaScript actions, encryption), and content digests. Evidence gathering, not verdicts: Tika reports what the file asserts and what parsing observed; it does not attribute authorship or validate signatures. Use for triaging suspicious files, provenance questions, e-discovery-style review, or \"is this file what it claims to be.\"","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftika\u002Fblob\u002Fmain\u002F.skills\u002Fusers\u002Ffile-forensics\u002FSKILL.md",[131],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[133,31,134,135,136,45,9,137,50,138,48,139,140,141,142,143,144,145,146,147,148,149,150,151],"file forensics","forensics","javascript","suspicious","validate","review","actions","signatures","files","updates","encryption","reports","claims","signals","revision","integrity","zip","evidence","risk",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":54},"01M6ACFB92SPADF0FY4490B847","update-site-for-release","Update\u002Fpublish the Apache Tika website (tika-site SVN repo) for a release — step 17 of the Release Process. Handles the 4.x track (Changes page + aggregate javadoc + Antora docs branch) vs the 3.x maintenance track (full per-version apt docs + javadoc). Use for \"update the site\", \"publish the site for X.Y.Z\", \"the website part of the release\".","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftika\u002Fblob\u002Fmain\u002F.skills\u002Fdevs\u002Fupdate-site-for-release\u002FSKILL.md",[],[159,160,161,162,163,9,164,165,48,166,167,168,169,170,171,172,173,174,175,176,177,178],"update","release","update site for release","for","site","release process","docs","branch","publish","track","website","svn","full","apt","page","repo","use","version","changes","maintenance",{"skillNo":180,"name":181,"nameZh":6,"description":182,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":183,"categories":184,"keywords":191,"publishedAt":54},"01M6ACF9G52NYHXQ0BVSJ3VH6E","tika-eval-h2-query","Query the tika-eval H2 database directly for counts and joins the canned reports do not compute — connection gotchas, key tables, example queries. Use when the xlsx\u002Fsummary.md reports are not enough.","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftika\u002Fblob\u002Fmain\u002F.skills\u002Fdevs\u002Ftika-eval-h2-query\u002FSKILL.md",[185,188],{"categoryNo":186,"categoryName":187,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000004","电子表格",{"categoryNo":189,"categoryName":190,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",[192,48,193,194,195,196,197,162,198,175,122,199,144,200,201,202,203],"tika eval h2 query","eval","query","database","xlsx","do","example","compute","queries","summary","connection","tables",{"skillNo":205,"name":206,"nameZh":6,"description":207,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":208,"categories":209,"keywords":210,"publishedAt":54},"01M6ACF7V56CCWHNVR614VBNX5","tika-eval-encoding-regression","Condensed tika-eval pattern for charset-detector regression hunts (\"A picks encoding X, B picks Y\") using one build and two configs — encoding-pair flip queries, OOV\u002Flanguageness\u002FFFFD signals, per-file detector attribution.","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftika\u002Fblob\u002Fmain\u002F.skills\u002Fdevs\u002Ftika-eval-encoding-regression\u002FSKILL.md",[],[211,48,212,193,213,162,214,31,200,146,215,216,217,218],"tika eval encoding regression","regression","encoding","attribution","build","detector","pattern","pair",{"skillNo":220,"name":221,"nameZh":6,"description":222,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":223,"categories":224,"keywords":225,"publishedAt":54},"01M6ACF53J5MJCDNAEMCBV0RPP","tika-eval-compare","Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for \"compare before\u002Fafter extracts\", \"eval this change against the corpus\".","https:\u002F\u002Fgithub.com\u002Fapache\u002Ftika\u002Fblob\u002Fmain\u002F.skills\u002Fdevs\u002Ftika-eval-compare\u002FSKILL.md",[],[226,48,193,227,228,50,162,175,229,230,213,231],"tika eval compare","compare","change","document","detect","embedded"]