• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. RBTools 5.x
    2. Version 5.x
    3. Version 4.x
    4. Version 3.x
    5. Version 2.0
    6. Version 1.0
    7. Version 0.7
    8. Version 0.6
    9. Version 0.5
    10. RBTools Python API
    11. Module and Class References
    12. rbtools.commands
  • Home
  • Installing RBTools
  • rbt Command
  • Configuration
  • Authenticating to Review Board
  • Repository Configuration
  • Per-User Configuration
  • Team Foundation Server Configuration
  • Commands
  • alias
  • api-get
  • attach
  • clear-cache
  • close
  • diff
  • install
  • land
  • list-repo-types
  • login
  • logout
  • patch
  • post
  • publish
  • review
  • setup-completion
  • setup-repo
  • stamp
  • status
  • status-update
  • RBTools Workflows
  • Using RBTools With Cliosoft SOS
  • Using RBTools with Git
  • Using RBTools with HCL VersionVault and IBM ClearCase
  • Using RBTools With Perforce
  • RBTools Python API
  • Overview of the Python API Client
  • Tutorial
  • Resource-Specific Functionality
  • Module and Class References
  • rbtools
  • rbtools.deprecation
  • rbtools.api
  • rbtools.api.cache
  • rbtools.api.capabilities
  • rbtools.api.client
  • rbtools.api.decode
  • rbtools.api.decorators
  • rbtools.api.errors
  • rbtools.api.factory
  • rbtools.api.request
  • rbtools.api.resource
  • rbtools.api.transport
  • rbtools.api.transport.sync
  • rbtools.api.utils
  • rbtools.clients
  • rbtools.clients.base
  • rbtools.clients.base.patch
  • rbtools.clients.base.registry
  • rbtools.clients.base.repository
  • rbtools.clients.base.scmclient
  • rbtools.clients.errors
  • rbtools.clients.bazaar
  • rbtools.clients.clearcase
  • rbtools.clients.cvs
  • rbtools.clients.git
  • rbtools.clients.mercurial
  • rbtools.clients.perforce
  • rbtools.clients.plastic
  • rbtools.clients.sos
  • rbtools.clients.svn
  • rbtools.clients.tfs
  • rbtools.config
  • rbtools.config.config
  • rbtools.config.loader
  • rbtools.diffs
  • rbtools.diffs.patches
  • rbtools.diffs.patcher
  • rbtools.diffs.tools
  • rbtools.diffs.tools.backends
  • rbtools.diffs.tools.backends.gnu
  • rbtools.diffs.tools.base
  • rbtools.diffs.tools.base.diff_file_result
  • rbtools.diffs.tools.base.diff_tool
  • rbtools.diffs.tools.errors
  • rbtools.diffs.tools.registry
  • rbtools.diffs.writers
  • rbtools.commands
  • rbtools.commands.main
  • rbtools.commands
  • rbtools.commands.base
  • rbtools.commands.base.commands
  • rbtools.commands.base.errors
  • rbtools.commands.base.options
  • rbtools.commands.base.output
  • rbtools.commands.alias
  • rbtools.commands.api_get
  • rbtools.commands.attach
  • rbtools.commands.clearcache
  • rbtools.commands.close
  • rbtools.commands.diff
  • rbtools.commands.info
  • rbtools.commands.install
  • rbtools.commands.land
  • rbtools.commands.list_repo_types
  • rbtools.commands.login
  • rbtools.commands.logout
  • rbtools.commands.patch
  • rbtools.commands.post
  • rbtools.commands.publish
  • rbtools.commands.review
  • rbtools.commands.setup_completion
  • rbtools.commands.setup_repo
  • rbtools.commands.stamp
  • rbtools.commands.status
  • rbtools.commands.status_update
  • rbtools.hooks
  • rbtools.hooks.common
  • rbtools.hooks.git
  • rbtools.testing
  • rbtools.testing.api
  • rbtools.testing.api.payloads
  • rbtools.testing.api.transport
  • rbtools.testing.commands
  • rbtools.testing.testcase
  • rbtools.testing.transport
  • rbtools.utils
  • rbtools.utils.aliases
  • rbtools.utils.browser
  • rbtools.utils.checks
  • rbtools.utils.commands
  • rbtools.utils.console
  • rbtools.utils.diffs
  • rbtools.utils.encoding
  • rbtools.utils.errors
  • rbtools.utils.filesystem
  • rbtools.utils.graphs
  • rbtools.utils.mimetypes
  • rbtools.utils.process
  • rbtools.utils.repository
  • rbtools.utils.review_request
  • rbtools.utils.source_tree
  • rbtools.utils.users
  • Glossary
  • General Index
  • Python Module Index
  • Release Notes
  • rbtools.commands¶

    Base support for creating commands.

    Functions

    command_exists(cmd_name)

    Determine if the given command exists.

    find_entry_point_for_command(command_name)

    Return an entry point for the given RBTools command.

    Classes

    BaseMultiCommand(*args, **kwargs)

    Abstract base class for commands which offer subcommands.

    BaseSubCommand(*args, **kwargs)

    Abstract base class for a subcommand.

    Command(*args, **kwargs)

    Legacy base class for commands.

    JSONOutput(*args, **kwargs)

    Output wrapper for JSON output.

    LogLevelFilter(*args, **kwargs)

    Filters log messages of a given level.

    Option(*args, **kwargs)

    Represents an option for a command.

    OptionGroup(*args, **kwargs)

    Represents a named group of options.

    OutputWrapper(*args, **kwargs)

    Wrapper for output of a command.

    SmartHelpFormatter(*args, **kwargs)

    Smartly formats help text, preserving paragraphs.

    class rbtools.commands.JSONOutput(*args, **kwargs)[source]¶

    Bases: ClassMovedMixin, JSONOutput

    Output wrapper for JSON output.

    JSON outputter class that stores Command outputs in python dictionary and outputs as JSON object to output stream object. Commands should add any structured output to this object. JSON output is then enabled with the –json argument.

    Deprecated since version 5.0: Consumers should use rbtools.commands.output.JSONOutput instead.

    This will be removed in RBTools 6.

    New in version 3.0.

    class rbtools.commands.SmartHelpFormatter(*args, **kwargs)[source]¶

    Bases: ClassMovedMixin, SmartHelpFormatter

    Smartly formats help text, preserving paragraphs.

    Deprecated since version 5.0: Consumers should use rbtools.commands.base.commands.SmartHelpFormatter instead.

    This will be removed in RBTools 6.

    class rbtools.commands.OutputWrapper(*args, **kwargs)[source]¶

    Bases: ClassMovedMixin, OutputWrapper

    Wrapper for output of a command.

    Wrapper around some output object that handles outputting messages. Child classes specify the default object. The wrapper can handle messages in either unicode or bytes.

    New in version 3.0.

    __parameters__ = ()¶
    class rbtools.commands.Option(*args, **kwargs)[source]¶

    Bases: ClassMovedMixin, Option

    Represents an option for a command.

    The arguments to the constructor should be treated like those to argparse’s add_argument, with the exception that the keyword argument ‘config_key’ is also valid. If config_key is provided it will be used to retrieve the config value as a default if the option is not specified. This will take precedence over the default argument.

    Serves as a wrapper around the ArgumentParser options, allowing us to specify defaults which will be grabbed from the configuration after it is loaded.

    Deprecated since version 5.0: Consumers should use rbtools.commands.base.options.Option instead.

    This will be removed in RBTools 6.

    class rbtools.commands.OptionGroup(*args, **kwargs)[source]¶

    Bases: ClassMovedMixin, OptionGroup

    Represents a named group of options.

    Each group has a name, an optional description, and a list of options. It serves as a way to organize related options, making it easier for users to scan for the options they want.

    This works like argparse’s argument groups, but is designed to work with our special Option class.

    Deprecated since version 5.0: Consumers should use rbtools.commands.base.options.OptionGroup instead.

    This will be removed in RBTools 6.

    class rbtools.commands.LogLevelFilter(*args, **kwargs)[source]¶

    Bases: ClassMovedMixin, LogLevelFilter

    Filters log messages of a given level.

    Only log messages that have the specified level will be allowed by this filter. This prevents propagation of higher level types to lower log handlers.

    Deprecated since version 5.0: Consumers should use rbtools.commands.base.commands.LogLevelFilter instead.

    This will be removed in RBTools 6.

    class rbtools.commands.Command(*args, **kwargs)[source]¶

    Bases: ClassMovedMixin, BaseCommand

    Legacy base class for commands.

    Deprecated since version 5.0: Subclasses should inherit from rbtools.commands.base.commands.BaseCommand (or a more specific subclass) instead.

    This will be removed in RBTools 6.

    class rbtools.commands.BaseSubCommand(*args, **kwargs)[source]¶

    Bases: ClassMovedMixin, BaseSubCommand

    Abstract base class for a subcommand.

    Deprecated since version 5.0: Subclasses should inherit from rbtools.commands.base.commands.BaseSubCommand instead.

    This will be removed in RBTools 6.

    class rbtools.commands.BaseMultiCommand(*args, **kwargs)[source]¶

    Bases: ClassMovedMixin, BaseMultiCommand

    Abstract base class for commands which offer subcommands.

    Some commands (such as rbt review) want to offer many subcommands.

    Deprecated since version 5.0: Subclasses should inherit from rbtools.commands.base.commands.BaseMultiCommand instead.

    This will be removed in RBTools 6.

    New in version 3.0.

    rbtools.commands.find_entry_point_for_command(command_name: str) → Optional[EntryPoint][source]¶

    Return an entry point for the given RBTools command.

    Changed in version 5.0: This has been updated to return a modern importlib.metadata.EntryPoint.

    Parameters:

    command_name (str) – The name of the command to find.

    Returns:

    The resulting entry point, if found, or None if not found.

    Return type:

    importlib.metadata.EntryPoint

    rbtools.commands.command_exists(cmd_name: str) → bool[source]¶

    Determine if the given command exists.

    This function checks for the existence of an RBTools command entry point with the given name and an executable named rbt-“cmd_name” on the path. Aliases are not considered.

    Parameters:

    cmd_name (str) – The name of the command.

    Returns:

    True if the command exists. False if it doesn’t.

    Return type:

    bool

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]
    • JSONOutput
    • SmartHelpFormatter
    • OutputWrapper
      • OutputWrapper.__parameters__
    • Option
    • OptionGroup
    • LogLevelFilter
    • Command
    • BaseSubCommand
    • BaseMultiCommand
    • find_entry_point_for_command()
    • command_exists()