🐜 A Command Line Interface for the Bridge Compiler
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.nuget
Bridge.Compiler
Bridge
installer
.gitattributes
.gitignore
Bridge.CLI.sln
LICENSE
README.md

README.md

Bridge CLI

A Command Line Interface for the Bridge.NET compiler.

Usage

bridge [commands] [options]
bridge [options] (<name>|<path>|<list>)
bridge [-h|--help]

The following steps outline the commands for creating a new C# project using the Bridge CLI, then opening in Visual Studio Code, then ultimately running your app in a web browser. Here's what we'll do:

  1. Create a new folder called Demo1 (rename to whatever you want)
  2. Move the command prompt into the folder
  3. Create a new Bridge project using the default project template
  4. Add Retyped to the project
  5. Open the project in Visual Studio Code
  6. Build (compile) the project
  7. Run the app in your default web browser

Bridge CLI and Visual Studio Code must have already been installed for this sample to work. We use Visual Studio Code in this sample, but you can substitue for your editor of choice.

Example (Windows Command Prompt)

md Demo1                    // Create a new folder
cd Demo1                    // Move into the folder
bridge new                  // Create a new project
bridge add package retyped  // Add retyped
code .                      // Open in Visual Studio Code
bridge build                // Build the project, or
bridge run                  // Build and Run the index.html

Example (Mac Terminal)

mkdir Demo1                 // Create a new folder
cd Demo1                    // Move into the folder
bridge new                  // Create a new project
bridge add package retyped  // Add retyped
code .                      // Open in Visual Studio Code
bridge build                // Build the project, or
bridge run                  // Build and Run the index.html

After successfully building your project, you should see a new dist folder in your project root. These are the Bridge generated files, including your index.html file which can be opened in a browser, or just use the bridge run command from the Command or Terminal.

PRO TIP: If you're using Visual Studio Code, after opening the project, you can use Ctrl + Shift + B to build your project without leaving VS Code.

Commands

Command Description
new Initialize a valid Bridge C# Class Library project.
new <template> Initialize a new project based on the named Template. Default is classlib.
build Builds the Bridge project.
run Compiles and immediately runs the index.html file.
add package <name> Add a package from NuGet.org to the project.
remove package <name> Removes a Nuget package from the project.
add repo "<path>" Add a package source location.
restore Restores all NuGet packages.

Common Options

Option Description
-h or --help Show help.
-v or --version Show version.

Options

Option Description
-c --configuration <name> Configuration name (Debug/Release etc).
-D --define <list> Semicolon-delimited list of project constants.
-f --folder <path> Builder working directory relative to current dir.
-h --help Show help.
-p --project <path> The .csproj file location.
-P --platform <name> Platform name (AnyCPU etc).
-r --rebuild Force Assembly rebuilding.
-R --recursive Recursively search for .cs source files.
-s --source <file> Source files name/pattern [default: *.cs].
-S --settings <name:value> Comma-delimited list of project settings.
-v --version Show version.
--nocore Do not extract core javascript files.
--norecursive Non-recursive search for .cs source files.
--notimestamp Do not show timestamp in log messages.

More information on getting started with Bridge.NET at https://bridge.net/docs.