Skip to main content

CLI tool for searching the Protocol Labs Network Directory

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.2.tar.gz (56.8 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.2-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pln_search-0.1.2.tar.gz
  • Upload date:
  • Size: 56.8 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.2.tar.gz
Algorithm Hash digest
SHA256 035ced936034ac248567e7a6cc1d5120ef55cbf263b8e2967c94b23a92e12828
MD5 2353f83349d6c56c392c5ca89a70a5f7
BLAKE2b-256 29761574ba2839a52db43a183ce4e72ba97b5cbac6cdf8af71fec46c0b3f7934

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pln_search-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8ca6e66074f42d0b95d2cffcd81bd599df97007cd98f06bd90f1658a0d8b63e0
MD5 648aac44066bc28ed6f81fbe4f892314
BLAKE2b-256 59948c5fac8a4c14900ffbdb9464b4456cd0895ed4a2d690912bfa24715020a1

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