Command Reference

This page provides a comprehensive reference for all command-line options available in promptprep.

Core Options

Option

Description

-d PATH, --directory PATH

Directory to scan for code files (default: current directory)

-o FILE, --output-file FILE

Output file path (default: full_code.txt)

-c, --clipboard

Copy output to clipboard instead of saving to a file

File Selection Options

Option

Description

-i LIST, --include-files LIST

Only include these specific files (comma-separated list of relative paths)

-e LIST, --exclude-dirs LIST

Skip these directories (comma-separated list)

-x LIST, --extensions LIST

Only include files with these extensions (comma-separated list)

-m SIZE, --max-file-size SIZE

Skip files larger than this size in MB (default: 100.0)

--interactive

Launch terminal-based file browser for visual selection

Content Processing Options

Option

Description

--summary-mode

Extract only function/class signatures and docstrings

--include-comments

Include comments in the output (default)

--no-include-comments

Strip all comments from the output

--metadata

Add statistics about your codebase at the beginning

--count-tokens

Count tokens for AI model context limits (requires --metadata)

--token-model MODEL

Tokenizer model to use (default: cl100k_base for GPT-4)

Output Formatting Options

Option

Description

--format FORMAT

Output format: plain, markdown, html, highlighted, or custom

--line-numbers

Add line numbers to code in the output

--template-file FILE

Custom template file (required if using --format custom)

Incremental Processing Options

Option

Description

--incremental

Only process files that have changed since last run

--last-run-timestamp TS

Unix timestamp of last run (e.g., 1678886400.0)

Diff Generation Options

Option

Description

--diff PREV_FILE

Compare with a previous output file and show changes

--diff-context LINES

Number of unchanged lines to show around changes (default: 3)

--diff-output FILE

Save diff to a file instead of showing on screen

Configuration Management Options

Option

Description

--save-config [FILE]

Save current options to a configuration file

--load-config [FILE]

Load options from a configuration file

Other Options

Option

Description

--version

Show version number and exit

-h, --help

Show help message and exit

Option Details

Directory Selection

promptprep -d PATH, --directory PATH

Specify the directory to scan for code files. If not provided, promptprep will use the current directory.

Output Options

promptprep -o FILE, --output-file FILE

Specify the file where the output should be saved. If not provided, promptprep will save to full_code.txt.

promptprep -c, --clipboard

Send the output directly to the clipboard instead of saving to a file. This is useful when you want to immediately paste the output into another application.

File Selection

promptprep -i LIST, --include-files LIST

Only process the specified files. Provide a comma-separated list of relative paths. For example:

promptprep -i "src/main.py,src/utils.py,README.md"
promptprep -e LIST, --exclude-dirs LIST

Skip the specified directories. Provide a comma-separated list of directory names. For example:

promptprep -e "node_modules,venv,.git,__pycache__"
promptprep -x LIST, --extensions LIST

Only include files with the specified extensions. Provide a comma-separated list of extensions. For example:

promptprep -x ".py,.js,.md"
promptprep -m SIZE, --max-file-size SIZE

Skip files larger than the specified size in MB. Default is 100.0 MB. For example:

promptprep -m 5  # Skip files larger than 5 MB
promptprep --interactive

Launch a terminal-based file browser to select files visually.

Content Processing

promptprep --summary-mode

Extract only function/class signatures and docstrings, skipping implementation details.

promptprep --include-comments  # Default behavior
promptprep --no-include-comments  # Strip all comments

Control whether comments are included in the output.

promptprep --metadata

Add statistics about your codebase at the beginning of the output.

promptprep --count-tokens
promptprep --token-model MODEL  # Default: cl100k_base (GPT-4)

Count how many tokens your code will use when sent to AI models. Requires --metadata.

Output Formatting

promptprep --format FORMAT

Choose the output format. Available options:

  • plain: Simple text format (default)

  • markdown: GitHub-friendly Markdown with code blocks

  • html: Complete webpage with basic styling

  • highlighted: Syntax-highlighted code (requires pygments)

  • custom: Custom format using a template file

promptprep --line-numbers

Add line numbers to the code in the output.

promptprep --format custom --template-file FILE

Use a custom template file for the output.

Incremental Processing

promptprep --incremental
promptprep --last-run-timestamp TIMESTAMP

Only process files that have changed since the last run.

Diff Generation

promptprep --diff PREV_FILE
promptprep --diff-context LINES  # Default: 3
promptprep --diff-output FILE

Compare with a previous output file and show what changed.

Configuration Management

promptprep [options] --save-config [FILE]

Save the current options to a configuration file for later use.

promptprep --load-config [FILE] [additional options]

Load options from a configuration file. Additional options will override the loaded ones.