# mojang/brigadier

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/mojang-brigadier).**

3,698 stars · 410 forks · Java · MIT

## Links

- GitHub: https://github.com/Mojang/brigadier
- awesome-repositories: https://awesome-repositories.com/repository/mojang-brigadier.md

## Topics

`mojang-active`

## Description

Brigadier is a command-line parser and dispatcher that maps text-based inputs to executable functions using a hierarchical tree of arguments. It provides a system for defining nested command structures and typed arguments to route user input to specific handlers.

The library includes a command syntax generator that automatically produces human-readable usage strings and documentation based on defined command nodes. It transforms raw strings into structured data to identify valid command sequences and pinpoint syntax errors.

The framework covers command tree routing, input syntax validation, and dynamic dispatching using context objects to execute actions based on the user's state.

## Tags

### Development Tools & Productivity

- [Command Tree Definitions](https://awesome-repositories.com/f/development-tools-productivity/command-tree-definitions.md) — A system for building hierarchical structures of strings and arguments to map user input to specific executable functions. ([source](https://github.com/mojang/brigadier#readme))
- [CLI Command Dispatchers](https://awesome-repositories.com/f/development-tools-productivity/cli-command-dispatchers.md) — Provides a mechanism for routing parsed command inputs to corresponding handler functions for execution. ([source](https://github.com/mojang/brigadier#readme))
- [Argument Parsing](https://awesome-repositories.com/f/development-tools-productivity/cli-command-frameworks/argument-parsing.md) — Provides logic for processing and validating command-line arguments and flags to configure tool behavior.
- [Nested Command Structures](https://awesome-repositories.com/f/development-tools-productivity/cli-command-frameworks/nested-command-structures.md) — Maps hierarchical command structures to executable functions to handle complex nested subcommands and arguments.
- [Command Line Argument Parsing](https://awesome-repositories.com/f/development-tools-productivity/command-line-argument-parsing.md) — Transforms raw text into structured results by matching input against a command tree and extracting typed arguments. ([source](https://github.com/mojang/brigadier#readme))
- [Command Line Documentation](https://awesome-repositories.com/f/development-tools-productivity/command-line-documentation.md) — Automatically generates human-readable syntax guides and usage strings from a structured command tree.
- [Contextual Execution State](https://awesome-repositories.com/f/development-tools-productivity/context-aware-environment-managers/command-execution-contexts/contextual-execution-state.md) — Implements a system to pass source objects through the execution chain to provide handlers with environmental state.
- [Documentation Generators](https://awesome-repositories.com/f/development-tools-productivity/typescript-declaration-generators/documentation-generators.md) — Automatically generates human-readable strings describing valid syntax and available subcommands for specific nodes. ([source](https://github.com/mojang/brigadier#readme))

### Programming Languages & Runtimes

- [Command Line Parsers](https://awesome-repositories.com/f/programming-languages-runtimes/structured-text-parsers/command-line-parsers.md) — Provides a mechanism to transform raw text inputs into structured command sequences and executable function calls.

### Software Engineering & Architecture

- [Hierarchical Command Dispatch](https://awesome-repositories.com/f/software-engineering-architecture/hierarchical-command-dispatch.md) — Provides a library for mapping text-based command inputs to executable functions using a hierarchical tree of arguments.
- [Command Routing Architectures](https://awesome-repositories.com/f/software-engineering-architecture/command-routing-architectures.md) — Implements a routing architecture that maps raw input strings against a hierarchical node structure to find terminal handlers.
- [Keyword-Based Command Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/keyword-based-command-dispatchers.md) — Routes parsed input to logic handlers using context objects to execute actions based on the user's state.
- [Parse Result Objects](https://awesome-repositories.com/f/software-engineering-architecture/parse-result-objects.md) — Stores the outcome of parse operations in objects that track matched nodes and pinpoint syntax errors.
- [Usage Documentation Generators](https://awesome-repositories.com/f/software-engineering-architecture/schema-driven-generators/command-string-generators/usage-documentation-generators.md) — Automatically produces human-readable usage strings and documentation based on defined command nodes.
- [Usage String Generators](https://awesome-repositories.com/f/software-engineering-architecture/schema-driven-generators/command-string-generators/usage-string-generators.md) — Automatically constructs human-readable syntax strings and documentation based on the defined command node hierarchy.

### Part of an Awesome List

- [Command Line Parsing](https://awesome-repositories.com/f/awesome-lists/devtools/command-line-parsing.md) — Converts raw text input into structured data based on predefined rules to determine the appropriate action. ([source](https://github.com/mojang/brigadier#readme))

### Scientific & Mathematical Computing

- [Command Grammar Traversers](https://awesome-repositories.com/f/scientific-mathematical-computing/recursive-tree-traversal-algorithms/command-grammar-traversers.md) — Walks through nested command children to determine if an input string matches the defined command grammar.

### System Administration & Monitoring

- [CLI Syntax Consistency Validation](https://awesome-repositories.com/f/system-administration-monitoring/configuration-consistency-validators/cli-syntax-consistency-validation.md) — Checks user input against a command schema to identify structural inconsistencies and provide usage hints.
