pltr-cli
A command-line interface for the Palantir Foundry Platform API, for people,
scripts and AI agents. Curated commands cover datasets, ontologies, SQL,
builds and schedules, the filesystem, admin and more; pltr api adds a
command for every method of the Foundry Platform SDK.
Overview
pltr is built on the official
foundry-platform-sdk.
Every command follows the same rules: --format json prints the API's own
JSON, stdout carries only data, errors are structured with documented exit
codes, and destructive commands ask before they change anything.
Foundry's API addresses almost everything by RID (Resource Identifier), for
example ri.foundry.main.dataset.<uuid>. Most commands take RIDs, not
names; find them in Foundry's web interface, or with commands such as
pltr folder list, pltr resource get-by-path and pltr ontology list.
Wherever a command takes the RID of a Compass resource (a dataset, folder,
project, media set, connection, model, agent and so on), you can give its
path instead, such as /Space/Project/data/employees. pltr resolves the path
to the RID before it calls the API, with one lookup for all the paths in a
command, and checks that the resource is the right kind: a folder path given
to pltr dataset get fails with a wrong_resource_type error. The API itself
stays RID-based, and output always shows RIDs. A value starting with / is a
path; one starting with ri. is a RID. Spaces and the root folder can't be
looked up by path, so give their RIDs. pltr commands show <command> marks the
parameters that take a path with "acceptsPath": true.
✨ Key Features
- Authentication: token and OAuth2 profiles with credentials in the
system keyring, or environment variables for CI and agents (no keyring or
setup needed).
- Datasets: branches, files (upload and download, including whole
directories), transactions, schemas, views and previews.
- Filesystem: folders, projects, spaces and resources, including the
trash, markings and role grants;
pltr cp copies datasets (their files and
schema) and folders.
- Ontology: object types, objects (list, search, aggregate, count, linked
objects), actions and queries.
- Orchestration: builds, jobs and schedules.
- SQL: run queries, wait for them and export their results.
- More areas: media sets, streams, functions, models, language models
(Anthropic Claude, OpenAI embeddings), data health, AIP agents, widgets,
connectivity (connections and imports), audit logs, and admin (users,
groups, roles, organizations and markings).
- Every SDK endpoint:
pltr api has a generated command for each method
of the SDK's V2 client.
- Built for agents: JSON output in the API's shape, structured errors,
exit codes,
--yes for destructive commands, and pltr commands, a
searchable manifest of every command.
- Interactive shell with completion and history, shell completion for
bash, zsh and fish, command aliases, and multiple profiles.
Installation
Recommended: an isolated install
uv tool install pltr-cli # or: pipx install pltr-cli
This gives pltr its own environment, with the foundry-platform-sdk version
pltr was tested with. pltr accepts a range of SDK versions, but its
pltr api commands are generated from one
version: in a shared environment where another package upgrades the SDK, a
command whose SDK method changed fails with a clear error. Upgrade with
uv tool upgrade pltr-cli (or pipx upgrade pltr-cli).
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
1. Configure Authentication
Set up your Foundry credentials:
pltr configure configure
Follow the interactive prompts to enter:
- Foundry hostname (e.g.,
foundry.company.com)
- Authentication method (token or OAuth2)
- Your credentials
Running in CI, a container or an AI agent? Skip configure and export
FOUNDRY_HOST and FOUNDRY_TOKEN instead (see Authentication).
2. Verify Connection
Test your setup:
pltr verify
verify fetches your user from Foundry and shows which credentials it used
(pltr verify --format json for scripts).
3. Start Exploring
# Who am I?
pltr admin user current
# The ontologies you can see
pltr ontology list
# Failed builds on master
pltr orchestration builds search --status FAILED --branch master
# Spaces, the projects in a space, and a project's or folder's contents
pltr space list
pltr project list --space-rid <space-rid>
pltr folder list <project-or-folder-rid>
# Look up a resource by its path
pltr resource get-by-path "/My Space/My Project/sales"