src/cli/class-papi-cli-post-command.php
public function rename( $args, $assoc_args ) {
		$type    = $args[0];
		$old_key = $args[1];
		$new_key = $args[2];

		$posts = ( new Papi_Query( [
			'entry_type' => $type,
			'fields'     => 'ids'
		] ) )->get_result();

		if ( empty( $posts ) ) {
			WP_CLI::error( 'No posts found' );
		}

		foreach ( $posts as $post ) {
			$meta = get_post_meta( $post, $old_key, true );

			if ( papi_is_empty( $meta ) ) {
				continue;
			}

			if ( delete_post_meta( $post, $old_key ) === false ) {
				WP_CLI::error( 'Could not delete post meta with key: ' . $old_key );

			}

			if ( update_post_meta( $post, $new_key, $meta ) === false ) {
				WP_CLI::error( 'Could not update post meta with key: ' . $new_key );
			}
		}

		WP_CLI::success( 'Done' );
	}
public function rename( $args, $assoc_args ) {
		$type    = $args[0];
		$old_key = $args[1];
		$new_key = $args[2];

		$posts = ( new Papi_Query( [
			'entry_type' => $type,
			'fields'     => 'ids'
		] ) )->get_result();

		if ( empty( $posts ) ) {
			WP_CLI::error( 'No posts found' );
		}

		foreach ( $posts as $post ) {
			$meta = get_post_meta( $post, $old_key, true );

			if ( papi_is_empty( $meta ) ) {
				continue;
			}

			if ( delete_post_meta( $post, $old_key ) === false ) {
				WP_CLI::error( 'Could not delete post meta with key: ' . $old_key );

			}

			if ( update_post_meta( $post, $new_key, $meta ) === false ) {
				WP_CLI::error( 'Could not update post meta with key: ' . $new_key );
			}
		}

		WP_CLI::success( 'Done' );
	}
Rename meta key for page type.

## OPTIONS

<page_type>
: Page type id

<old_key>
: Old meta key

<new_key>
: New meta key

## EXAMPLES

wp papi post rename about-page-type name title

@param  array $args
@param  array $assoc_args