Skip to main content

HTTP CLI and external-agent skills for Paper Plane X

Project description

Paper Plane X CLI

PyPI Python License

English | 中文

ppx is the JSON-first command-line client and external-agent integration package for Paper Plane X. It provides stable HTTP commands for project discovery, literature search, paper comparison, PDF parsing, project-file editing, and durable paper notes.

The package also ships two Agent Skills:

  • ppx-researcher: evidence-driven literature research through a Paper Plane X project.
  • ppx-pdf-to-markdown: local PDF conversion through the configured Paper Plane X parser.

Every remote command calls a running Paper Plane X Backend under /api/v1; the CLI never reads the backend database directly.

Who should use it

  • Researchers who prefer terminal and scriptable workflows.
  • Automation that needs predictable JSON output and non-zero failure codes.
  • Codex, Claude Code, Pi agent, and other Agent Skills-compatible tools.
  • Developers integrating Paper Plane X into local research pipelines.

Requirements

  • Python 3.12+
  • uv
  • A running Paper Plane X Backend for remote commands
  • A project ID for project-scoped commands

Installation

Install the released package from PyPI:

uv tool install paper-plane-x-cli
ppx --help

Upgrade or uninstall:

uv tool upgrade paper-plane-x-cli
uv tool uninstall paper-plane-x-cli

Install the current source checkout for development:

uv tool install .

Quick start

Configure the backend and a default project:

ppx context set --base-url http://127.0.0.1:8000/api/v1
ppx context set --project-id prj_x
ppx context show

Explore and compare project papers:

ppx project global-finder
ppx librarian search \
  --query-expr "(meta.title CONTAINS transformer)" \
  --limit 20
ppx librarian matrix \
  --paper-ids pap_a,pap_b \
  --field-paths meta.title,quick_scan.quick_summary
ppx librarian deep-dive \
  --paper-id pap_a \
  --question "What is the core contribution?"

Persist a result in the project workspace:

ppx files upload --source ./comparison.md --path /notes/comparison.md

Context resolution

ppx resolves configuration in this order:

  1. command-line options: --base-url, --project-id;
  2. environment variables: PPX_BASE_URL, PPX_PROJECT_ID;
  3. local context: ./.paper-plane-x/context.json;
  4. global context: ~/.config/paper-plane-x/context.json;
  5. default base URL: http://127.0.0.1:8000/api/v1.

Local context overrides global context, which is useful when each working directory maps to a different Paper Plane X project.

# Global defaults
ppx context set --base-url http://127.0.0.1:8000/api/v1
ppx context set --project-id prj_default

# Current directory only
ppx context set --local --project-id prj_current

For temporary or CI usage:

PPX_BASE_URL=http://127.0.0.1:8000/api/v1 \
PPX_PROJECT_ID=prj_x \
ppx project global-finder

Do not store secrets in context files. The CLI context contains server and project identifiers, not LLM API keys.

Command groups

Group Purpose
ppx context Set and inspect global or local context
ppx project Project-level discovery
ppx librarian Search, matrix comparison, and deep dive
ppx pdf Convert a local PDF to Markdown and images
ppx paper Download stored paper Markdown
ppx paper-note Read, write, or delete durable paper notes
ppx files List, read, write, upload, patch, and delete project files
ppx skills Install or remove bundled Agent Skills

Run ppx <group> --help for authoritative options.

Project files

ppx files list --dir /
ppx files read --path /notes/idea.md
ppx files lines --path /draft.md --start-line 1 --end-line 40
ppx files find --path /draft.md --query "Related Work"
ppx files write --path /notes/idea.md --content "# Idea"
ppx files upload --source ./idea.md --path /notes/idea.md
ppx files patch \
  --path /draft.md \
  --action insert_after \
  --anchor-text "## Related Work" \
  --content "..."
ppx files delete --path /notes/obsolete.md

Project files are sandboxed by the backend: path traversal is rejected, only approved text/data extensions are accepted, and uploads are limited to 10 MB per file.

Prefer targeted find, lines, replace-*, or patch operations when an Agent modifies an existing document. This reduces accidental overwrites and makes failures explicit.

Paper Markdown and notes

Download the parsed Markdown stored for a paper:

ppx paper markdown --paper-id pap_x --save-dir ./paper-markdown

The default filename is <paper-id>.md; override it with --output-md-name.

Maintain a durable paper note:

ppx paper-note get --paper-id pap_x
ppx paper-note write --paper-id pap_x --content "Stable research note"
ppx paper-note delete --paper-id pap_x

Use paper notes for stable conclusions about one paper. Use project files for cross-paper synthesis, matrices, plans, and drafts.

PDF to Markdown

ppx pdf parse --source ./paper.pdf --save-dir ./paper-pdf

The command uploads the PDF to the configured backend parser, writes Markdown and referenced images, prunes unreferenced images, and prints a JSON summary:

{
  "md_path": "paper-pdf/paper.md",
  "image_paths": ["paper-pdf/images/fig1.png"],
  "parser_type": "local_mineru"
}

Parser choice and credentials are managed by the backend Settings, not by the CLI.

Agent Skills

Bundled skills:

skills/ppx-researcher/SKILL.md
skills/ppx-pdf-to-markdown/SKILL.md

List and install them:

ppx skills list
ppx skills install

The default target is ${CODEX_HOME:-~/.codex}/skills. Use an explicit target for other tools:

Tool or scope Command
Codex default ppx skills install
Generic Agent Skills directory ppx skills install --target-dir ~/.agents/skills
Pi agent ppx skills install --target-dir ~/.pi/agent/skills
Claude Code user scope ppx skills install --target-dir ~/.claude/skills
Claude Code project scope ppx skills install --target-dir ./.claude/skills

Existing bundled skill directories are skipped unless --force is provided. uninstall removes only the bundled ppx-* skill names:

ppx skills uninstall
ppx skills uninstall --target-dir ~/.agents/skills

Restart the Agent application or open a new session after installation.

Output and automation contract

  • Successful remote commands print JSON to stdout.
  • HTTP, context, and validation failures print structured JSON to stderr.
  • Failures return a non-zero exit code.
  • Download commands write files only to the requested local directory.
  • The CLI does not log or persist backend LLM credentials.

Scripts should parse JSON rather than human-readable terminal formatting.

Development

git clone https://github.com/WindLX/paper_plane_x_cli.git
cd paper_plane_x_cli
uv sync
uv run ppx --help

Quality checks:

just lint
just format-check
just typecheck
just test
just build
just pre-commit

Equivalent uv commands:

uv run ruff check src tests
uv run ruff format --check src tests
uv run pyright
uv run pytest
uv build

Contributing and pull requests

  1. Create a focused branch from the latest main.
  2. Preserve JSON output compatibility unless the change explicitly introduces a breaking contract.
  3. Add tests for command parsing, context precedence, request payloads, and file output.
  4. Update both README.md and README.zh.md for user-visible changes.
  5. Update bundled Skill instructions when the workflow or CLI contract changes.
  6. Run just pre-commit before opening a PR.

PR descriptions should include motivation, affected commands, compatibility impact, and verification commands. Never include API keys, private paper content, or local context files in issues or test fixtures.

Report problems at GitHub Issues.

Release

The CLI version is managed by the Paper Plane X monorepo VERSION file. A top-level vX.Y.Z release builds the wheel and source distribution and publishes them to PyPI through GitHub Actions Trusted Publishing.

Do not bump the CLI version independently; use the monorepo release process.

License

Paper Plane X CLI is licensed under the GNU Affero General Public License v3.0 or later.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paper_plane_x_cli-0.1.3.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paper_plane_x_cli-0.1.3-py3-none-any.whl (36.9 kB view details)

Uploaded Python 3

File details

Details for the file paper_plane_x_cli-0.1.3.tar.gz.

File metadata

  • Download URL: paper_plane_x_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for paper_plane_x_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ef3bf6d37c13447a7d3a169ba6fea229b90d4d98c318225c6a996999c0e45219
MD5 a68c25477738822c096fcec5d6e68329
BLAKE2b-256 04e40b7174eb1895fa9ac1a82725933213c7f3b39326dd1568749617fb0a5488

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_plane_x_cli-0.1.3.tar.gz:

Publisher: release.yml on WindLX/paper_plane_x

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file paper_plane_x_cli-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for paper_plane_x_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e4b65cb4a0aba28a30466cd2f0f4888762d7de5af2f6b8741db28488bc3a82f
MD5 3cc21d2f2eaf6c08711302a1bfd9fbf7
BLAKE2b-256 907e2b62ad1438f249f68fedefc23a34ed9613242f822ccd61a6f99263b51e78

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_plane_x_cli-0.1.3-py3-none-any.whl:

Publisher: release.yml on WindLX/paper_plane_x

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page