                                                           [bazel release 5.3.1]
Usage: bazel query <options> <query-expression>

Executes a query language expression over a specified subgraph of the
build dependency graph.

For example, to show all C++ test rules in the strings package, use:

  % bazel query 'kind("cc_.*test", strings:*)'

or to find all dependencies of //path/to/package:target, use:

  % bazel query 'deps(//path/to/package:target)'

or to find a dependency path between //path/to/package:target and //dependency:

  % bazel query 'somepath(//path/to/package:target, //dependency)'

Options that appear before the command and are parsed by the client:
  --check_direct_dependencies (off, warning or error; default: "warning")
  --distdir (a path; may be used multiple times)
  --[no]experimental_enable_bzlmod (a boolean; default: "false")
  --[no]experimental_repository_cache_hardlinks (a boolean; default: "false")
  --[no]experimental_repository_cache_urls_as_default_canonical_id (a boolean; default: "false")
  --[no]experimental_repository_disable_download (a boolean; default: "false")
  --experimental_repository_downloader_retries (an integer; default: "0")
  --experimental_scale_timeouts (a double; default: "1.0")
  --http_timeout_scaling (a double; default: "1.0")
  --[no]ignore_dev_dependency (a boolean; default: "false")
  --registry (a string; may be used multiple times)
  --repository_cache (a path; default: see description)

Options that control build execution:
  --experimental_oom_more_eagerly_threshold (an integer; default: "100")
  --experimental_ui_max_stdouterr_bytes (an integer in (-1)-1073741819 range; default: "1048576")
  --[no]incompatible_remote_symlinks (a boolean; default: "true")
  --[no]keep_going [-k] (a boolean; default: "false")
  --loading_phase_threads (an integer, or a keyword ("auto", "HOST_CPUS", "HOST_RAM"), optionally followed by an operation ([-|*]<float>) eg. "auto", "HOST_CPUS*.5"; default: "auto")
  --[no]remote_allow_symlink_upload (a boolean; default: "true")

Options that let the user configure the intended output, affecting its value, as opposed to its existence:
  --remote_download_minimal
  --remote_download_outputs (all, minimal or toplevel; default: "all")
  --remote_download_symlink_template (a string; default: "")
  --remote_download_toplevel
  --repo_env (a 'name=value' assignment with an optional value part; may be used multiple times)

Options that affect how strictly Bazel enforces valid build inputs (rule definitions,  flag combinations, etc.):
  --experimental_repository_hash_file (a string; default: "")
  --experimental_verify_repository_rules (a string; may be used multiple times)

This option affects semantics of the Starlark language or the build API accessible to BUILD files, .bzl files, or WORKSPACE files.:
  --[no]experimental_action_resource_set (a boolean; default: "true")
  --[no]experimental_allow_tags_propagation (a boolean; default: "false")
  --[no]experimental_analysis_test_call (a boolean; default: "true")
  --[no]experimental_cc_shared_library (a boolean; default: "false")
  --[no]experimental_disable_external_package (a boolean; default: "false")
  --[no]experimental_enable_android_migration_apis (a boolean; default: "false")
  --[no]experimental_google_legacy_api (a boolean; default: "false")
  --[no]experimental_ninja_actions (a boolean; default: "false")
  --[no]experimental_platforms_api (a boolean; default: "false")
  --[no]experimental_repo_remote_exec (a boolean; default: "false")
  --[no]experimental_sibling_repository_layout (a boolean; default: "false")
  --[no]incompatible_always_check_depset_elements (a boolean; default: "true")
  --[no]incompatible_config_setting_private_default_visibility (a boolean; default: "false")
  --[no]incompatible_depset_for_libraries_to_link_getter (a boolean; default: "true")
  --[no]incompatible_disable_depset_items (a boolean; default: "true")
  --[no]incompatible_disable_target_provider_fields (a boolean; default: "false")
  --[no]incompatible_disable_third_party_license_checking (a boolean; default: "true")
  --[no]incompatible_disallow_empty_glob (a boolean; default: "false")
  --[no]incompatible_disallow_legacy_javainfo (a boolean; default: "true")
  --[no]incompatible_disallow_struct_provider_syntax (a boolean; default: "false")
  --[no]incompatible_enable_exports_provider (a boolean; default: "false")
  --[no]incompatible_enforce_config_setting_visibility (a boolean; default: "false")
  --[no]incompatible_existing_rules_immutable_view (a boolean; default: "false")
  --[no]incompatible_java_common_parameters (a boolean; default: "true")
  --[no]incompatible_linkopts_to_linklibs (a boolean; default: "true")
  --[no]incompatible_new_actions_api (a boolean; default: "true")
  --[no]incompatible_no_attr_license (a boolean; default: "true")
  --[no]incompatible_no_implicit_file_export (a boolean; default: "false")
  --[no]incompatible_no_rule_outputs_param (a boolean; default: "false")
  --[no]incompatible_require_linker_input_cc_api (a boolean; default: "true")
  --[no]incompatible_run_shell_command_string (a boolean; default: "true")
  --[no]incompatible_struct_has_no_methods (a boolean; default: "false")
  --[no]incompatible_top_level_aspects_require_providers (a boolean; default: "false")
  --[no]incompatible_use_cc_configure_from_rules_cc (a boolean; default: "false")
  --[no]incompatible_visibility_private_attributes_at_definition (a boolean; default: "false")
  --max_computation_steps (a long integer; default: "0")
  --nested_set_depth_limit (an integer; default: "3500")

Options relating to query output and semantics:
  --aspect_deps (off, conservative or precise; default: "conservative")
  --[no]experimental_graphless_query (a tri-state (auto, yes, no); default: "auto")
  --graph:conditional_edges_limit (an integer; default: "4")
  --[no]graph:factored (a boolean; default: "true")
  --graph:node_limit (an integer; default: "512")
  --[no]implicit_deps (a boolean; default: "true")
  --[no]include_aspects (a boolean; default: "true")
  --[no]incompatible_display_source_file_location (a boolean; default: "true")
  --[no]incompatible_lexicographical_output (a boolean; default: "true")
  --[no]infer_universe_scope (a boolean; default: "false")
  --[no]line_terminator_null (a boolean; default: "false")
  --[no]nodep_deps (a boolean; default: "true")
  --noorder_results
  --null
  --order_output (no, deps, auto or full; default: "auto")
  --order_results
  --output (a string; default: "label")
  --[no]proto:default_values (a boolean; default: "true")
  --[no]proto:definition_stack (a boolean; default: "false")
  --[no]proto:flatten_selects (a boolean; default: "true")
  --[no]proto:include_synthetic_attribute_hash (a boolean; default: "false")
  --[no]proto:instantiation_stack (a boolean; default: "false")
  --[no]proto:locations (a boolean; default: "true")
  --proto:output_rule_attrs (comma-separated list of options; default: "all")
  --[no]proto:rule_inputs_and_outputs (a boolean; default: "true")
  --query_file (a string; default: "")
  --[no]relative_locations (a boolean; default: "false")
  --[no]strict_test_suite (a boolean; default: "false")
  --[no]tool_deps (a boolean; default: "true")
  --universe_scope (comma-separated list of options; default: "")
  --[no]xml:default_values (a boolean; default: "false")
  --[no]xml:line_numbers (a boolean; default: "true")

Options that trigger optimizations of the build time:
  --[no]incompatible_do_not_split_linking_cmdline (a boolean; default: "true")
  --[no]keep_state_after_build (a boolean; default: "true")
  --[no]track_incremental_state (a boolean; default: "true")

Options that affect the verbosity, format or location of logging:
  --[no]announce_rc (a boolean; default: "false")
  --[no]attempt_to_print_relative_paths (a boolean; default: "false")
  --bes_backend (a string; default: "")
  --bes_header (a 'name=value' assignment; may be used multiple times)
  --bes_instance_name (a string; default: see description)
  --bes_keywords (comma-separated list of options; may be used multiple times)
  --[no]bes_lifecycle_events (a boolean; default: "true")
  --bes_outerr_buffer_size (an integer; default: "10240")
  --bes_outerr_chunk_size (an integer; default: "1048576")
  --bes_proxy (a string; default: see description)
  --bes_results_url (a string; default: "")
  --bes_timeout (An immutable length of time.; default: "0s")
  --build_event_binary_file (a string; default: "")
  --[no]build_event_binary_file_path_conversion (a boolean; default: "true")
  --build_event_json_file (a string; default: "")
  --[no]build_event_json_file_path_conversion (a boolean; default: "true")
  --build_event_max_named_set_of_file_entries (an integer; default: "-1")
  --[no]build_event_publish_all_actions (a boolean; default: "false")
  --build_event_text_file (a string; default: "")
  --[no]build_event_text_file_path_conversion (a boolean; default: "true")
  --[no]experimental_announce_profile_path (a boolean; default: "false")
  --[no]experimental_bep_target_summary (a boolean; default: "false")
  --[no]experimental_build_event_expand_filesets (a boolean; default: "false")
  --[no]experimental_build_event_fully_resolve_fileset_symlinks (a boolean; default: "false")
  --experimental_build_event_upload_strategy (a string; default: see description)
  --experimental_profile_additional_tasks (phase, action, action_check, action_lock, action_release, action_update, action_complete, info, create_package, remote_execution, local_execution, scanner, local_parse, upload_time, process_time, remote_queue, remote_setup, fetch, vfs_stat, vfs_dir, vfs_readlink, vfs_md5, vfs_xattr, vfs_delete, vfs_open, vfs_read, vfs_write, vfs_glob, vfs_vmfs_stat, vfs_vmfs_dir, vfs_vmfs_read, wait, thread_name, thread_sort_index, skyframe_eval, skyfunction, critical_path, critical_path_component, handle_gc_notification, action_counts, local_cpu_usage, system_cpu_usage, local_memory_usage, system_memory_usage, starlark_parser, starlark_user_fn, starlark_builtin_fn, starlark_user_compiled_fn, starlark_repository_fn, action_fs_staging, remote_cache_check, remote_download, remote_network, filesystem_traversal, worker_execution, worker_setup, worker_borrow, worker_working, worker_copying_outputs, credential_helper or unknown; may be used multiple times)
  --[no]experimental_profile_include_primary_output (a boolean; default: "false")
  --[no]experimental_profile_include_target_label (a boolean; default: "false")
  --[no]experimental_record_metrics_for_all_mnemonics (a boolean; default: "false")
  --experimental_repository_resolved_file (a string; default: "")
  --[no]experimental_stream_log_file_uploads (a boolean; default: "false")
  --experimental_workspace_rules_log_file (a path; default: see description)
  --[no]generate_json_trace_profile (a tri-state (auto, yes, no); default: "auto")
  --[no]heap_dump_on_oom (a boolean; default: "false")
  --[no]legacy_important_outputs (a boolean; default: "true")
  --logging (0 <= an integer <= 6; default: "3")
  --memory_profile_stable_heap_parameters (two integers, separated by a comma; default: "1,0")
  --profile (a path; default: see description)
  --remote_print_execution_messages (failure, success or all; default: "failure")
  --[no]slim_profile (a boolean; default: "true")
  --starlark_cpu_profile (a string; default: "")
  --tool_tag (a string; default: "")
  --ui_event_filters (Convert list of comma separated event kind to list of filters; may be used multiple times)

Options specifying or altering a generic input to a Bazel command that does not fall into other categories.:
  --experimental_resolved_file_instead_of_workspace (a string; default: "")

Remote caching and execution options:
  --experimental_downloader_config (a string; default: see description)
  --[no]experimental_guard_against_concurrent_changes (a boolean; default: "false")
  --[no]experimental_remote_cache_async (a boolean; default: "false")
  --[no]experimental_remote_cache_compression (a boolean; default: "false")
  --experimental_remote_capture_corrupted_outputs (a path; default: see description)
  --experimental_remote_downloader (a string; default: see description)
  --[no]experimental_remote_execution_keepalive (a boolean; default: "false")
  --experimental_remote_grpc_log (a path; default: see description)
  --[no]experimental_remote_merkle_tree_cache (a boolean; default: "false")
  --experimental_remote_merkle_tree_cache_size (a long integer; default: "1000")
  --[no]incompatible_remote_build_event_upload_respect_no_cache (a boolean; default: "false")
  --[no]incompatible_remote_output_paths_relative_to_input_root (a boolean; default: "false")
  --[no]incompatible_remote_results_ignore_disk (a boolean; default: "false")
  --[no]remote_accept_cached (a boolean; default: "true")
  --remote_bytestream_uri_prefix (a string; default: see description)
  --remote_cache (a string; default: see description)
  --remote_cache_header (a 'name=value' assignment; may be used multiple times)
  --remote_default_exec_properties (a 'name=value' assignment; may be used multiple times)
  --remote_default_platform_properties (a string; default: "")
  --remote_downloader_header (a 'name=value' assignment; may be used multiple times)
  --remote_exec_header (a 'name=value' assignment; may be used multiple times)
  --remote_execution_priority (an integer; default: "0")
  --remote_executor (a string; default: see description)
  --remote_header (a 'name=value' assignment; may be used multiple times)
  --remote_instance_name (a string; default: "")
  --[no]remote_local_fallback (a boolean; default: "false")
  --remote_local_fallback_strategy (a string; default: "local")
  --remote_max_connections (an integer; default: "100")
  --remote_proxy (a string; default: see description)
  --remote_result_cache_priority (an integer; default: "0")
  --remote_retries (an integer; default: "5")
  --remote_timeout (An immutable length of time.; default: "60s")
  --[no]remote_upload_local_results (a boolean; default: "true")
  --[no]remote_verify_downloads (a boolean; default: "true")

Miscellaneous options, not otherwise categorized.:
  --all_incompatible_changes
  --build_metadata (a 'name=value' assignment; may be used multiple times)
  --color (yes, no or auto; default: "auto")
  --config (a string; may be used multiple times)
  --curses (yes, no or auto; default: "auto")
  --deleted_packages (comma-separated list of package names; default: "")
  --disk_cache (a path; default: see description)
  --[no]enable_platform_specific_config (a boolean; default: "false")
  --experimental_credential_helper (An (unresolved) path to a credential helper for a scope.; may be used multiple times)
  --experimental_credential_helper_cache_duration (An immutable length of time.; default: "30m")
  --experimental_credential_helper_timeout (An immutable length of time.; default: "5s")
  --[no]experimental_windows_watchfs (a boolean; default: "false")
  --google_auth_scopes (comma-separated list of options; default: "https://www.googleapis.com/auth/cloud-platform")
  --google_credentials (a string; default: see description)
  --[no]google_default_credentials (a boolean; default: "false")
  --grpc_keepalive_time (An immutable length of time.; default: see description)
  --grpc_keepalive_timeout (An immutable length of time.; default: "20s")
  --override_repository (an equals-separated mapping of repository name to path; may be used multiple times)
  --package_path (colon-separated list of options; default: "%workspace%")
  --[no]progress_in_terminal_title (a boolean; default: "false")
  --[no]show_loading_progress (a boolean; default: "true")
  --[no]show_progress (a boolean; default: "true")
  --show_progress_rate_limit (a double; default: "0.2")
  --[no]show_task_finish (a boolean; default: "false")
  --[no]show_timestamps (a boolean; default: "false")
  --tls_certificate (a string; default: see description)
  --tls_client_certificate (a string; default: see description)
  --tls_client_key (a string; default: see description)
  --ui_actions_shown (an integer; default: "8")
  --[no]watchfs (a boolean; default: "false")

(Use 'help --long' for full details or --short to just enumerate options.)
