Command-line interface for Palantir Foundry APIs
Project description
pltr-cli
A command-line interface tool for interacting with Palantir Foundry APIs.
Overview
pltr-cli provides a streamlined way to interact with Palantir Foundry services from the command line. Built on top of the official foundry-platform-sdk, it offers intuitive commands for dataset management, ontology operations, SQL queries, and more.
Features
- 🔐 Secure Authentication: Support for both token and OAuth2 authentication with secure credential storage
- 📊 Dataset Management: List, create, upload, and download datasets with progress indicators
- 🔍 Ontology Operations: Search and interact with ontology objects and actions
- 📝 SQL Queries: Execute SQL queries directly from the command line
- 🎨 Rich Output: Beautiful terminal output with table formatting and color support
- 👤 Multi-Profile Support: Manage multiple Foundry environments with profile configurations
Installation
Using pip
pip install pltr-cli
From source
# Clone the repository
git clone https://github.com/anjor/pltr-cli.git
cd pltr-cli
# Install with uv
uv sync
# Run the CLI
uv run pltr --help
Quick Start
Configure Authentication
Set up your Foundry credentials:
pltr configure --profile production
This will prompt you for:
- Foundry host URL
- Authentication method (token or OAuth2)
- Credentials
Basic Usage
# List datasets
pltr dataset list
# Upload a file to a dataset
pltr dataset upload <dataset-id> path/to/file.csv
# Execute a SQL query
pltr sql execute "SELECT * FROM dataset LIMIT 10"
# Search ontology objects
pltr ontology object search "customer name:John"
Command Reference
Dataset Commands
pltr dataset list- List all accessible datasetspltr dataset get <id>- Get dataset detailspltr dataset upload <id> <file>- Upload file to datasetpltr dataset download <id>- Download dataset files
Ontology Commands
pltr ontology object search <query>- Search for objectspltr ontology object get <id>- Get specific objectpltr ontology action execute <action>- Execute ontology action
SQL Commands
pltr sql execute <query>- Execute SQL querypltr sql export <query> --output <file>- Export query results
Configuration Commands
pltr configure- Set up authenticationpltr configure --profile <name>- Configure named profile
Configuration
Configuration files are stored in ~/.pltr/:
~/.pltr/config- Profile configurations- Credentials are stored securely in your system keyring
Environment Variables
You can also configure authentication via environment variables:
export FOUNDRY_HOST=https://your-foundry.palantir.com
export FOUNDRY_TOKEN=your-token-here
Development
Prerequisites
- Python 3.9+
- uv for dependency management
Setup
# Clone the repository
git clone https://github.com/anjor/pltr-cli.git
cd pltr-cli
# Install dependencies
uv sync
# Run tests
uv run pytest
# Format code
uv run ruff format
uv run ruff check --fix
Project Structure
pltr-cli/
├── src/
│ └── pltr/
│ ├── cli.py # Main CLI entry point
│ ├── auth/ # Authentication handling
│ ├── commands/ # CLI command implementations
│ ├── services/ # Foundry service wrappers
│ ├── config/ # Configuration management
│ └── utils/ # Utilities and helpers
└── tests/ # Test suite
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Built on top of the official Palantir Foundry Platform Python SDK.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pltr_cli-0.1.1.tar.gz.
File metadata
- Download URL: pltr_cli-0.1.1.tar.gz
- Upload date:
- Size: 92.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
429ce516c8c17e212bc1c2ebb103de6676930e611a0d8c7054664af868214a33
|
|
| MD5 |
430e5fc76d62056796ba86dfa78f9be6
|
|
| BLAKE2b-256 |
ea661bf5dde831d590ae63247f3c2b01d100840be4deb003ccda8f535d538eae
|
Provenance
The following attestation bundles were made for pltr_cli-0.1.1.tar.gz:
Publisher:
publish.yml on anjor/pltr-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pltr_cli-0.1.1.tar.gz -
Subject digest:
429ce516c8c17e212bc1c2ebb103de6676930e611a0d8c7054664af868214a33 - Sigstore transparency entry: 376780689
- Sigstore integration time:
-
Permalink:
anjor/pltr-cli@8854e01f20b1494da53df101b280e87cbe7f7abb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/anjor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8854e01f20b1494da53df101b280e87cbe7f7abb -
Trigger Event:
push
-
Statement type:
File details
Details for the file pltr_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pltr_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73a2868af666eafbc00e0f178cbbb3847c7ece14b1e3f129ba450543cb12e4fc
|
|
| MD5 |
acc06a6de40b4bd48599e09d5e1f7680
|
|
| BLAKE2b-256 |
e44e3707d2cc828387bd0914af2042a1d39ed0afa5f1e386266559d83229e96f
|
Provenance
The following attestation bundles were made for pltr_cli-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on anjor/pltr-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pltr_cli-0.1.1-py3-none-any.whl -
Subject digest:
73a2868af666eafbc00e0f178cbbb3847c7ece14b1e3f129ba450543cb12e4fc - Sigstore transparency entry: 376780699
- Sigstore integration time:
-
Permalink:
anjor/pltr-cli@8854e01f20b1494da53df101b280e87cbe7f7abb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/anjor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8854e01f20b1494da53df101b280e87cbe7f7abb -
Trigger Event:
push
-
Statement type: