babashka.fs

Perform cross-platform file system operations for Clojure and Babashka scripts.

3|Updated Nov 10, 2025
One-click install
npx skills add https://github.com/hugoduncan/library-skills --skill babashka-fs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: babashka.fs
Source: https://github.com/hugoduncan/library-skills/tree/main/plugins/clojure-libraries/skills/babashka.fs
Command: npx skills add https://github.com/hugoduncan/library-skills --skill babashka-fs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires babashka/fs, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies file and directory management across different operating systems in Clojure, eliminating the need for complex Java interop or platform-specific code.

Core Features & Use Cases

  • Cross-Platform File Operations: Perform all common file system tasks (create, copy, move, delete, read, write) seamlessly across Linux, macOS, and Windows.
  • Powerful Path Manipulation: Easily join, split, normalize, and relativize paths, ensuring robust and portable file handling.
  • Advanced Searching & Filtering: Find files with flexible glob patterns, regular expressions, and custom predicates for precise file discovery.
  • Use Case: Automate a daily backup routine by finding all .log files older than 7 days in a specific directory, compressing them into a timestamped zip archive, and moving the archive to a remote backup location, all with a single, portable script.

Quick Start

Use the babashka.fs skill to find all Clojure files in the current directory and its subdirectories, then list their absolute paths.

Frequently Asked Questions about babashka.fs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform file system operations across Linux, macOS, and Windows in Clojure?

Cross-platform file system operations in Clojure are simplified using babashka.fs, which provides idiomatic wrappers around Java NIO.2. It handles create, copy, move, delete, read, and write tasks seamlessly across all major operating systems without platform-specific code.

Can I use babashka.fs to find and filter files with glob patterns?

Yes, babashka.fs supports advanced file searching and filtering using glob patterns, regular expressions, and custom predicates. This enables precise file discovery for tasks like locating all `.log` files or filtering by modification date across directory trees.

How do I manipulate file paths robustly in Clojure scripts?

Babashka.fs provides powerful path manipulation functions to join, split, normalize, and relativize paths. This ensures portable file handling across platforms without manual string concatenation or platform-specific path logic.

Does babashka.fs support reading, writing, and copying files in a single script?

Yes, babashka.fs covers comprehensive file operations including reading and writing file contents, copying and moving files, and deleting files. All operations work consistently across different operating systems in a single portable script.

What file system capabilities does babashka.fs include beyond basic file operations?

Beyond basic operations, babashka.fs provides directory listing and walking, glob and match filtering, file metadata access, archive support, system paths, XDG directory handling, temporary file creation, and platform-specific considerations for robust automation.