⚠️Early Alpha — Org-press is experimental. Perfect for hackers and tinkerers, not ready for production. Documentation may be incomplete or inaccurate.

CLI Reference

The orgp command provides tools for development, building, and code quality.

Installation

# Global installation
npm install -g org-press

# Or use npx
npx orgp <command>

# Or add to package.json scripts
{
  "scripts": {
    "dev": "orgp dev",
    "build": "orgp build"
  }
}

Development Commands

orgp dev

Start the development server with hot module replacement.

orgp dev

Options:

OptionDescriptionDefault
--port <number>Port to listen on5173
--hostExpose to networkfalse
--openOpen browserfalse
--config <path>Config file pathauto

Examples:

# Start on custom port
orgp dev --port 3000

# Expose to network (for mobile testing)
orgp dev --host

# Open browser automatically
orgp dev --open

orgp preview

Preview the production build locally.

orgp build && orgp preview

Options:

OptionDescriptionDefault
--port <number>Port to listen on4173
--hostExpose to networkfalse

Build Commands

orgp build

Build the site for production.

orgp build

Options:

OptionDescriptionDefault
--outDir <dir>Output directorydist
--base <path>Base public path/
--config <path>Config file pathauto

Examples:

# Build to custom directory
orgp build --outDir public

# Build with base path (for subdirectory deployment)
orgp build --base /docs/

Code Quality Commands

orgp fmt

Format code blocks with Prettier.

orgp fmt

Options:

OptionDescriptionDefault
--checkCheck only, don't writefalse
--languages <list>Filter by languageall

Examples:

# Format all code blocks
orgp fmt

# Check formatting (CI mode)
orgp fmt --check

# Format only TypeScript
orgp fmt --languages ts,tsx

# Format specific file
orgp fmt content/api.org

orgp lint

Lint code blocks with ESLint.

orgp lint

Options:

OptionDescriptionDefault
--fixAuto-fix problemsfalse
--languages <list>Filter by languagejs,ts,jsx,tsx
--max-warnings <n>Max warnings before failunlimited

Examples:

# Lint all code blocks
orgp lint

# Auto-fix problems
orgp lint --fix

# Strict mode (fail on any warning)
orgp lint --max-warnings 0

# Lint specific file
orgp lint content/api.org

orgp type-check

Type-check TypeScript code blocks.

orgp type-check

Options:

OptionDescriptionDefault
--watchWatch modefalse

Examples:

# Check all TypeScript blocks
orgp type-check

# Watch mode
orgp type-check --watch

Testing Commands

orgp test

Run tests in :use test blocks via Vitest.

orgp test

Options:

OptionDescriptionDefault
--watchWatch modefalse
--coverageCollect coveragefalse
--name <filter>Filter by test nameall

Examples:

# Run all tests
orgp test

# Watch mode (re-run on changes)
orgp test --watch

# With coverage report
orgp test --coverage

# Filter by name
orgp test --name "validation"

# Test specific file
orgp test content/utils.org

Hashbang Scripts

Org files can be executed directly as scripts when they have a hashbang:

#!/usr/bin/env orgp
#+TITLE: Build Script

#+NAME: default
#+begin_src javascript :exec
console.log("Running default task...");
#+end_src

#+NAME: build
#+begin_src javascript :exec
console.log("Building...");
#+end_src

#+NAME: deploy
#+begin_src javascript :exec
console.log("Deploying...");
#+end_src

Usage:

# Make executable
chmod +x build.org

# Run default block
./build.org

# Run specific block
./build.org run build
./build.org run deploy

# Other commands work too
./build.org serve    # Start dev server
./build.org build    # Build static site
./build.org --help   # Show help

Configuration File

By default, orgp looks for config files in this order:

  1. .org-press/config.ts
  2. .org-press/config.js
  3. org-press.config.ts
  4. org-press.config.js

Override with --config:

orgp dev --config ./custom-config.ts

Exit Codes

CodeMeaning
0Success
1Error (build failed, lint errors, etc.)

CI/CD Integration

GitHub Actions:

- name: Install dependencies
  run: npm ci

- name: Check formatting
  run: npx orgp fmt --check

- name: Lint
  run: npx orgp lint --max-warnings 0

- name: Type check
  run: npx orgp type-check

- name: Test
  run: npx orgp test

- name: Build
  run: npx orgp build

See Also