View Source API Reference nexus_cli v0.5.0

Modules

This is an example on how to use Nexus with an escript application.

MyCLI provides file operations such as copy, move, and delete using the Nexus.CLI DSL.

Nexus is a comprehensive toolkit for building Command-Line Interfaces (CLI) and Terminal User Interfaces (TUI) in Elixir. It provides a unified framework that simplifies the development of interactive applications running in the terminal.

Nexus.CLI provides a macro-based DSL for defining command-line interfaces with commands, flags, and positional arguments using structured ASTs with structs.

Represents a positional argument for a command.

Represents a command or subcommand.

Dispatches parsed CLI commands to the appropriate handler functions.

Represents a flag (option) for a command.

Provides functionality to display help messages based on the CLI AST.

Represents a command input, with args and flags values parsed

Provides validation functions for commands, flags, and arguments within the Nexus.CLI DSL.

Nexus.Parser provides functionalities to parse raw input strings based on the CLI AST. This implementation uses manual tokenization and parsing without parser combinators.

Mix Tasks

This is a Mix Task example using Nexus. Basically, you can use both Mix.Task and Nexus.CLI modules, define your commands as usual with defcommand/2 and implement others callbacks.