pltr-cli: Palantir Foundry CLI
This skill helps you use the pltr-cli to interact with Palantir Foundry effectively.
Compatibility
- Skill version: 1.1.0
- pltr-cli version: 0.12.0+
- Python: 3.9, 3.10, 3.11, 3.12
- Dependencies: foundry-platform-sdk >= 1.69.0
Overview
pltr-cli is a comprehensive CLI with 100+ commands for:
- Dataset operations: Get info, list files, download files, manage branches and transactions
- SQL queries: Execute queries, export results, manage async queries
- Ontology: List ontologies, object types, objects, execute actions and queries
- Orchestration: Manage builds, jobs, and schedules
- Filesystem: Folders, spaces, projects, resources
- Admin: User, group, role management
- Connectivity: External connections and data imports
- MediaSets: Media file management
- Language Models: Interact with Anthropic Claude models and OpenAI embeddings
- Streams: Create and manage streaming datasets, publish real-time data
- Functions: Execute queries and inspect value types
- AIP Agents: Manage AI agents, sessions, and versions
- Models: ML model registry for model and version management
Critical Concepts
RID-Based API
The Foundry API is RID-based (Resource Identifier). Most commands require RIDs:
- Datasets:
ri.foundry.main.dataset.{uuid}
- Folders:
ri.compass.main.folder.{uuid} (root: ri.compass.main.folder.0)
- Builds:
ri.orchestration.main.build.{uuid}
- Schedules:
ri.orchestration.main.schedule.{uuid}
- Ontologies:
ri.ontology.main.ontology.{uuid}
Users must know RIDs in advance (from Foundry web UI or previous API calls).
Authentication
Before using any command, ensure authentication is configured:
# Configure interactively
pltr configure configure
# Or use environment variables
export FOUNDRY_TOKEN="your-token"
export FOUNDRY_HOST="foundry.company.com"
# Verify connection
pltr verify
Output Formats
All commands support multiple output formats:
pltr <command> --format table # Default: Rich table
pltr <command> --format json # JSON output
pltr <command> --format csv # CSV format
pltr <command> --output file.csv # Save to file
Profile Selection
Use --profile to switch between Foundry instances:
pltr <command> --profile production
pltr <command> --profile development
Reference Files
Load these files based on the user's task:
| Task Type |
Reference File |
| Setup, authentication, getting started |
reference/quick-start.md |
| Dataset operations (get, files, branches, transactions) |
reference/dataset-commands.md |
| SQL queries |
reference/sql-commands.md |
| Builds, jobs, schedules |
reference/orchestration-commands.md |
| Ontologies, objects, actions |
reference/ontology-commands.md |
| Users, groups, roles, orgs |
reference/admin-commands.md |
| Folders, spaces, projects, resources, permissions |
reference/filesystem-commands.md |
| Connections, imports |
reference/connectivity-commands.md |
| Media sets, media items |
reference/mediasets-commands.md |
| Anthropic Claude models, OpenAI embeddings |
reference/language-models-commands.md |
| Streaming datasets, real-time data publishing |
reference/streams-commands.md |
| Functions queries, value types |
reference/functions-commands.md |
| AIP Agents, sessions, versions |
reference/aip-agents-commands.md |
| ML model registry, model versions |
reference/models-commands.md |
Workflow Files
For common multi-step tasks:
| Workflow |
File |
| Data exploration, SQL analysis, ontology queries |
workflows/data-analysis.md |
| ETL pipelines, scheduled jobs, data quality |
workflows/data-pipeline.md |
| Setting up permissions, resource roles, access control |
workflows/permission-management.md |
Common Commands Quick Reference
# Verify setup
pltr verify
# Current user info
pltr admin user current
# Execute SQL query
pltr sql execute "SELECT * FROM my_table LIMIT 10"
# Get dataset info
pltr dataset get ri.foundry.main.dataset.abc123
# List files in dataset
pltr dataset files list ri.foundry.main.dataset.abc123
# Download file from dataset
pltr dataset files get ri.foundry.main.dataset.abc123 "/path/file.csv" "./local.csv"
# Copy dataset to another folder
pltr cp ri.foundry.main.dataset.abc123 ri.compass.main.folder.target456
# List folder contents
pltr folder list ri.compass.main.folder.0 # root folder
# Search builds
pltr orchestration builds search
# Interactive shell mode
pltr shell
# Send message to Claude model
pltr language-models anthropic messages ri.language-models.main.model.xxx \
--message "Explain this concept"
# Generate embeddings
pltr language-models openai embeddings ri.language-models.main.model.xxx \
--input "Sample text"
# Create streaming dataset
pltr streams dataset create my-stream \
--folder ri.compass.main.folder.xxx \
--schema '{"fieldSchemaList": [{"name": "value", "type": "STRING"}]}'
# Publish record to stream
pltr streams stream publish ri.foundry.main.dataset.xxx \
--branch master \
--record '{"value": "hello"}'
# Execute a function query
pltr functions query execute myQuery --parameters '{"limit": 10}'
# Get AIP Agent info
pltr aip-agents get ri.foundry.main.agent.abc123
# List agent sessions
pltr aip-agents sessions list ri.foundry.main.agent.abc123
# Get ML model info
pltr models model get ri.foundry.main.model.abc123
# List model versions
pltr models version list ri.foundry.main.model.abc123
Best Practices
- Always verify authentication first: Run
pltr verify before starting work
- Use appropriate output format: JSON for programmatic use, CSV for spreadsheets, table for readability
- Use async for large queries:
pltr sql submit + pltr sql wait for long-running queries
- Export results: Use
--output to save results for further analysis
- Use shell mode for exploration:
pltr shell provides tab completion and history
Getting Help
pltr --help # All commands
pltr <command> --help # Command help
pltr <command> <sub> --help # Subcommand help
1---2name: pltr-cli3description: Helps you work with Palantir Foundry using the pltr CLI. Use this when you need to query datasets, manage orchestration builds, work with ontologies, run SQL queries, manage folders/spaces/projects, copy datasets, or perform admin operations in Foundry. Triggers: Foundry, pltr, dataset, SQL query, ontology, build, schedule, RID.4---5
6
7# pltr-cli: Palantir Foundry CLI
8
9This skill helps you use the pltr-cli to interact with Palantir Foundry effectively.
10
11## Compatibility
12
13- **Skill version**: 1.1.0
14- **pltr-cli version**: 0.12.0+
15- **Python**: 3.9, 3.10, 3.11, 3.12
16- **Dependencies**: foundry-platform-sdk >= 1.69.0
17
18## Overview
19
20pltr-cli is a comprehensive CLI with 100+ commands for:
21- **Dataset operations**: Get info, list files, download files, manage branches and transactions
22- **SQL queries**: Execute queries, export results, manage async queries
23- **Ontology**: List ontologies, object types, objects, execute actions and queries
24- **Orchestration**: Manage builds, jobs, and schedules
25- **Filesystem**: Folders, spaces, projects, resources
26- **Admin**: User, group, role management
27- **Connectivity**: External connections and data imports
28- **MediaSets**: Media file management
29- **Language Models**: Interact with Anthropic Claude models and OpenAI embeddings
30- **Streams**: Create and manage streaming datasets, publish real-time data
31- **Functions**: Execute queries and inspect value types
32- **AIP Agents**: Manage AI agents, sessions, and versions
33- **Models**: ML model registry for model and version management
34
35## Critical Concepts
36
37### RID-Based API
38The Foundry API is **RID-based** (Resource Identifier). Most commands require RIDs:
39- **Datasets**: `ri.foundry.main.dataset.{uuid}`
40- **Folders**: `ri.compass.main.folder.{uuid}` (root: `ri.compass.main.folder.0`)
41- **Builds**: `ri.orchestration.main.build.{uuid}`
42- **Schedules**: `ri.orchestration.main.schedule.{uuid}`
43- **Ontologies**: `ri.ontology.main.ontology.{uuid}`
44
45Users must know RIDs in advance (from Foundry web UI or previous API calls).
46
47### Authentication
48Before using any command, ensure authentication is configured:
49```bash
50# Configure interactively
51pltr configure configure
52
53# Or use environment variables
54export FOUNDRY_TOKEN="your-token"
55export FOUNDRY_HOST="foundry.company.com"
56
57# Verify connection
58pltr verify
59```
60
61### Output Formats
62All commands support multiple output formats:
63```bash
64pltr <command> --format table # Default: Rich table
65pltr <command> --format json # JSON output
66pltr <command> --format csv # CSV format
67pltr <command> --output file.csv # Save to file
68```
69
70### Profile Selection
71Use `--profile` to switch between Foundry instances:
72```bash
73pltr <command> --profile production
74pltr <command> --profile development
75```
76
77## Reference Files
78
79Load these files based on the user's task:
80
81| Task Type | Reference File |
82|-----------|----------------|
83| Setup, authentication, getting started | `reference/quick-start.md` |
84| Dataset operations (get, files, branches, transactions) | `reference/dataset-commands.md` |
85| SQL queries | `reference/sql-commands.md` |
86| Builds, jobs, schedules | `reference/orchestration-commands.md` |
87| Ontologies, objects, actions | `reference/ontology-commands.md` |
88| Users, groups, roles, orgs | `reference/admin-commands.md` |
89| Folders, spaces, projects, resources, permissions | `reference/filesystem-commands.md` |
90| Connections, imports | `reference/connectivity-commands.md` |
91| Media sets, media items | `reference/mediasets-commands.md` |
92| Anthropic Claude models, OpenAI embeddings | `reference/language-models-commands.md` |
93| Streaming datasets, real-time data publishing | `reference/streams-commands.md` |
94| Functions queries, value types | `reference/functions-commands.md` |
95| AIP Agents, sessions, versions | `reference/aip-agents-commands.md` |
96| ML model registry, model versions | `reference/models-commands.md` |
97
98## Workflow Files
99
100For common multi-step tasks:
101
102| Workflow | File |
103|----------|------|
104| Data exploration, SQL analysis, ontology queries | `workflows/data-analysis.md` |
105| ETL pipelines, scheduled jobs, data quality | `workflows/data-pipeline.md` |
106| Setting up permissions, resource roles, access control | `workflows/permission-management.md` |
107
108## Common Commands Quick Reference
109
110```bash
111# Verify setup
112pltr verify
113
114# Current user info
115pltr admin user current
116
117# Execute SQL query
118pltr sql execute "SELECT * FROM my_table LIMIT 10"
119
120# Get dataset info
121pltr dataset get ri.foundry.main.dataset.abc123
122
123# List files in dataset
124pltr dataset files list ri.foundry.main.dataset.abc123
125
126# Download file from dataset
127pltr dataset files get ri.foundry.main.dataset.abc123 "/path/file.csv" "./local.csv"
128
129# Copy dataset to another folder
130pltr cp ri.foundry.main.dataset.abc123 ri.compass.main.folder.target456
131
132# List folder contents
133pltr folder list ri.compass.main.folder.0 # root folder
134
135# Search builds
136pltr orchestration builds search
137
138# Interactive shell mode
139pltr shell
140
141# Send message to Claude model
142pltr language-models anthropic messages ri.language-models.main.model.xxx \
143 --message "Explain this concept"
144
145# Generate embeddings
146pltr language-models openai embeddings ri.language-models.main.model.xxx \
147 --input "Sample text"
148
149# Create streaming dataset
150pltr streams dataset create my-stream \
151 --folder ri.compass.main.folder.xxx \
152 --schema '{"fieldSchemaList": [{"name": "value", "type": "STRING"}]}'
153
154# Publish record to stream
155pltr streams stream publish ri.foundry.main.dataset.xxx \
156 --branch master \
157 --record '{"value": "hello"}'
158
159# Execute a function query
160pltr functions query execute myQuery --parameters '{"limit": 10}'
161
162# Get AIP Agent info
163pltr aip-agents get ri.foundry.main.agent.abc123
164
165# List agent sessions
166pltr aip-agents sessions list ri.foundry.main.agent.abc123
167
168# Get ML model info
169pltr models model get ri.foundry.main.model.abc123
170
171# List model versions
172pltr models version list ri.foundry.main.model.abc123
173```
174
175## Best Practices
176
1771. **Always verify authentication first**: Run `pltr verify` before starting work
1782. **Use appropriate output format**: JSON for programmatic use, CSV for spreadsheets, table for readability
1793. **Use async for large queries**: `pltr sql submit` + `pltr sql wait` for long-running queries
1804. **Export results**: Use `--output` to save results for further analysis
1815. **Use shell mode for exploration**: `pltr shell` provides tab completion and history
182
183## Getting Help
184
185```bash
186pltr --help # All commands
187pltr <command> --help # Command help
188pltr <command> <sub> --help # Subcommand help
189```