Files
pear-docs/reference/pear/cli.md
Sean Zellmer 577c4c1bec Updating guides (1.5.0) (#154)
* Remove `--` for app option passthrough

Changed since `paparam` was used for parsing command line options:
85892a6a32a84ae42a548f8e3ac0b5dbedd70c80
Now uses `cmd.rest` for app args.

* Use `Pear.config.args` for howto scripts

* Update "starting a pear desktop project" guide to match template

* Remove `--no-ask-trust` flag from `pear run` cli doc

This command was replaced by `--no-ask` which was already in the
documentation. Updated a reference to `--no-ask-trust` in the 'Sharing a
Pear Application' guide.

* Fix typos in "Releasing a Pear Application" guide

* Correct application storage folder name in hyperbee howto

* Add missing `test/index.test.js` in project structure for terminal guide

* Remove language about app continuing to run

This is no longer true at least as of pear:
v0.5114.pqbzjhqyonxprx8hghxexnmctw75mr91ewqw5dxe1zmntfyaddqy / v1.5.0

* Fix extra indention in example code for hypercore howto

* Format json in `_template.json` example

* Add instructions to set up a minimal `package.json` for testing template

Without this, the next step of `pear run --dev .` does not work since
`pear` expects a `package.json` file.

* Rename hyperbee reader app in hyperdrive howto to avoid name conflict

Naming only matters if someone is following the guides and starts each
guide from the same root directory. If they do, then `bee-reader-app`
from the hyperdrive conflicts with the `bee-reader-app` from the
hyperbee howto.

* Remove unrelated youtube tutorial from hyperswarm howto

* Update guide/creating-a-pear-init-template.md

Co-authored-by: David Mark Clements <huperekchunow@googlemail.com>

* Fix spelling mistake

Co-authored-by: David Mark Clements <huperekchunow@googlemail.com>

---------

Co-authored-by: David Mark Clements <huperekchunow@googlemail.com>
2024-11-01 19:32:58 +01:00

6.9 KiB

Command Line Interface (CLI)

experimental

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

pear init [flags] <link|type=desktop> [dir]

Create initial project files.

Template Types: desktop, terminal, terminal-node

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
--type|-t=type            Template type. Overrides <link|type>
--force|-f                Force overwrite existing files
--with|-w=name            Additional functionality. Available: node
--no-ask                  Suppress permissions dialogs
--help|-h                 Show help

pear dev [flags] [dir] [...app-args]

Run a project in development mode from disk.

pear dev has been deprecated, use pear run --dev instead.

Alias for: pear run --dev <dir>

--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

Synchronize local changes to channel or key.

Channel name must be specified on first stage, in order to generate the initial key.

Outputs diff information and project link.

  --json                      Newline delimited JSON output
  --dry-run|-d                Execute a stage without writing
  --bare|-b                   File data only, no warmup optimization
  --ignore                    Comma separated file path ignore list
  --name                      Advanced. Override app name
  --no-ask                    Suppress permissions dialogs
  --help|-h                   Show help

Seed project or reseed key.

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

  --json                    Newline delimited JSON output
  --seeders|-s              Additional public keys to seed from
  --name                    Advanced. Override app name
  --verbose|-v              Additional output
  --no-ask                  Suppress permissions dialogs
  --help|-h                 Show help

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

Run an application from a link or dir.

link pear://<key> | pear://<alias>
dir file://<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
  --unsafe-clear-preferences     Clear preferences (such as trustlist)
  --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

Set production release version.

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

Use this to indicate production release points.

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

pear info [link|channel]

Read project information.

Supply a link or channel to view application information.

Supply no argument to view platform information.

  --changelog               View changelog only
  --full-changelog          Full record of changes
  --metadata                View metadata only
  --key                     View link only
  --json                    Newline delimited JSON output
  --no-ask                  Suppress permissions dialogs
  --help|-h                 Show help

Synchronize files from link to dir.

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

  --checkout=n              Dump from specified checkout, n is version length
  --json                    Newline delimited JSON output
  --force|-f                Force overwrite existing files
  --no-ask                  Suppress permissions dialogs
  --help|-h                 Show help

pear touch [flags] [channel]

Create Pear link

Creates a Pear Link using channel name if provided or else a randomly generated channel name.

This command is useful for creating links for automations that use pear stage <link>, pear release <link> or pear seed <link>.

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

pear sidecar

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.

  --verbose|-v     Additional output
  --mem            memory mode: RAM corestore
  --key=key        Advanced. Switch release lines
  --help|-h        Show help

pear versions

Output version information.

--json        Single JSON object
--help|-h     Show help

pear shift [flags] <source> <destination>

Move user application storage between applications.

<source> and <destination> are links.

--force     Overwrite existing application storage if present
--json      Newline delimited JSON output

pear gc [flags] [command]

Perform garbage collection and remove unused resources.

Commands Description
releases Clear inactive releases
sidecars Clear running sidecars
  --json        Newline delimited JSON output
  --help|-h     Show help