Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

pyrit.cli.pyrit_shell

PyRIT Shell - Interactive REPL for PyRIT.

This module provides an interactive shell that talks to the PyRIT backend server over HTTP. No heavy pyrit imports — all operations go through REST.

Functions

main

main() → int

Entry point for pyrit_shell.

Returns:

PyRITShell

Bases: cmd.Cmd

Interactive shell for PyRIT (thin REST client).

Constructor Parameters:

ParameterTypeDescription
no_animationboolIf True, skip the animated startup banner. Defaults to False.
server_url`strNone`
config_file`PathNone`
start_serverboolIf True, auto-start a local backend. Defaults to False.

Methods:

cmdloop

cmdloop(intro: Optional[str] = None) → None

Override cmdloop to play animated banner before starting the REPL.

default

default(line: str) → None

Handle unknown commands and convert hyphens to underscores.

do_add_initializer

do_add_initializer(arg: str) → None

Register an initializer from a Python script file.

do_clear

do_clear(arg: str) → None

Clear the screen.

do_exit

do_exit(arg: str) → bool

Exit the shell.

Returns:

do_help

do_help(arg: str) → None

Show help. Usage: help [command].

do_list_initializers

do_list_initializers(arg: str) → None

List all available initializers.

do_list_scenarios

do_list_scenarios(arg: str) → None

List all available scenarios.

do_list_targets

do_list_targets(arg: str) → None

List all available targets.

do_print_scenario

do_print_scenario(arg: str) → None

Print detailed results for a scenario run.

do_run

do_run(line: str) → None

Run a scenario.

do_scenario_history

do_scenario_history(arg: str) → None

Display history of scenario runs from the server (most recent first).

do_start_server

do_start_server(arg: str) → None

Start a local pyrit_backend server.

do_stop_server

do_stop_server(arg: str) → None

Stop the backend server.

emptyline

emptyline() → bool

Don’t repeat last command on empty line.

Returns: