pltr-cli 0.2.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. pltr_cli-0.4.0/CHANGELOG.md +26 -0
  2. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/CLAUDE.md +0 -1
  3. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/PKG-INFO +10 -3
  4. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/README.md +9 -2
  5. pltr_cli-0.4.0/children.csv +3 -0
  6. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/docs/README.md +1 -0
  7. pltr_cli-0.4.0/docs/user-guide/aliases.md +257 -0
  8. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/docs/user-guide/commands.md +101 -1
  9. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/docs/user-guide/quick-start.md +1 -1
  10. pltr_cli-0.4.0/folder_info.json +9 -0
  11. pltr_cli-0.4.0/folders.json +11 -0
  12. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/pyproject.toml +1 -1
  13. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/__main__.py +3 -0
  14. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/cli.py +4 -0
  15. pltr_cli-0.4.0/src/pltr/commands/alias.py +241 -0
  16. pltr_cli-0.4.0/src/pltr/commands/folder.py +338 -0
  17. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/commands/ontology.py +2 -8
  18. pltr_cli-0.4.0/src/pltr/config/aliases.py +254 -0
  19. pltr_cli-0.4.0/src/pltr/services/folder.py +167 -0
  20. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/services/ontology.py +17 -18
  21. pltr_cli-0.4.0/src/pltr/utils/alias_resolver.py +56 -0
  22. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/utils/completion.py +8 -0
  23. pltr_cli-0.4.0/tests/test_commands/test_alias.py +225 -0
  24. pltr_cli-0.4.0/tests/test_commands/test_folder.py +348 -0
  25. pltr_cli-0.4.0/tests/test_config/test_aliases.py +220 -0
  26. pltr_cli-0.4.0/tests/test_services/test_folder.py +262 -0
  27. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_services/test_ontology.py +15 -4
  28. pltr_cli-0.4.0/tests/test_utils/__init__.py +1 -0
  29. pltr_cli-0.4.0/tests/test_utils/test_alias_resolver.py +174 -0
  30. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/uv.lock +592 -593
  31. pltr_cli-0.2.0/DEVELOPMENT_PLAN.md +0 -620
  32. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/.github/workflows/ci.yml +0 -0
  33. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/.github/workflows/publish.yml +0 -0
  34. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/.github/workflows/test-publish.yml +0 -0
  35. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/.gitignore +0 -0
  36. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/.pre-commit-config.yaml +0 -0
  37. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/LICENSE +0 -0
  38. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/docs/api/wrapper.md +0 -0
  39. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/docs/examples/gallery.md +0 -0
  40. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/docs/user-guide/authentication.md +0 -0
  41. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/docs/user-guide/troubleshooting.md +0 -0
  42. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/docs/user-guide/workflows.md +0 -0
  43. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/mypy.ini +0 -0
  44. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/scripts/release.py +0 -0
  45. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/__init__.py +0 -0
  46. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/auth/__init__.py +0 -0
  47. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/auth/base.py +0 -0
  48. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/auth/manager.py +0 -0
  49. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/auth/oauth.py +0 -0
  50. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/auth/storage.py +0 -0
  51. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/auth/token.py +0 -0
  52. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/commands/__init__.py +0 -0
  53. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/commands/admin.py +0 -0
  54. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/commands/completion.py +0 -0
  55. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/commands/configure.py +0 -0
  56. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/commands/dataset.py +0 -0
  57. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/commands/shell.py +0 -0
  58. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/commands/sql.py +0 -0
  59. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/commands/verify.py +0 -0
  60. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/config/__init__.py +0 -0
  61. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/config/profiles.py +0 -0
  62. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/config/settings.py +0 -0
  63. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/services/__init__.py +0 -0
  64. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/services/admin.py +0 -0
  65. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/services/base.py +0 -0
  66. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/services/dataset.py +0 -0
  67. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/services/dataset_full.py +0 -0
  68. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/services/dataset_v2.py +0 -0
  69. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/services/sql.py +0 -0
  70. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/utils/__init__.py +0 -0
  71. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/utils/formatting.py +0 -0
  72. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/src/pltr/utils/progress.py +0 -0
  73. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/__init__.py +0 -0
  74. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/conftest.py +0 -0
  75. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/integration/README.md +0 -0
  76. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/integration/__init__.py +0 -0
  77. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/integration/conftest.py +0 -0
  78. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/integration/test_auth_flow.py +0 -0
  79. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/integration/test_cli_integration.py +0 -0
  80. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/integration/test_data_workflows.py +0 -0
  81. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/integration/test_data_workflows_simple.py +0 -0
  82. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/integration/test_simple_integration.py +0 -0
  83. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_auth/__init__.py +0 -0
  84. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_auth/test_base.py +0 -0
  85. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_auth/test_manager.py +0 -0
  86. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_auth/test_oauth.py +0 -0
  87. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_auth/test_storage.py +0 -0
  88. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_auth/test_token.py +0 -0
  89. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_commands/__init__.py +0 -0
  90. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_commands/test_admin.py +0 -0
  91. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_commands/test_completion.py +0 -0
  92. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_commands/test_dataset.py +0 -0
  93. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_commands/test_ontology.py +0 -0
  94. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_commands/test_shell.py +0 -0
  95. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_commands/test_sql.py +0 -0
  96. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_commands/test_verify_simple.py +0 -0
  97. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_config/__init__.py +0 -0
  98. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_config/test_profiles.py +0 -0
  99. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_config/test_settings.py +0 -0
  100. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_services/__init__.py +0 -0
  101. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_services/test_admin.py +0 -0
  102. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_services/test_base.py +0 -0
  103. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_services/test_dataset.py +0 -0
  104. {pltr_cli-0.2.0 → pltr_cli-0.4.0}/tests/test_services/test_sql.py +0 -0
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.4.0] - 2025-01-31
9
+
10
+ ### Added
11
+ - Comprehensive folder management functionality
12
+ - Preview mode support for folder API operations
13
+
14
+ ### Fixed
15
+ - CI pipeline issues
16
+ - Code style and formatting improvements
17
+
18
+ ## [0.3.0] - 2024-12-XX
19
+
20
+ ### Added
21
+ - Initial release with core CLI functionality
22
+ - Palantir Foundry API integration
23
+ - Command-line interface for data operations
24
+
25
+ [0.4.0]: https://github.com/anjor/pltr-cli/compare/v0.3.0...v0.4.0
26
+ [0.3.0]: https://github.com/anjor/pltr-cli/releases/tag/v0.3.0
@@ -1,6 +1,5 @@
1
1
  ## Development tips
2
2
 
3
- Always keep @DEVELOPMENT_PLAN.md up to date.
4
3
  The basis of the SDK is https://github.com/palantir/foundry-platform-python . This is a
5
4
  CLI that wraps around the SDK to give a CLI interface.
6
5
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pltr-cli
3
- Version: 0.2.0
3
+ Version: 0.4.0
4
4
  Summary: Command-line interface for Palantir Foundry APIs
5
5
  Project-URL: Homepage, https://github.com/anjor/pltr-cli
6
6
  Project-URL: Repository, https://github.com/anjor/pltr-cli
@@ -37,7 +37,7 @@ Description-Content-Type: text/markdown
37
37
 
38
38
  # pltr-cli
39
39
 
40
- A comprehensive command-line interface for Palantir Foundry APIs, providing 65+ commands for data analysis, ontology operations, SQL queries, and administrative tasks.
40
+ A comprehensive command-line interface for Palantir Foundry APIs, providing 70+ commands for data analysis, ontology operations, SQL queries, folder management, and administrative tasks.
41
41
 
42
42
  ## Overview
43
43
 
@@ -47,6 +47,7 @@ A comprehensive command-line interface for Palantir Foundry APIs, providing 65+
47
47
 
48
48
  - 🔐 **Secure Authentication**: Token and OAuth2 support with encrypted credential storage
49
49
  - 📊 **Dataset Operations**: Get dataset information and create new datasets (RID-based API)
50
+ - 📁 **Folder Management**: Create, explore, and manage Foundry filesystem structure
50
51
  - 🎯 **Comprehensive Ontology Access**: 13 commands for objects, actions, and queries
51
52
  - 📝 **Full SQL Support**: Execute, submit, monitor, and export query results
52
53
  - 👥 **Admin Operations**: User, group, role, and organization management (16 commands)
@@ -109,6 +110,12 @@ pltr admin user current
109
110
  # List available ontologies
110
111
  pltr ontology list
111
112
 
113
+ # Create a new folder
114
+ pltr folder create "My Project"
115
+
116
+ # List root folder contents
117
+ pltr folder list ri.compass.main.folder.0
118
+
112
119
  # Execute a simple SQL query
113
120
  pltr sql execute "SELECT 1 as test"
114
121
 
@@ -133,7 +140,7 @@ pltr-cli provides comprehensive documentation to help you get the most out of th
133
140
  ### 📖 User Guides
134
141
  - **[Quick Start Guide](docs/user-guide/quick-start.md)** - Get up and running in 5 minutes
135
142
  - **[Authentication Setup](docs/user-guide/authentication.md)** - Complete guide to token and OAuth2 setup
136
- - **[Command Reference](docs/user-guide/commands.md)** - Complete reference for all 65+ commands
143
+ - **[Command Reference](docs/user-guide/commands.md)** - Complete reference for all 70+ commands
137
144
  - **[Common Workflows](docs/user-guide/workflows.md)** - Real-world data analysis patterns
138
145
  - **[Troubleshooting](docs/user-guide/troubleshooting.md)** - Solutions to common issues
139
146
 
@@ -1,6 +1,6 @@
1
1
  # pltr-cli
2
2
 
3
- A comprehensive command-line interface for Palantir Foundry APIs, providing 65+ commands for data analysis, ontology operations, SQL queries, and administrative tasks.
3
+ A comprehensive command-line interface for Palantir Foundry APIs, providing 70+ commands for data analysis, ontology operations, SQL queries, folder management, and administrative tasks.
4
4
 
5
5
  ## Overview
6
6
 
@@ -10,6 +10,7 @@ A comprehensive command-line interface for Palantir Foundry APIs, providing 65+
10
10
 
11
11
  - 🔐 **Secure Authentication**: Token and OAuth2 support with encrypted credential storage
12
12
  - 📊 **Dataset Operations**: Get dataset information and create new datasets (RID-based API)
13
+ - 📁 **Folder Management**: Create, explore, and manage Foundry filesystem structure
13
14
  - 🎯 **Comprehensive Ontology Access**: 13 commands for objects, actions, and queries
14
15
  - 📝 **Full SQL Support**: Execute, submit, monitor, and export query results
15
16
  - 👥 **Admin Operations**: User, group, role, and organization management (16 commands)
@@ -72,6 +73,12 @@ pltr admin user current
72
73
  # List available ontologies
73
74
  pltr ontology list
74
75
 
76
+ # Create a new folder
77
+ pltr folder create "My Project"
78
+
79
+ # List root folder contents
80
+ pltr folder list ri.compass.main.folder.0
81
+
75
82
  # Execute a simple SQL query
76
83
  pltr sql execute "SELECT 1 as test"
77
84
 
@@ -96,7 +103,7 @@ pltr-cli provides comprehensive documentation to help you get the most out of th
96
103
  ### 📖 User Guides
97
104
  - **[Quick Start Guide](docs/user-guide/quick-start.md)** - Get up and running in 5 minutes
98
105
  - **[Authentication Setup](docs/user-guide/authentication.md)** - Complete guide to token and OAuth2 setup
99
- - **[Command Reference](docs/user-guide/commands.md)** - Complete reference for all 65+ commands
106
+ - **[Command Reference](docs/user-guide/commands.md)** - Complete reference for all 70+ commands
100
107
  - **[Common Workflows](docs/user-guide/workflows.md)** - Real-world data analysis patterns
101
108
  - **[Troubleshooting](docs/user-guide/troubleshooting.md)** - Solutions to common issues
102
109
 
@@ -0,0 +1,3 @@
1
+ description,display_name,name,rid,type
2
+ A child folder,Child Folder,,ri.compass.main.folder.child-folder,folder
3
+ ,Child Dataset,Child Dataset,ri.foundry.main.dataset.child-dataset,dataset
@@ -8,6 +8,7 @@ Welcome to the pltr-cli documentation! This CLI tool provides a command-line int
8
8
  - **[Quick Start Guide](user-guide/quick-start.md)** - Get up and running in minutes
9
9
  - **[Authentication Setup](user-guide/authentication.md)** - Configure token and OAuth2 authentication
10
10
  - **[Command Reference](user-guide/commands.md)** - Complete reference for all 50+ commands
11
+ - **[Command Aliases](user-guide/aliases.md)** - Create shortcuts for frequently used commands
11
12
  - **[Common Workflows](user-guide/workflows.md)** - Real-world data analysis patterns
12
13
  - **[Troubleshooting](user-guide/troubleshooting.md)** - Common issues and solutions
13
14
 
@@ -0,0 +1,257 @@
1
+ # Command Aliases
2
+
3
+ Command aliases allow you to create shortcuts for frequently used commands, improving your productivity when working with pltr-cli.
4
+
5
+ ## Overview
6
+
7
+ Aliases are custom shortcuts that expand to full commands. They help you:
8
+ - Save time by reducing typing for common operations
9
+ - Create personalized workflows
10
+ - Simplify complex command sequences
11
+ - Build reusable command templates
12
+
13
+ ## Creating Aliases
14
+
15
+ ### Basic Alias
16
+
17
+ Create a simple alias with the `add` command:
18
+
19
+ ```bash
20
+ # Create an alias 'ds' for 'dataset get'
21
+ pltr alias add ds "dataset get"
22
+
23
+ # Now you can use:
24
+ pltr ds ri.foundry.main.dataset.123
25
+ # Instead of:
26
+ pltr dataset get ri.foundry.main.dataset.123
27
+ ```
28
+
29
+ ### Complex Aliases
30
+
31
+ Aliases can include options and arguments:
32
+
33
+ ```bash
34
+ # Create an alias for SQL queries with JSON output
35
+ pltr alias add jsonsql "sql execute --format json"
36
+
37
+ # Usage:
38
+ pltr jsonsql "SELECT * FROM table LIMIT 10"
39
+ ```
40
+
41
+ ### Overwriting Existing Aliases
42
+
43
+ Use the `--force` flag to overwrite an existing alias:
44
+
45
+ ```bash
46
+ pltr alias add ds "dataset list" --force
47
+ ```
48
+
49
+ ## Managing Aliases
50
+
51
+ ### List All Aliases
52
+
53
+ View all configured aliases:
54
+
55
+ ```bash
56
+ pltr alias list
57
+ ```
58
+
59
+ Output:
60
+ ```
61
+ ┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
62
+ ┃ Alias ┃ Command ┃
63
+ ┡━━━━━━━━━┩━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
64
+ │ ds │ dataset get │
65
+ │ jsonsql │ sql execute --format json │
66
+ │ onto │ ontology object-list │
67
+ └─────────┴─────────────────────────────┘
68
+ ```
69
+
70
+ ### Show Specific Alias
71
+
72
+ Display details of a single alias:
73
+
74
+ ```bash
75
+ pltr alias show ds
76
+ # Output: ds → dataset get
77
+ ```
78
+
79
+ ### Edit an Alias
80
+
81
+ Modify an existing alias:
82
+
83
+ ```bash
84
+ pltr alias edit ds "dataset create"
85
+ ```
86
+
87
+ ### Remove an Alias
88
+
89
+ Delete an alias you no longer need:
90
+
91
+ ```bash
92
+ pltr alias remove ds
93
+ # Or skip confirmation:
94
+ pltr alias remove ds --no-confirm
95
+ ```
96
+
97
+ ### Clear All Aliases
98
+
99
+ Remove all aliases at once:
100
+
101
+ ```bash
102
+ pltr alias clear
103
+ # Or skip confirmation:
104
+ pltr alias clear --no-confirm
105
+ ```
106
+
107
+ ## Advanced Features
108
+
109
+ ### Resolve Aliases
110
+
111
+ See what command an alias expands to:
112
+
113
+ ```bash
114
+ pltr alias resolve ds
115
+ # Output: ds → dataset get
116
+ ```
117
+
118
+ ### Export and Import
119
+
120
+ Export aliases to share with teammates or backup:
121
+
122
+ ```bash
123
+ # Export to file
124
+ pltr alias export --output my-aliases.json
125
+
126
+ # Export to stdout
127
+ pltr alias export
128
+ ```
129
+
130
+ Import aliases from a file:
131
+
132
+ ```bash
133
+ # Replace existing aliases
134
+ pltr alias import aliases.json
135
+
136
+ # Merge with existing aliases
137
+ pltr alias import aliases.json --merge
138
+ ```
139
+
140
+ ### Nested Aliases
141
+
142
+ Aliases can reference other aliases:
143
+
144
+ ```bash
145
+ pltr alias add d "dataset"
146
+ pltr alias add dg "d get"
147
+ # 'dg' expands to 'dataset get'
148
+ ```
149
+
150
+ ## Common Alias Examples
151
+
152
+ Here are some useful aliases to get you started:
153
+
154
+ ```bash
155
+ # Dataset operations
156
+ pltr alias add dsg "dataset get"
157
+ pltr alias add dsc "dataset create"
158
+
159
+ # SQL shortcuts
160
+ pltr alias add sq "sql execute"
161
+ pltr alias add sqj "sql execute --format json"
162
+ pltr alias add sqc "sql execute --format csv"
163
+ pltr alias add sqx "sql export"
164
+
165
+ # Ontology shortcuts
166
+ pltr alias add ol "ontology list"
167
+ pltr alias add oo "ontology object-list"
168
+ pltr alias add oget "ontology object-get"
169
+
170
+ # Admin shortcuts
171
+ pltr alias add ul "admin user list"
172
+ pltr alias add uc "admin user current"
173
+ pltr alias add gl "admin group list"
174
+
175
+ # Combined operations
176
+ pltr alias add quicksql "sql execute --format table --limit 100"
177
+ pltr alias add mydata "dataset get ri.foundry.main.dataset.my-favorite-dataset"
178
+ ```
179
+
180
+ ## Shell Integration
181
+
182
+ Aliases work seamlessly with shell completion and interactive mode:
183
+
184
+ ### Tab Completion
185
+
186
+ After installing shell completions, alias names are available for tab completion:
187
+
188
+ ```bash
189
+ pltr d<TAB>
190
+ # Shows: ds, dsc, dsg
191
+ ```
192
+
193
+ ### Interactive Shell
194
+
195
+ Aliases are available in the interactive shell:
196
+
197
+ ```bash
198
+ pltr shell
199
+ pltr> ds ri.foundry.main.dataset.123
200
+ # Expands to: dataset get ri.foundry.main.dataset.123
201
+ ```
202
+
203
+ ## Best Practices
204
+
205
+ 1. **Use meaningful names**: Choose alias names that are easy to remember
206
+ 2. **Keep it simple**: Avoid overly complex aliases that are hard to understand
207
+ 3. **Document your aliases**: Export and share team-standard aliases
208
+ 4. **Avoid conflicts**: Don't use names that conflict with existing commands
209
+ 5. **Test before sharing**: Verify aliases work correctly before distribution
210
+
211
+ ## Limitations
212
+
213
+ - Aliases cannot use reserved command names (configure, verify, dataset, etc.)
214
+ - Circular references are not allowed and will be detected
215
+ - Aliases are expanded only once (no recursive expansion)
216
+ - Maximum alias chain depth is 10 to prevent infinite loops
217
+
218
+ ## Configuration Storage
219
+
220
+ Aliases are stored in `~/.config/pltr/aliases.json` and persist across sessions. The file uses standard JSON format and can be manually edited if needed.
221
+
222
+ ## Troubleshooting
223
+
224
+ ### Alias Not Working
225
+
226
+ 1. Check if the alias exists:
227
+ ```bash
228
+ pltr alias show myalias
229
+ ```
230
+
231
+ 2. Verify the alias syntax:
232
+ ```bash
233
+ pltr alias resolve myalias
234
+ ```
235
+
236
+ 3. Test the expanded command directly:
237
+ ```bash
238
+ pltr <expanded command>
239
+ ```
240
+
241
+ ### Circular Reference Error
242
+
243
+ If you see a circular reference error, check your alias chain:
244
+
245
+ ```bash
246
+ # Example of circular reference (not allowed):
247
+ pltr alias add a "b"
248
+ pltr alias add b "a" # Error: would create circular reference
249
+ ```
250
+
251
+ ### Import Errors
252
+
253
+ When importing fails, check:
254
+ - File exists and is readable
255
+ - JSON format is valid
256
+ - No circular references in imported aliases
257
+ - No conflicts with reserved command names
@@ -1,6 +1,6 @@
1
1
  # Command Reference
2
2
 
3
- Complete reference for all pltr-cli commands. The CLI provides 65+ commands across 8 major command groups for comprehensive Foundry API access.
3
+ Complete reference for all pltr-cli commands. The CLI provides 70+ commands across 9 major command groups for comprehensive Foundry API access.
4
4
 
5
5
  ## Global Options
6
6
 
@@ -147,6 +147,101 @@ pltr dataset create "Analysis Results" --parent-folder ri.foundry.main.folder.xy
147
147
 
148
148
  ---
149
149
 
150
+ ## 📁 Folder Commands
151
+
152
+ Folder operations for managing the Foundry filesystem structure using the foundry-platform-sdk.
153
+
154
+ ### `pltr folder create [OPTIONS] NAME`
155
+ Create a new folder in Foundry.
156
+
157
+ **Arguments:**
158
+ - `NAME` (required): Folder display name
159
+
160
+ **Options:**
161
+ - `--parent-folder`, `-p` TEXT: Parent folder RID [default: ri.compass.main.folder.0 (root)]
162
+ - `--profile` TEXT: Profile name
163
+ - `--format`, `-f` TEXT: Output format (table, json, csv) [default: table]
164
+
165
+ **Examples:**
166
+ ```bash
167
+ # Create folder in root
168
+ pltr folder create "My Project"
169
+
170
+ # Create folder in specific parent
171
+ pltr folder create "Sub Folder" --parent-folder ri.compass.main.folder.xyz123
172
+
173
+ # Create with JSON output
174
+ pltr folder create "Analysis" --format json
175
+ ```
176
+
177
+ ### `pltr folder get [OPTIONS] FOLDER_RID`
178
+ Get detailed information about a specific folder.
179
+
180
+ **Arguments:**
181
+ - `FOLDER_RID` (required): Folder Resource Identifier
182
+
183
+ **Options:**
184
+ - `--profile` TEXT: Profile name
185
+ - `--format`, `-f` TEXT: Output format (table, json, csv) [default: table]
186
+ - `--output`, `-o` TEXT: Output file path
187
+
188
+ **Examples:**
189
+ ```bash
190
+ # Get folder info
191
+ pltr folder get ri.compass.main.folder.abc123
192
+
193
+ # Export as JSON
194
+ pltr folder get ri.compass.main.folder.abc123 --format json --output folder-info.json
195
+ ```
196
+
197
+ ### `pltr folder list [OPTIONS] FOLDER_RID`
198
+ List all child resources of a folder.
199
+
200
+ **Arguments:**
201
+ - `FOLDER_RID` (required): Folder Resource Identifier (use 'ri.compass.main.folder.0' for root)
202
+
203
+ **Options:**
204
+ - `--profile` TEXT: Profile name
205
+ - `--format`, `-f` TEXT: Output format (table, json, csv) [default: table]
206
+ - `--output`, `-o` TEXT: Output file path
207
+ - `--page-size` INTEGER: Number of items per page
208
+
209
+ **Examples:**
210
+ ```bash
211
+ # List root folder contents
212
+ pltr folder list ri.compass.main.folder.0
213
+
214
+ # List with pagination
215
+ pltr folder list ri.compass.main.folder.abc123 --page-size 50
216
+
217
+ # Export children list
218
+ pltr folder list ri.compass.main.folder.abc123 --format csv --output children.csv
219
+ ```
220
+
221
+ ### `pltr folder batch-get [OPTIONS] FOLDER_RIDS...`
222
+ Get multiple folders in a single request (max 1000).
223
+
224
+ **Arguments:**
225
+ - `FOLDER_RIDS...` (required): Space-separated list of folder Resource Identifiers
226
+
227
+ **Options:**
228
+ - `--profile` TEXT: Profile name
229
+ - `--format`, `-f` TEXT: Output format (table, json, csv) [default: table]
230
+ - `--output`, `-o` TEXT: Output file path
231
+
232
+ **Examples:**
233
+ ```bash
234
+ # Get multiple folders
235
+ pltr folder batch-get ri.compass.main.folder.abc123 ri.compass.main.folder.def456
236
+
237
+ # Export batch results
238
+ pltr folder batch-get ri.compass.main.folder.abc123 ri.compass.main.folder.def456 --format json --output folders.json
239
+ ```
240
+
241
+ **Root Folder RID**: `ri.compass.main.folder.0` - Use this as the parent folder RID to create folders in the root directory.
242
+
243
+ ---
244
+
150
245
  ## 🎯 Ontology Commands
151
246
 
152
247
  Comprehensive ontology operations for interacting with Foundry ontologies.
@@ -584,6 +679,11 @@ pltr sql execute "SELECT * FROM table" # Run SQL query
584
679
  pltr ontology list # List ontologies
585
680
  pltr dataset get <rid> # Get dataset info
586
681
 
682
+ # Folder Management
683
+ pltr folder create "My Folder" # Create folder
684
+ pltr folder list ri.compass.main.folder.0 # List root contents
685
+ pltr folder get <folder-rid> # Get folder info
686
+
587
687
  # Admin
588
688
  pltr admin user current # Current user info
589
689
  pltr admin user list # List users
@@ -39,7 +39,7 @@ pltr-cli needs to authenticate with your Foundry instance. You have two options:
39
39
  If you have a Foundry API token:
40
40
 
41
41
  ```bash
42
- pltr configure
42
+ pltr configure configure
43
43
  ```
44
44
 
45
45
  Follow the prompts to enter:
@@ -0,0 +1,9 @@
1
+ {
2
+ "rid": "ri.compass.main.folder.test-folder",
3
+ "display_name": "Test Folder",
4
+ "description": "Test folder description",
5
+ "parent_folder_rid": "ri.compass.main.folder.parent",
6
+ "created": "2024-01-01T00:00:00Z",
7
+ "modified": "2024-01-02T00:00:00Z",
8
+ "type": "folder"
9
+ }
@@ -0,0 +1,11 @@
1
+ [
2
+ {
3
+ "rid": "ri.compass.main.folder.test-folder",
4
+ "display_name": "Test Folder",
5
+ "description": "Test folder description",
6
+ "parent_folder_rid": "ri.compass.main.folder.parent",
7
+ "created": "2024-01-01T00:00:00Z",
8
+ "modified": "2024-01-02T00:00:00Z",
9
+ "type": "folder"
10
+ }
11
+ ]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pltr-cli"
3
- version = "0.2.0"
3
+ version = "0.4.0"
4
4
  description = "Command-line interface for Palantir Foundry APIs"
5
5
  authors = [
6
6
  { name = "anjor", email = "anjor@umd.edu" }
@@ -23,6 +23,9 @@ if "_PLTR_COMPLETE" in os.environ:
23
23
 
24
24
  # Normal CLI execution
25
25
  from pltr.cli import app
26
+ from pltr.utils.alias_resolver import inject_alias_resolution
26
27
 
27
28
  if __name__ == "__main__":
29
+ # Resolve aliases before running the app
30
+ inject_alias_resolution()
28
31
  app()
@@ -10,11 +10,13 @@ from pltr.commands import (
10
10
  configure,
11
11
  verify,
12
12
  dataset,
13
+ folder,
13
14
  ontology,
14
15
  sql,
15
16
  admin,
16
17
  shell,
17
18
  completion,
19
+ alias,
18
20
  )
19
21
 
20
22
  app = typer.Typer(
@@ -27,6 +29,7 @@ app = typer.Typer(
27
29
  app.add_typer(configure.app, name="configure", help="Manage authentication profiles")
28
30
  app.add_typer(verify.app, name="verify", help="Verify authentication")
29
31
  app.add_typer(dataset.app, name="dataset", help="Manage datasets")
32
+ app.add_typer(folder.app, name="folder", help="Manage folders")
30
33
  app.add_typer(ontology.app, name="ontology", help="Ontology operations")
31
34
  app.add_typer(sql.app, name="sql", help="Execute SQL queries")
32
35
  app.add_typer(
@@ -36,6 +39,7 @@ app.add_typer(
36
39
  )
37
40
  app.add_typer(shell.shell_app, name="shell", help="Interactive shell mode")
38
41
  app.add_typer(completion.app, name="completion", help="Manage shell completions")
42
+ app.add_typer(alias.app, name="alias", help="Manage command aliases")
39
43
 
40
44
 
41
45
  def version_callback(value: bool):