* : Post ID. */ public function url( $args ) { $id = isset( $args[0] ) ? absint( $args[0] ) : 0; $post = get_post( $id ); if ( ! $post ) { WP_CLI::error( 'Post not found.' ); } if ( ! Agentic_Markdown_Bridge::is_post_enabled( $post ) ) { WP_CLI::warning( 'Markdown is disabled for this post.' ); } WP_CLI::line( Agentic_Markdown_Bridge::get_markdown_url( $post ) ); } /** Clear all generated Markdown cache entries. */ public function clear_cache() { Agentic_Markdown_Bridge::clear_all_cache(); WP_CLI::success( 'Agentic Markdown cache cleared.' ); } /** Generate an llms.txt draft using the saved generator selection. */ public function generate_llms() { $settings = Agentic_Markdown_Bridge::get_settings(); $content = Agentic_Markdown_Bridge::generate_llms_content( $settings ); $settings['llms_content'] = $content; update_option( Agentic_Markdown_Bridge::SETTINGS_OPTION, $settings, false ); Agentic_Markdown_Bridge::reset_settings_cache(); update_option( 'agentic_markdown_bridge_llms_modified', time(), false ); if ( Agentic_Markdown_Bridge::physical_llms_exists() ) { $result = Agentic_Markdown_Bridge::write_physical_llms_content( $content ); if ( is_wp_error( $result ) ) { WP_CLI::error( $result->get_error_message() ); } } WP_CLI::success( 'llms.txt draft generated from the saved selection.' ); } }