diff --git a/bin/codemods/src/helpers.js b/bin/codemods/src/helpers.js
index <HASH>..<HASH> 100644
--- a/bin/codemods/src/helpers.js
+++ b/bin/codemods/src/helpers.js
@@ -1,3 +1,14 @@
+/**
+ * External dependencies
+ */
+const path = require( 'path' );
+const child_process = require( 'child_process' );
+
+/**
+ * Internal dependencies
+ */
+const config = require( './config' );
+
 function bindEvents( jscodeshiftProcess ) {
 	jscodeshiftProcess.stdout.on( 'data', ( data ) => {
 		process.stdout.write( data );
@@ -8,6 +19,19 @@ function bindEvents( jscodeshiftProcess ) {
 	} );
 }
 
+function runCodemod( generateBinArgs ) {
+	const args = process.argv.slice( 2 );
+	if ( args.length === 0 ) {
+		process.stdout.write( 'No files to transform\n' );
+		process.exit( 0 );
+	}
+
+	const binArgs = generateBinArgs( config, args );
+	const binPath = path.join( '.', 'node_modules', '.bin', 'jscodeshift' );
+	const jscodeshift = child_process.spawn( binPath, binArgs );
+	bindEvents( jscodeshift );
+}
+
 module.exports = {
-	bindEvents,
+	runCodemod,
 };
Codemods: Extract runCodemod function

Credits to @gziolo for this work in #<I>.