| Crates.io | bridge |
| lib.rs | bridge |
| version | 0.1.2 |
| created_at | 2026-01-05 08:18:20.168338+00 |
| updated_at | 2026-01-13 15:05:04.535643+00 |
| description | Command Line Interface for BridgeRust framework |
| homepage | https://bridgerust.dev |
| repository | https://github.com/bridgerust/bridgerust |
| max_upload_size | |
| id | 2023403 |
| size | 114,976 |
Command-line interface for the BridgeRust framework - write Rust once, deploy to Python and Node.js.
Website: bridgerust.dev
cargo install bridge
Or from the workspace root:
cargo build --release --bin bridge
bridge init <name>Initialize a new BridgeRust project with the proper structure.
bridge init my-project
This creates:
Cargo.toml with proper dependenciessrc/lib.rs with example functionsbridgerust.toml configuration filepython/pyproject.toml for Python packagingnodejs/package.json for Node.js packagingREADME.md with usage instructionsbridge integrate [--example]Integrate BridgeRust into an existing Rust project.
# Integrate into current project
bridge integrate
# Integrate and add example code
bridge integrate --example
# Skip prompts
bridge integrate --yes
This command:
Cargo.toml with BridgeRust dependencies and featuresbridgerust.toml configuration filepython/ and nodejs/ directoriespython/pyproject.toml and nodejs/package.jsonsrc/lib.rsNote: This command reads your existing Cargo.toml to get project name, version, and description. It won't overwrite existing files unless you confirm.
bridge build [--target <target>] [--release]Build Python and/or Node.js bindings.
# Build for all targets (in parallel)
bridge build --all
# Build only Python
bridge build --target python
# Build only Node.js
bridge build --target nodejs
# Build in release mode
bridge build --all --release
Note:
--all), Python and Node.js builds run in parallel for faster builds.--release). The CLI checks source file timestamps and skips rebuilds when nothing has changed.bridge test [--target <target>]Run tests for Rust, Python, and/or Node.js.
# Test all targets
bridge test --all
# Test only Python
bridge test --target python
# Test only Node.js
bridge test --target nodejs
# Test only Rust
bridge test --target rust
Note:
pytest (must be installed: pip install pytest)npm test if available, otherwise runs test files directly with nodecargo testbridge publish [--target <target>] [--dry-run]Publish packages to PyPI and/or npm.
# Publish to all registries
bridge publish --all
# Dry run (test without publishing)
bridge publish --all --dry-run
# Publish only Python
bridge publish --target python
# Publish only Node.js
bridge publish --target nodejs
Note:
maturin for Python publishing (install with: pip install maturin)npm for Node.js publishingbridge workflows [--output <dir>]Generate CI/CD workflow files for GitHub Actions.
# Generate workflows in default location (.github/workflows)
bridge workflows
# Generate workflows in custom location
bridge workflows --output .github/workflows
This command generates:
ci.yml): Runs on every push and PR
release.yml): Runs on version tags
Note:
PYPI_API_TOKEN and NPM_TOKEN secrets to your GitHub repositorypublish environment for manual approval before publishingbridge check [--verbose]Validate project structure, configuration, and code without building.
# Check project
bridge check
# Check with verbose output
bridge check --verbose
This command verifies:
Note:
--verbose to see detailed information about configuration and source code analysis#[export] and #[error] macro usagebridge clean [--target <target>] [--cache]Clean build artifacts and optionally the build cache.
# Clean all build artifacts
bridge clean
# Clean specific target
bridge clean --target python
bridge clean --target nodejs
# Clean build cache
bridge clean --cache
# Clean everything including cache
bridge clean --all --cache
This command removes:
--cache is specified)Note: For Rust build artifacts, use cargo clean for more control.
bridge watch [--target <target>] [--test]Watch for file changes and automatically rebuild (and optionally test) when files are modified.
# Watch all targets
bridge watch
# Watch only Python
bridge watch --target python
# Watch and run tests after each build
bridge watch --test
# Watch Node.js with tests
bridge watch --target nodejs --test
Features:
src/ directory for .rs file changesCargo.toml, pyproject.toml, and package.json for config changesmaturin develop for Python (faster development builds)Note:
maturin develop which installs the package in development modenpm run build (make sure your package.json has a build script)BridgeRust uses a bridgerust.toml file for project configuration:
[package]
name = "my-project"
version = "0.1.0"
description = "My awesome project"
authors = ["Your Name"]
[python]
module_name = "my_project"
[nodejs]
package_name = "@bridgerust/my-project"
See the examples directory for complete examples of BridgeRust projects.