The official command-line interface for PeakURL.
Use peakurl to create short links, inspect existing links, and manage your PeakURL account from the terminal.
Learn more in the full CLI docs here.
Node.js 20 or later is required.
npm i -g peakurlSign in with your PeakURL API key:
peakurl login \
--base-url https://example.com/api/v1 \
--api-key 0123456789abcdef0123456789abcdef0123456789abcdefCreate and review a short link:
peakurl create \
https://example.com/articles/launch \
--alias launch \
--title "Launch Post"
peakurl list
peakurl whoami
peakurl status
peakurl logoutThe CLI authenticates with PeakURL bearer API keys and verifies credentials with your instance before saving them locally.
--base-urlexpects the explicit API base URL, such ashttps://example.com/api/v1- API keys are 48-character hexadecimal tokens generated from your PeakURL dashboard
- Credentials are stored in the standard per-user configuration directory for
peakurl peakurl logoutremoves the saved configuration, while environment variables take precedence when set
For CI or automation, you can also authenticate with environment variables:
export PEAKURL_BASE_URL=https://example.com/api/v1
export PEAKURL_API_KEY=0123456789abcdef0123456789abcdef0123456789abcdef| Command | Description |
|---|---|
peakurl login |
Validate and save your PeakURL credentials. |
peakurl whoami |
Show the current authenticated account. |
peakurl logout |
Remove saved local CLI credentials. |
peakurl status |
Show the current system status snapshot for the site. |
peakurl core download |
Download and extract the latest PeakURL core package. |
peakurl create <url> |
Create a new short link. |
peakurl edit <id-or-alias> |
Update an existing link's destination URL or metadata. |
peakurl import <file> |
Import links from a local CSV, JSON, or XML file. |
peakurl export |
Export accessible links as CSV, JSON, or XML. |
peakurl list |
List links in your account. |
peakurl get <id-or-alias> |
Fetch a single link by ID or alias. |
peakurl delete [id-or-alias...] |
Delete links by ID or alias, in bulk, or clear all links. |
peakurl activity <subcommand> |
View audit logs, delete activity records, or clear history. |
peakurl webhook <subcommand> |
List, create, delete, and inspect supported webhook events. |
peakurl job <cmd> |
Manage server-side scheduled jobs. |
peakurl update |
Show the latest available CLI version and install command. |
Create a short link:
peakurl create \
https://example.com \
--alias example \
--title "Example" \
--social-title "Example — Official Site" \
--social-description "Explore the Example platform." \
--social-image-url https://example.com/og.pngEdit an existing short link:
peakurl edit example \
--url https://example.com/updated-page \
--social-title "Example — Updated Preview" \
--social-description "Updated Open Graph description." \
--social-image-url https://example.com/new-og.pngYou can update a link's destination URL (--url), title, status, expiration, password, and social preview fields.
List links as JSON:
peakurl list \
--limit 10 \
--jsonInspect a link:
peakurl get exampleLog out from saved local credentials:
peakurl logoutShow the current system status:
peakurl statusDisplays comprehensive system diagnostics, including health checks, site configuration, server metrics, database information, storage usage, mail settings, location analytics, cache diagnostics, and data counts.
This command typically requires an administrator account on the PeakURL instance.
To output the complete diagnostics as JSON:
peakurl status --jsonDownload, verify, and extract the current PeakURL core package into the current directory:
peakurl core downloadThe command checks the published release checksum before extracting files. If the current directory already contains release-managed files, the command stops by default.
Use --force only when you intentionally want those files replaced:
peakurl core download --forceDelete one or more links, or clear all links:
# Delete a single link
peakurl delete example
# Bulk delete multiple links
peakurl delete docs pricing blog launch
# Bulk delete with comma-separated IDs
peakurl delete --ids url_1,url_2,url_3
# Empty all short links in trash
peakurl delete --empty-trash
# Delete all accessible short links
peakurl delete --allWhen delete receives aliases or short codes, the CLI resolves them to the underlying PeakURL row IDs before deleting them.
List, inspect, and delete audit log activity:
# List recent activity records
peakurl activity list
# Filter and paginate activity logs
peakurl activity list --search delete --limit 25 --page 1
# Delete specific activity log entries
peakurl activity delete act_123 act_456
# Clear all activity log history
peakurl activity clearImport links from a local file:
peakurl import ./links.csvThe import command accepts CSV, JSON, and XML files, validates and normalizes the link records locally, and imports them in bulk.
Export links as CSV:
peakurl export --format csvWrite the exported JSON snapshot to stdout:
peakurl export --format json --stdoutList configured webhooks:
peakurl webhook listCreate a webhook:
peakurl webhook create \
https://example.com/api/webhooks/peakurl \
--event link.clicked \
--event link.createdThe create command prints the signing secret once, so save it before closing the terminal output.
List supported webhook events:
peakurl webhook eventsDelete a webhook:
peakurl webhook delete webhook_123Check the latest available CLI version:
peakurl update --checkManage scheduled jobs:
# List all registered scheduled jobs
peakurl job list
# Force a job to run immediately
peakurl job run peakurl_version_check
# Trigger all currently due jobs
peakurl job run-dueShow the recommended install command:
peakurl updateInstall the latest version manually:
npm i -g peakurl@latestDisable update notices in the current shell:
export PEAKURL_DISABLE_UPDATE_CHECK=1- Human-readable output is the default
--jsonprints machine-readable JSON where supported--quietminimizes output for scripts
