Skip to content

CLI Commands

Complete reference for all Tap CLI commands.

Overview

Tap provides a simple CLI for creating, developing, building, and exporting presentations:

bash
tap <command> [options]

Run tap --help to see all available commands, or tap <command> --help for command-specific help.

tap new

Create a new presentation from a template.

Usage

bash
tap new [name]

Arguments

ArgumentDescription
nameName for the new presentation file (optional)

Flags

FlagShortDescription
--theme <name>-tTheme to use (default: minimal)
--template <type>Template type: blank, demo, talk (default: blank)
--dir <path>-dDirectory to create the file in (default: current directory)
--force-fOverwrite existing file if it exists

Examples

bash
# Create presentation with default name (untitled.md)
tap new

# Create named presentation
tap new my-talk

# Create with specific theme
tap new quarterly-review --theme gradient

# Create from demo template with all features
tap new demo-presentation --template demo

# Create in specific directory
tap new slides --dir ./presentations

# Overwrite existing file
tap new slides --force

Output

Creates a new markdown file with frontmatter and sample content:

markdown
---
title: My Talk
theme: minimal
---

# Welcome

Your first slide content here.

---

# Second Slide

More content...

tap dev

Start the development server with live reload for real-time preview.

Usage

bash
tap dev <file>

Arguments

ArgumentDescription
filePath to the markdown presentation file (required)

Flags

FlagShortDescription
--port <number>-pPort to serve on (default: 3000)
--host <ip>Host to bind to (default: localhost)
--open-oOpen browser automatically
--no-live-reloadDisable live reload on file changes
--password <pass>Enable password protection for presenter mode
--qrDisplay QR code for mobile access

Examples

bash
# Start dev server for a presentation
tap dev slides.md

# Start on a specific port
tap dev slides.md --port 8080

# Open browser automatically
tap dev slides.md --open

# Bind to all interfaces (for network access)
tap dev slides.md --host 0.0.0.0

# Enable presenter mode password
tap dev slides.md --password secret123

# Show QR code for mobile devices
tap dev slides.md --qr

URLs

When the dev server starts, it provides:

URLDescription
http://localhost:3000Audience view (main presentation)
http://localhost:3000/presenterPresenter view with notes and timer

Features

  • Live reload: Changes to your markdown file are instantly reflected
  • Live code execution: Run SQL, shell commands, and other drivers
  • Presenter mode: Access speaker notes and timer at /presenter
  • Cross-device sync: Control from tablet/phone, display on main screen

TIP

Use --host 0.0.0.0 to access the presentation from other devices on your network.


tap build

Build a production-ready static version of your presentation.

Usage

bash
tap build <file>

Arguments

ArgumentDescription
filePath to the markdown presentation file (required)

Flags

FlagShortDescription
--out <dir>-oOutput directory (default: dist/)
--base <path>-bBase path for deployment (default: /)
--minify-mEnable additional minification
--no-cleanDon't clean output directory before build
--watch-wWatch for changes and rebuild

Examples

bash
# Basic build
tap build slides.md

# Build to custom directory
tap build slides.md --out ./public

# Build for subdirectory deployment (e.g., GitHub Pages)
tap build slides.md --base /my-repo/

# Build with minification
tap build slides.md --minify

# Watch mode for continuous building
tap build slides.md --watch

Output Structure

dist/
├── index.html         # Main presentation entry point
├── assets/
│   ├── style.css      # Optimized presentation styles
│   └── main.js        # Bundled JavaScript
├── images/            # Copied image assets
└── fonts/             # Font files (if used)

WARNING

Static builds do not include live code execution. Code blocks with drivers will show their last executed result or a placeholder.


tap serve

Serve a built presentation locally for preview or local deployment.

Usage

bash
tap serve [dir]

Arguments

ArgumentDescription
dirDirectory to serve (default: dist/)

Flags

FlagShortDescription
--port <number>-pPort to serve on (default: 8080)
--host <ip>Host to bind to (default: localhost)
--open-oOpen browser automatically
--corsEnable CORS headers

Examples

bash
# Serve the default dist directory
tap serve

# Serve a specific directory
tap serve ./public

# Serve on a different port
tap serve dist --port 3000

# Open browser automatically
tap serve dist --open

# Make accessible on network
tap serve dist --host 0.0.0.0

TIP

Use tap serve to verify your production build before deploying. This catches issues like broken asset paths or base URL misconfiguration.


tap pdf

Export your presentation to PDF format.

Usage

bash
tap pdf <file>

Arguments

ArgumentDescription
filePath to the markdown presentation file (required)

Flags

FlagShortDescription
--out <file>-oOutput filename (default: <input>.pdf)
--format <type>-fExport format: slides, notes, both (default: slides)
--paper <size>Paper size: letter, a4, 16:9, 4:3 (default: 16:9)
--margin <px>-mPage margins in pixels (default: 0)
--quality <level>-qImage quality: low, medium, high (default: high)
--no-animationsExport without animation frames

Export Formats

FormatDescription
slidesExports presentation slides only (default)
notesExports speaker notes as a document
bothExports slides with corresponding notes below each

Examples

bash
# Basic PDF export
tap pdf slides.md

# Custom output filename
tap pdf slides.md --out quarterly-review.pdf

# Export slides with notes (handout format)
tap pdf slides.md --format both

# Export notes only (speaker script)
tap pdf slides.md --format notes

# A4 paper size with notes
tap pdf slides.md --format both --paper a4

# Letter size with margins
tap pdf slides.md --paper letter --margin 20

# Lower quality for smaller file size
tap pdf slides.md --quality medium

TIP

PDF export captures your presentation at export time. If you have live code execution, the results shown will be whatever was displayed when you ran the export.


tap add

Add a new slide or asset to an existing presentation.

Usage

bash
tap add [file]

Arguments

ArgumentDescription
filePath to the presentation file (default: autodetect)

Flags

FlagShortDescription
--layout <name>-lLayout for new slide (default: default)
--position <n>-pInsert position (slide number, default: end)
--title <text>-tSlide title
--image <path>-iAdd an image to the assets
--interactiveInteractive mode with prompts

Examples

bash
# Add a blank slide at the end
tap add slides.md

# Add slide with specific layout
tap add slides.md --layout two-column

# Add slide at specific position
tap add slides.md --position 3 --title "New Section"

# Add slide with title
tap add slides.md --title "Conclusion" --layout section

# Import an image asset
tap add slides.md --image ./photo.png

# Interactive mode
tap add slides.md --interactive

Available Layouts

Use --layout with any of these options:

LayoutDescription
defaultStandard content slide
titleTitle slide with centered content
sectionSection divider
two-columnTwo-column layout
three-columnThree-column layout
code-focusOptimized for code blocks
big-statLarge statistic display
quoteQuotation layout
coverFull-bleed image background
sidebarMain content with sidebar
split-mediaSplit view with media
blankEmpty slide

Global Flags

These flags work with all commands:

FlagDescription
--helpShow help for the command
--versionShow Tap version
--verboseEnable verbose output
--quietSuppress non-error output
--config <file>Path to config file
--no-colorDisable colored output

Examples

bash
# Show help
tap --help
tap dev --help

# Show version
tap --version

# Verbose mode for debugging
tap build slides.md --verbose

# Quiet mode for CI/CD
tap build slides.md --quiet

Quick Reference

CommandDescriptionExample
tap new [name]Create new presentationtap new my-talk
tap dev <file>Start dev servertap dev slides.md
tap build <file>Build for productiontap build slides.md
tap serve [dir]Serve built filestap serve dist
tap pdf <file>Export to PDFtap pdf slides.md
tap add [file]Add slide or assettap add slides.md

Exit Codes

Tap uses standard exit codes:

CodeDescription
0Success
1General error
2Invalid arguments or flags
3File not found
4Build error
5Export error

Environment Variables

Configure Tap behavior via environment variables:

VariableDescription
TAP_PORTDefault port for tap dev (default: 3000)
TAP_HOSTDefault host for tap dev (default: localhost)
TAP_THEMEDefault theme for tap new (default: minimal)
NO_COLORDisable colored output when set

Environment variables can be overridden by command-line flags.


Next Steps