Skip to content

CLI Help Documentation

reprex --help
Usage: reprex COMMAND [OPTIONS]

Render reproducible examples of Python code for sharing. Your code will be      
executed and, in the default output style, the results will be embedded as      
comments below their associated lines.                                          

By default, your system's default command-line text editor will open for you to 
type or paste in your code. This editor can be changed by setting either of the 
VISUAL or EDITOR environment variables, or by explicitly passing in the --editor
program. The interactive IPython editor requires IPython to be installed. You   
can also instead specify an input file with the --infile / -i option.           

Additional markup will be added that is appropriate to the choice of venue      
formatting. For example, for the default 'gh' venue for GitHub Flavored         
Markdown, the final reprex output will look like:                               


 ```python                                                                      
 arr = [1, 2, 3, 4, 5]                                                          
 [x + 1 for x in arr]                                                           
 #> [2, 3, 4, 5, 6]                                                             
 max(arr) - min(arr)                                                            
 #> 4                                                                           
 ```                                                                            

 <sup>Created at 2021-02-27 00:13 PST by                                        
 [reprexlite](https://github.com/jayqi/reprexlite) v1.0.0</sup>                 


The supported venue formats are:                                                

 • gh : Github Flavored Markdown                                                
 • so : StackOverflow (alias for 'gh')                                          
 • ds : Discourse (alias for 'gh')                                              
 • html : HTML                                                                  
 • py : Python script                                                           
 • rtf : Rich Text Format                                                       
 • slack : Slack                                                                

╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ --help -h  Display this message and exit.                                    │
│ --version  Display application version.                                      │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Parameters ─────────────────────────────────────────────────────────────────╮
│ --infile                    -i  Read code from this file instead of opening  │
│                                 an editor.                                   │
│ --outfile                   -o  Write rendered reprex to this file instead   │
│                                 of standard out.                             │
│ --editor                    -e  Command-line program name of editor to use.  │
│                                 If not specified, check $EDITOR and $VISUAL  │
│                                 environment variables. If 'ipython', will    │
│                                 launch the IPython interactive editor.       │
│ --venue                     -v  Key to identify the output venue that the    │
│                                 reprex will be shared in. Used to select an  │
│                                 appropriate formatter. See "Venues           │
│                                 Formatting" documentation for formats        │
│                                 included with reprexlite. [choices: gh, ds,  │
│                                 so, html, py, rtf, slack] [default: gh]      │
│ --advertise --no-advertise      Whether to include a footer that credits     │
│                                 reprexlite. If unspecified, will depend on   │
│                                 specified venue formatter's default.         │
│ --session-info                  Include details about session and            │
│   --no-session-info             environment that the reprex was generated    │
│                                 with. [default: False]                       │
│ --style --no-style              Whether to autoformat code with black.       │
│                                 Requires black to be installed. [default:    │
│                                 False]                                       │
│ --prompt                        Prefix to use as primary prompt for code     │
│                                 lines. [default: ]                           │
│ --continuation                  Prefix to use as secondary prompt for        │
│                                 continued code lines. [default: ]            │
│ --comment                       Prefix to use for results returned by        │
│                                 expressions. [default: #>]                   │
│ --keep-old-results              Whether to additionally include results of   │
│   --no-keep-old-results         expressions detected in the original input   │
│                                 when formatting the reprex output. [default: │
│                                 False]                                       │
│ --parsing-method                Method for parsing input. 'auto' will        │
│                                 automatically detect either default          │
│                                 reprex-style input or standard doctest-style │
│                                 input. 'declared' will allow you to specify  │
│                                 custom line prefixes. Values for 'prompt',   │
│                                 'continuation', and 'comment' will be used   │
│                                 for both output formatting and input         │
│                                 parsing, unless the associated 'input_*'     │
│                                 override settings are supplied. [choices:    │
│                                 auto, declared] [default: auto]              │
│ --input-prompt                  Prefix to use as primary prompt for code     │
│                                 lines when parsing input. Only used if       │
│                                 'parsing_method' is 'declared'. If not set,  │
│                                 'prompt' is used for both input parsing and  │
│                                 output formatting.                           │
│ --input-continuation            Prefix to use as secondary prompt for        │
│                                 continued code lines when parsing input.     │
│                                 Only used if 'parsing_method' is 'declared'. │
│                                 If not set, 'prompt' is used for both input  │
│                                 parsing and output formatting.               │
│ --input-comment                 Prefix to use for results returned by        │
│                                 expressions when parsing input. Only used if │
│                                 'parsing_method' is 'declared'. If not set,  │
│                                 'prompt' is used for both input parsing and  │
│                                 output formatting.                           │
│ --verbose                       Increase verbosity.                          │
╰──────────────────────────────────────────────────────────────────────────────╯