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