Skip to main content

CLI tool for searching the PLN directory API

Project description

pln-search

Tests

Command-line tool for searching the Protocol Labs Network Directory API.

Installation

From PyPI (recommended)

pip install pln-search

From source

git clone https://github.com/dannyob/pln-search.git
cd pln-search
pip install -e .

Usage

Authentication

The PLN Directory uses Privy for web authentication. Until we implement a full OAuth2 flow for CLI tools, you'll need to manually configure your authentication token:

Step 1: Get your token from the browser

  1. Visit https://directory.plnetwork.io/ and log in
  2. Open browser Developer Tools (F12 or right-click → Inspect)
  3. Go to the Application tab (Chrome) or Storage tab (Firefox)
  4. In the left sidebar, expand Cookies and select: https://directory.plnetwork.io
  5. Find the authToken cookie and copy its VALUE (a long string starting with eyJ...)
  6. Optional: Also copy the refreshToken cookie value

Step 2: Configure the token

Option A - Interactive (recommended):

pln-search auth token --interactive

Option B - Command line:

pln-search auth token YOUR_TOKEN_HERE

Check authentication status:

pln-search auth status

Logout (clear credentials):

pln-search auth logout

Searching

Search:

pln-search search "John Doe"                 # Global search
pln-search search --members "John Doe"       # Search members
pln-search search --teams "Protocol Labs"    # Search teams
pln-search search --projects "IPFS"          # Search projects

Options:

pln-search search "query" --limit 50         # Show up to 50 results
pln-search search "query" --json             # JSON output
pln-search search "query" --no-color         # Plain text output

Development

Install dependencies:

make install-dev

Run tests:

make test

Format code:

make format

Development Status

Implemented:

  • ✓ Data models (Member, Team, Project)
  • ✓ Configuration management with XDG directories
  • ✓ API client with search methods
  • ✓ Output formatters (rich, plain, JSON)
  • ✓ OAuth2 token refresh
  • ✓ CLI commands
  • ✓ Test suite

TODO for production use:

  • Full OAuth2 browser flow (currently stub)
  • Integration testing with real API
  • Error message improvements
  • Performance optimization
  • PyPI packaging

Testing

The project includes a comprehensive test suite. Note that OAuth2 browser authentication is currently a stub and requires manual token setup for testing against the real API.

For local development and testing, mock the API responses.

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

pln_search-0.1.1.tar.gz (56.9 kB view details)

Uploaded Source

Built Distribution

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

pln_search-0.1.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file pln_search-0.1.1.tar.gz.

File metadata

  • Download URL: pln_search-0.1.1.tar.gz
  • Upload date:
  • Size: 56.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for pln_search-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8f4ca40fc50137fbf3765070fbd80457680f3f34b1847e527520dde7402e0c1a
MD5 f2828466d4cb734ed82a88dfd6c40b09
BLAKE2b-256 f997e5e48505aa307cc7a8e8044dd32d31e4430171a75508f30d603788306f11

See more details on using hashes here.

File details

Details for the file pln_search-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pln_search-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for pln_search-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eaa39c521b625bacbac89bf806419224adf7fda9cdd313499b64df518e51815f
MD5 00f2496c1a16eb7633b336d76dc1c4e6
BLAKE2b-256 b4841e00a6da2adab9ab69610c30f44cadba1b9a69cbc2b526b9abfd13238ea5

See more details on using hashes here.

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