Expand description
utility functions for xbp cli
provides utility modules for common operations includes version api integration and other helper functions
Re-exports§
pub use cargo_manifest::resolve_cargo_package_version;pub use cargo_manifest::resolve_cargo_package_version_required;pub use cargo_manifest::write_cargo_package_version;pub use env_files::canonicalize_env_value;pub use env_files::escape_env_value_double_quoted;pub use env_files::first_lookup_value;pub use env_files::format_env_assignment;pub use env_files::format_env_file_content;pub use env_files::format_env_value_double_quoted;pub use env_files::load_env_lookup;pub use env_files::normalize_env_key;pub use env_files::normalize_env_value;pub use env_files::parse_env_content;pub use env_files::parse_env_file;pub use env_files::preferred_local_secret_env_path;pub use env_files::resolve_env_placeholders;pub use env_files::strip_utf8_bom;pub use env_files::to_env_references;pub use env_files::upsert_env_key;pub use env_files::CLOUDFLARE_ACCOUNT_ID_ENV_KEYS;pub use node_toolchain::find_node_toolchain_root;pub use node_toolchain::is_node_toolchain_command;pub use node_toolchain::node_toolchain_wrapper_path;pub use process_monitor_json::fix_cursor_process_monitor_json;pub use process_monitor_json::fix_cursor_process_monitor_json_file;pub use process_monitor_json::CursorProcessMonitorJsonFix;pub use pnpm_package_json::migrate_package_json_pnpm_settings;pub use pnpm_package_json::PnpmSettingsMigration;pub use project_paths::canonicalize_for_subprocess;pub use project_paths::collapse_project_path;pub use project_paths::resolve_project_dir;pub use project_paths::resolve_project_path;pub use project_paths::resolve_service_root;pub use version::fetch_version;pub use version::increment_version;pub use xbp_ignore::default_global_worktree_ignore_content;pub use xbp_ignore::default_xbp_ignore_path;pub use xbp_ignore::load_global_worktree_ignore_from_path;pub use xbp_ignore::load_project_xbp_ignore;pub use xbp_ignore::sync_global_worktree_ignore_file;pub use xbp_ignore::xbp_ignore_file_candidates;pub use xbp_ignore::XbpIgnoreSet;pub use xbp_ignore::DEFAULT_DISCOVERY_SKIP_DIRS;pub use xbp_ignore::DEFAULT_GLOBAL_WORKTREE_IGNORE_PATTERNS;pub use xbp_ignore::DEFAULT_NOISE_DIR_NAMES;pub use xbp_ignore::GLOBAL_WORKTREE_IGNORE_FILENAME;
Modules§
- cargo_
manifest - Cargo manifest helpers for workspace-aware version read/write.
- env_
files - node_
toolchain - pnpm_
package_ json - Migrate deprecated
package.json#pnpmsettings for pnpm v11+. - process_
monitor_ json - project_
paths - tray_
runtime - Platform event pumping and tray icon loading for native system tray UIs.
- version
- version api utilities
- xbp_
ignore - Project-local ignore rules for XBP discovery, versioning, and worktree-watch.
Structs§
Constants§
- DEFAULT_
PROJECT_ CONFIG_ KIND - Default kind used when creating a brand-new project config.
- DEFAULT_
PROJECT_ CONFIG_ RELATIVE - Repo-relative default path for greenfield project config (shown in prompts/help).
- PROJECT_
CONFIG_ FILENAMES - Supported project config basenames (under
.xbp/or project root). Order matches discovery preference (first existing wins). - PROJECT_
CONFIG_ HINT - Human-readable list of supported project config locations.
- XBP_
PROJECT_ YAML_ SCHEMA_ DIRECTIVE - Comment directive understood by the YAML Language Server / VS Code YAML extension.
Prefer
xbp_project_schema_directive_for_pathwhen writing a known config path so monorepo checkouts use the localschemas/xbp.project.schema.json. - XBP_
PROJECT_ YAML_ SCHEMA_ URL - Canonical published schema URL for project config IntelliSense (yaml-language-server).
Functions§
- cargo_
command_ exists - cargo_
program - collapse_
home_ to_ env - collect_
known_ xbp_ projects - collect_
listening_ port_ ownership - command_
exists - config_
kind_ from_ path - default_
project_ config_ path - Default config path under
.xbp/for the given format kind. - default_
project_ yaml_ config_ path - Preferred path for a new project config (
.xbp/xbp.toml). Preferresolve_project_config_write_pathwhen a config already exists. - detect_
xbp_ config_ heal_ opportunities - ensure_
xbp_ yaml_ schema_ directive - Ensure the yaml-language-server
$schemacomment is present (published URL). - ensure_
xbp_ yaml_ schema_ directive_ with - Ensure / rewrite the
$schemadirective todirective(replaces any existing header). - expand_
home_ in_ string - find_
existing_ project_ config - First existing project config under
project_root(any supported format). - find_
existing_ yaml_ xbp_ config - @deprecated Prefer
find_existing_project_config. - find_
xbp_ config_ upwards - first_
available_ command - git_
remote_ url_ from_ metadata - heal_
config_ file - heal_
project_ xbp_ config - is_
xbp_ project_ config_ filename - True when
pathis an XBP project config filename (any supported format). - load_
xbp_ project_ config_ value - Load + auto-heal project config from a discovered path.
- maybe_
auto_ convert_ legacy_ xbp_ json_ to_ yaml - Legacy helper: if only
xbp.jsonexists and no other format is present, leave JSON as-is (do not force YAML). Returns the path that should be used for subsequent writes. - open_
path_ with_ editor - open_
with_ default_ handler - parse_
config_ with_ auto_ heal - parse_
github_ repo_ from_ remote_ url - preferred_
pip_ command - preferred_
python_ command - project_
config_ candidates - All candidate project config paths for a root (
.xbp/then root, discovery order). - project_
config_ display_ path - Repo-relative path of the project config for UI copy.
- redact_
remote_ url_ credentials - render_
xbp_ config_ value - render_
xbp_ config_ value_ for_ path - Like
render_xbp_config_value, but attaches a path-aware YAML$schemadirective. - resolve_
project_ config_ write_ path - Path to write project config updates:
- resolve_
xbp_ project_ for_ path - serialize_
xbp_ config - Serialize
valueto the project config format forkind(yaml/json/jsonc/toml). - serialize_
xbp_ yaml - serialize_
xbp_ yaml_ for_ path - Serialize YAML and attach the best schema directive for
config_path(local file whenschemas/xbp.project.schema.jsonexists in the project, else the published URL). - strip_
jsonc_ comments_ light - Remove JSONC comments and trailing commas without interpreting text inside JSON strings. This is shared by project-config parsing and Wrangler-aware commands so JSONC and JSON have identical data semantics.
- write_
json_ config_ from_ any_ xbp_ config - write_
xbp_ project_ config_ at_ path - Write project config to
config_pathusing the format implied by its extension. - xbp_
project_ schema_ directive_ for_ path - Build a
# yaml-language-server: $schema=...line for a config file path.