AGENT SKILL

cli-batch-processing

Use Trafilatura's command line for stdin, URL/list, and local directory batch extraction with safe outputs, configs, backups, parallelism, and validation.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
cli-batch-processing
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use Trafilatura's command line for stdin, URL/list, and local directory batch extraction with safe outputs, configs, backups, parallelism, and validation.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

CLI Batch Processing

Use this sub-skill when the user wants Trafilatura from a shell or automation script rather than Python APIs: stdin extraction, -u/--URL, URL-list batches, local --input-dir batches, output directories, backups, --keep-dirs, output format flags, --parallel, --config-file, metadata filters, deduplication, precision/recall presets, and XML-TEI validation.

Do not use this sub-skill for direct Python function calls; route those requests to python-extraction. For feed/sitemap/crawl algorithms beyond the CLI flag invocation, route to discovery-downloads. For conceptual deduplication, corpus formats, and TEI quality details, route to corpus-quality.

Start here

  1. Confirm the CLI is reachable:
    trafilatura --version
    trafilatura --help
    # PATH fallback when the console script is unavailable:
    python -m trafilatura.cli --help
    
  2. Choose exactly one primary input mode:
    • no input flag: read HTML bytes from stdin;
    • -u/--URL: download and extract one URL;
    • -i/--input-file: process a text file containing one URL per line;
    • --input-dir: walk local downloaded HTML files.
  3. Choose output behavior:
    • no -o/--output-dir: print to stdout;
    • -o DIR: write result files, creating directories as needed;
    • --backup-dir DIR: keep gzipped raw HTML for URL downloads;
    • --keep-dirs: preserve local input paths, but only with -o/--output-dir.
  4. Add extraction and format options deliberately: --with-metadata, --only-with-metadata, --deduplicate, --precision, --recall, --xmltei --validate-tei, --json, --markdown, etc.
  5. For a no-network sanity check, run the bundled helper:
    python scripts/cli_fixture_runner.py
    python scripts/cli_fixture_runner.py --json
    

References

  • references/cli-reference.md — flag groups, input/output rules, format interactions, safe command construction, exit statuses.
  • references/batch-workflows.md — ready-to-adapt stdin, URL-list, directory, backup, config, listing, and TEI recipes.
  • references/troubleshooting.md — CLI-specific failure symptoms and recoveries.
  • scripts/cli_fixture_runner.py — no-network smoke helper for installed CLI behavior.

Safety checklist for generated commands

  • Quote URLs and paths in shell examples; in Python, prefer subprocess.run([...]) argument lists over shell strings.
  • Keep network batches polite: start with --parallel 1, increase only when allowed, and use SLEEP_TIME in a config file for domain-level pacing.
  • Separate discovery/listing from extraction: --list prints URLs only and ignores extraction/output-format expectations.
  • Use a small fixture or sample directory before a large batch; verify output content and file names before scaling.
  • Prefer relative --input-dir values when using --keep-dirs, so mirrored output paths stay inside the chosen output directory.

Provenance

This sub-skill distills Trafilatura 2.2.0 CLI behavior from public package docs, CLI source, settings source, and selected CLI/download tests. Evidence labels include docs/usage-cli.rst, docs/quickstart.rst, docs/installation.rst, docs/settings.rst, docs/troubleshooting.rst, trafilatura/cli.py, trafilatura/cli_utils.py, trafilatura/settings.py, trafilatura/settings.cfg, tests/cli_tests.py, and selected tests/downloads_tests.py queue cases.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351