About cfExec

cfExec wraps 85+ command-line tools with ColdFusion CFCs. Instead of hand-building argument strings for CFExecute every time, you get typed methods, version detection, and consistent result structs. Each tool has its own CFC that extends a common base.

Why use command-line tools within ColdFusion?

ColdFusion has built-in functions for a lot of things. Sometimes they're not enough.

Performance

We had an Excel file with 88,000 rows and two columns. CFSpreadsheet locked up trying to process it. The same operation on the command line took less than two seconds. (We also prefer using the 3rd-party Spreadsheet CFML library.)

CFImage added 2 to 8 seconds per image for resizing. We switched to GraphicsMagick and it was so fast the team thought it wasn't working.

An S3 file transfer through ColdFusion's built-in s3:\\ protocol support took 110 seconds. S3Express did the same transfer in 16.

Quality and features

Dedicated CLI tools tend to solve their specific problem better than a general-purpose runtime can. They support more options, handle more edge cases, and get updated on their own schedule rather than waiting for the next CF release.

File support

We ran into cases where isPDFFile returned true but cfPDF threw an error on the same file. Photos from an iPhone 4 would register as invalid JPGs using ColdFusion's image functions but worked flawlessly when transformed using ImageMagick and GraphicsMagick.

Java limitations

Heap exceeded. GC overhead limit exceeded. DNS caching that's either all or nothing. Silent failures where Java swallows exceptions and returns empty results. When you hit these walls, an external process sidesteps the JVM entirely.

Remote API problems

SSL certificate changes, round-robin DNS with short TTLs, domain name expirations, beta-to-paid plan transitions, rate limiting. These are things outside your control that break without warning. A local CLI tool with no network dependency won't wake you up at 3 AM because someone else's certificate expired.

Versioning

You can run different versions of the same tool side by side. Keep a deprecated version around while you test a beta. Use a feature flag to switch between them. Try doing that with a built-in function.

BAT file tips

CFML tips


Built by James Moberg, CTO of SunStar Media. Originally presented as "CF_PB&J: Enhancing ColdFusion with Command Line Magic" at the ColdFusion Summit 2025 in Las Vegas, NV and based on the "CFFrankenstein: Choosing to use EXEs instead of CFML BIFs"" blog post at myCFML.