LogoPear Docs

Command Line Interface (CLI)

Pear CLI: init, run, release, and day-to-day development commands.

stable

The Command Line Interface is the primary interface for Pear Development.

pear build [flags]

Command source on GitHub

Create a project deployment folder.

Assembles per-OS electron-forge makes — one per target architecture — into the multi-architecture deployment directory that pear stage reads from disk: a package.json plus a by-arch/<platform-arch>/app/ tree.

Each make runs on its own OS, so transfer the per-platform outputs to one machine first, then pass each via its --<platform-arch>-app flag. Run pear build from outside the application source tree (or point --target at a sibling folder) so the deployment output is never re-staged into itself — see stage size increases. If you omit --target, the directory is auto-named <name>-<version> from package.json.

  --package [path]               Path to project package.json
  --target [path]                Target build dir
  --darwin-arm64-app [path]      Path to Mac ARM64 app
  --darwin-x64-app [path]        Path to Mac x64 app
  --linux-arm64-app [path]       Path to Linux ARM64 app
  --linux-x64-app [path]         Path to Linux x64 app
  --win32-x64-app [path]         Path to Windows x64 app
  --win32-arm64-app [path]       Path to Windows ARM64 app
  --ios-arm64 [path]             Path to iOS ARM64 folder (ota bundle and assets)
  --ios-arm64-simulator [path]   Path to iOS ARM64-Simulator folder (ota bundle and assets)
  --ios-x64-simulator [path]     Path to iOS x64-Simulator folder (ota bundle and assets)
  --android-arm64 [path]         Path to Android ARM64 folder (ota bundle and assets)
  --json                         Newline delimited JSON output
  --help|-h                      Show help

For the full release walkthrough, see Deploy a Pear desktop app and Build desktop distributables.

Command source on GitHub

Synchronize local changes to pear hypercores.

To generate a link, see pear touch.

Pear links hold a key, this is the basis for application discovery.

Outputs diff information and project link.

Each time new changes are staged, the length will increase. This change can be replicated to any peer who know the link and is connected. If they run pear info <link>, they will see the length update even if the application is not being seeded. Connections can potentially linger after seeding an application but will eventually close.

  --dry-run|-d       Execute a stage without writing
  --ignore <paths>   Comma-separated path ignore list
  --purge            Remove ignored files if present in previous stage
  --compact|-c       Tree-shaking minimal stage via static-analysis
  --only <paths>     Filter by paths. Comma-separated
  --truncate <n>     Advanced. Truncate to version length n
  --no-ask           Suppress permission prompt
  --no-pre           Skip pre scripts
  --pre-io           Show stdout & stderr of pre scripts
  --pre-q            Suppress piped output of pre scripts
  --json             Newline delimited JSON output
  --help|-h          Show help

Command source on GitHub

Pre-production block sync

Synchronize blocks to a pre-production target link

The target can then be multi-signed against a production link

Use pear touch to generate target link

Arguments:
  <source-link>       Versioned source link
  <target-link>       Target link to sync to
  <production-link>   Versioned link to sync against

Flags:
  --dry-run|-d        Execute provision without writing
  --json              Newline delimited JSON output
  --help|-h           Show help

pear multisig [command]

Command source on GitHub

Production signing coordination. Gate production releases behind a quorum of signing keys instead of a single machine's key. See Set up multisig and Sign with multisig for the end-to-end flow.

CommandDescription
keys get [name=default]Get a signing key, initializing it if needed
keys listList signing keys
keys add <name>Add a signing key
keys remove <name>Remove a signing key
linkPrint the project multisig link (derived from the multisig field in pear.json)
request <verlink>Create a multisig request from a versioned source link
sign <request> [name=default]Sign a multisig request with a local signing key
verify <source-link> <request> [...responses]Verify the request and responses (commit dry-run)
commit <source-link> <request> [...responses]Apply signatures to sync the source drive to the multisig drive (go live)
  --config [./pear.json]   Config file path
  --json                   Newline delimited JSON output
  --help|-h                Show help

Command source on GitHub

Seed project or reseed key.

Specify link to seed a project or a remote link to reseed.

Seeding will sparsely replicate the application. This means the entire history of the link is available, but most likely only the most recent version will be replicated.

  --verbose|-v     Additional output
  --name <name>    Advanced. Override app name
  --no-ask         Suppress permission prompt
  --json           Newline delimited JSON output
  --help|-h        Show help

Command source on GitHub

Set production release version.

Set the release pointer against a version (default latest).

Use this to indicate production release points. Once a link has been released (setting a pointer for a given version) running the application (via pear run <link>) will load the application at the released version even if more changes were staged.

  --checkout=n|current     Set a custom release length (version)
  --json                   Newline delimited JSON output
  --help|-h                Show help

Command source on GitHub

View project changelog

Supply a link to view application changelog

Shows Pear changelog by default

  --max|-m <n=10>    Maximum entries to show
  --of <semver=^*>   SemVer filter - default: latest major
  --full             Show entire changelog
  --no-ask           Suppress permission prompt
  --json             Newline delimited JSON output
  --help|-h          Show help

Command source on GitHub

Read project information.

Supply a link to view application information.

Supply no argument to view platform information.

  --metadata       View metadata only
  --manifest       View app manifest only
  --key            View key only
  --no-ask         Suppress permission prompt
  --json           Newline delimited JSON output
  --help|-h        Show help

Command source on GitHub

Synchronize files from link to dir.

To dump to stdout, use - in place of <dir>.

<link> can contain a path portion to dump a subset of the files for the Pear application. For example, to dump only the CHANGELOG.md from Keet into a dump-dir directory run:

pear dump pear://keet/CHANGELOG.md dump-dir/
  --dry-run|-d     Execute a dump without writing
  --checkout <n>   Dump from specified checkout, n is version length
  --only <paths>   Filter by paths. Implies --no-prune. Comma-seperated
  --force|-f       Force overwrite existing files
  --list           List paths at link. Sets <dir> to -
  --no-ask         Suppress permission prompt
  --no-prune       Prevent removal of existing paths
  --json           Newline delimited JSON output
  --help|-h        Show help

pear touch [flags]

Command source on GitHub

Creates a Pear link. Pear links hold a key, this is the basis for application discovery.

  --json      Newline delimited JSON output
  --help|-h   Show help

pear sidecar

Command source on GitHub

The Pear Sidecar is a local-running HTTP and IPC server which provides access to corestores.

This command instructs any existing sidecar process to shutdown and then becomes the sidecar.

  --mem                 memory mode: RAM corestore
  --key <key>           Advanced. Switch release lines
  --log-level <level>   Level to log at. 0,1,2,3 (OFF,ERR,INF,TRC)
  --log-labels <list>   Labels to log (internal, always logged)
  --log-fields <list>   Show/hide: date,time,h:level,h:label,h:delta
  --log-stacks          Add a stack trace to each log message
  --help|-h             Show help

pear versions

Command source on GitHub

Output version information.

--modules|-m   Include module versions
--json         Single JSON object
--help|-h      Show help

pear presets [flags] [command]

Command source on GitHub

Default flags per command & link

Pin flags to a given pear command per app link

  --json        Newline delimited JSON output
  --help|-h     Show help

pear shift [flags] <source> <destination>

Command source on GitHub

DEPRECATED

Move user application storage between applications.

<source> and <destination> are links.

--force     Overwrite existing application storage if present
--json      Newline delimited JSON output
--help|-h   Show help

pear drop [flags] [command]

Command source on GitHub

DEPRECATED: pear run is deprecated and pear drop app is related. See Manage installed applications for guidance on resetting an application's storage.

Advanced. Permanent data deletion

WARNING: Confirmation will be requested as the storage will be deleted permanently and cannot be recovered. Use with caution.

CommandsDescription
appReset an application to initial state
--json      Newline delimited JSON output
--help|-h   Show help

pear gc [flags] [command]

Command source on GitHub

Perform garbage collection and remove unused resources.

CommandsDescription
releasesClear inactive releases
sidecarsClear running sidecars
assetsClear synced assets
corescorestore cores
  --json        Newline delimited JSON output
  --help|-h     Show help

pear data [flags] [command]

Command source on GitHub

DEPRECATED: pear run is deprecated and pear data apps is related. See Manage installed applications for the recommended way to inspect installed apps.

View database contents.

The database contains metadata stored on this device used by the Pear runtime.

CommandsDescription
appsDEPRECATED Installed apps
dhtDHT known-nodes cache
gcGarbage collection records
manifestDatabase internal versioning
assetsOn-disk assets for app
currentsCurrent working versions
--secrets   Show sensitive information, i.e. encryption-keys
--json      Newline delimited JSON output
--help|-h   Show help

pear init [flags] <link|name> [dir]

Command source on GitHub

Create initial project files.

Links: pear://electron/template, pear://your.key.here/your/path/here

Names: default, ui, node-compat

Default project directory path is ..

Template can also be initialized from a pear:// link, the template should contain a _template.json file. This file defines the prompts which are converted to locals that are injected into the template.

--yes|-y                  Autoselect all defaults
--force|-f                Force overwrite existing files
--no-ask                  Suppress permissions dialogs
--help|-h                 Show help
upcoming

Install a Pear application — or the Pear platform itself — from a pear:// link.

pear install pear://<key> installs any application built with pear build, pulling it from the swarm and wiring it up locally so it can be launched and kept up to date over the air. It works for both applications and binaries.

pear install is not yet part of the Pear CLI. You can preview it today with the standalone pear-install module. For example, install Keet peer-to-peer with:

npx pear-install pear://17pwkcszz18deaccarhrrixhzf1f5ko1b1dz6j3pxhexebutjwzy

Once it ships with the CLI, the equivalent will be pear install pear://keet. See Storage and distribution for the install model and the direction described in Pear Evolution.

pear run [flags] <link|dir> [...app-args]

Command source on GitHub

DEPRECATED - use pear-runtime

Run an application from a link or dir.

linkpear://<key> | pear://<alias>
dirfile://<absolute-path> | <absolute-path> | <relative-path>
  --dev|-d                       Enable --devtools & --updates-diff
  --devtools                     Open devtools with application [Desktop]
  --updates-diff                 Enable diff computation for Pear.updates
  --no-updates                   Disable updates firing via Pear.updates
  --link=url                     Simulate deep-link click open
  --store|-s=path                Set the Application Storage path
  --tmp-store|-t                 Automatic new tmp folder as store path
  --links <kvs>                  Override configured links with comma-separated key-values
  --chrome-webrtc-internals      Enable chrome://webrtc-internals
  --unsafe-clear-app-storage     Clear app storage
  --appling=path                 Set application shell path
  --checkout=n                   Run a checkout, n is version length
  --checkout=release             Run checkout from marked released length
  --checkout=staged              Run checkout from latest version length
  --detached                     Wakeup existing app or run detached
  --no-ask                       Suppress permissions dialogs
  --help|-h                      Show help

Examples

pear run pear://u6c6it1hhb5serppr3tghdm96j1gprtesygejzhmhnk5xsse8kmy
pear run -s /tmp/app-storage path/to/an-app-folder some --app args
pear run -t file://path/to/an-app-folder --some app --args
pear run pear://keet

See also

On this page