Skip to content

v0.0.3 Commands

Ron edited this page Oct 10, 2024 · 2 revisions

Fleetbase CLI Commands Documentation (New Commands introduced in version 0.0.3)

Table of Contents


flb login

Description

Log in to the Fleetbase registry. This command authenticates you with the Fleetbase registry by saving your credentials to your local .npmrc file.

Usage

flb login [options]

Options

  • -u, --username <username>: Username for the registry.
  • -p, --password <password>: Password for the registry.
  • -e, --email <email>: Email associated with your account.
  • -r, --registry <registry>: Registry URL (default: https://registry.fleetbase.io).
  • --scope <scope>: Scope for the registry (optional).
  • --quotes <quotes>: Quotes option for npm-cli-login (optional).
  • --config-path <configPath>: Path to the npm config file (optional).

Examples

Log in with username, password, and email:

flb login -u your_username -p 'your_password' -e [email protected]

Log in with a specific registry and scope:

flb login -u your_username -p 'your_password' -e [email protected] -r https://registry.fleetbase.io --scope '@fleetbase'

Notes

  • Ensure that special characters in your password are properly escaped or enclosed in quotes.
  • The command updates your local .npmrc file with authentication details.
  • Handle your credentials securely and be cautious with password storage.

flb bundle

Description

Create a bundle of your Fleetbase extension. This command packages your extension into a compressed archive suitable for distribution or uploading.

Usage

flb bundle [options]

Options

  • -p, --path <path>: Path of the Fleetbase extension (default: .).
  • --upload: After bundling, upload the bundle to the Fleetbase registry using your authentication token.
  • --auth-token <token>: Auth token for uploading the bundle (used with --upload option).
  • -r, --registry <registry>: Registry URL (default: https://registry.fleetbase.io).

Examples

Create a bundle of the extension in the current directory:

flb bundle

Create a bundle and upload it to the registry:

flb bundle --upload

Specify a custom path for the extension and upload:

flb bundle -p ./extensions/my-extension --upload --auth-token YOUR_AUTH_TOKEN

Notes

  • The command creates a .tar.gz archive of your extension, excluding certain directories like node_modules and server_vendor.
  • If the --upload option is used, the bundle will be uploaded after creation.
  • Ensure you have the necessary authentication token when using the --upload option.

flb bundle-upload

Description

Upload a Fleetbase extension bundle to the Fleetbase registry. This command packages your extension and uploads it for distribution.

Usage

flb bundle-upload [bundleFile] [options]

Options

  • [bundleFile]: Path to the bundle file to upload. If not provided, it will look for the bundle in the current directory.
  • -p, --path <path>: Path where the bundle is located (default: .).
  • --auth-token <token>: Auth token for uploading the bundle. If not provided, the token will be read from the .npmrc file.
  • -r, --registry <registry>: Registry URL (default: https://registry.fleetbase.io).

Examples

Upload a bundle in the current directory:

flb bundle-upload

Upload a specific bundle file:

flb bundle-upload path/to/your-extension-bundle.tar.gz

Upload a bundle with a specified auth token:

flb bundle-upload --auth-token YOUR_AUTH_TOKEN

Notes

  • The bundle should be created using the flb bundle command.
  • The upload process handles the bundle as a multipart/form-data request.

flb version-bump

Description

Bump the version of the Fleetbase extension. This command updates the version number in your extension's manifest files (extension.json, package.json, composer.json).

Usage

flb version-bump [options]

Options

  • -p, --path <path>: Path of the Fleetbase extension (default: .).
  • --major: Bump major version (e.g., 1.0.02.0.0).
  • --minor: Bump minor version (e.g., 1.0.01.1.0).
  • --patch: Bump patch version (e.g., 1.0.01.0.1). This is the default if no flag is provided.
  • --pre-release [identifier]: Add a pre-release identifier (e.g., 1.0.01.0.0-beta).

Examples

Bump the patch version (default behavior):

flb version-bump

Bump the minor version:

flb version-bump --minor

Bump the major version:

flb version-bump --major

Add a pre-release identifier:

flb version-bump --pre-release beta

Notes

  • The command updates version numbers in the specified files and formats them according to Semantic Versioning (SemVer).
  • Ensure you commit your changes to version control after bumping the version.
  • The default behavior increments the patch version if no flags are provided.

flb scaffold

Description

Scaffold a new Fleetbase extension. This command creates a new extension project with the necessary files and structure.

Usage

flb scaffold [options]

Options

  • --name <name>: Name of the extension.
  • --description <description>: Description of the extension.
  • --author <author>: Author's name.
  • --email <email>: Author's email.
  • -p, --path <path>: Path where the extension will be created (default: current directory).
  • --repository <repository>: Git repository URL (optional).

Examples

Scaffold a new extension with basic information:

flb scaffold --name "My Extension" --description "An awesome Fleetbase extension" --author "John Doe" --email "[email protected]"

Specify a custom path for the extension:

flb scaffold --name "My Extension" -p ./extensions/my-extension

Notes

  • The command initializes a new extension project by cloning the starter extension repository.
  • Fill in the provided options to customize your new extension.
  • After scaffolding, navigate to the extension directory and begin development.

Additional Information

  • Authentication: Use flb login to authenticate with the Fleetbase registry before performing actions like uploading bundles or publishing extensions.
  • Version Control: It's recommended to use a version control system like Git to manage your extension's source code.
  • Publishing Extensions: After uploading your bundle, you can publish your extension to make it available to others (if applicable).
  • Help Command: Use flb --help to display help information about available commands.