pltr-cli 0.1.2__tar.gz → 0.3.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.
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/.github/workflows/ci.yml +3 -2
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/.github/workflows/publish.yml +3 -3
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/.github/workflows/test-publish.yml +9 -8
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/.gitignore +1 -1
- pltr_cli-0.3.0/.pre-commit-config.yaml +109 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/CLAUDE.md +6 -6
- pltr_cli-0.3.0/PKG-INFO +280 -0
- pltr_cli-0.3.0/README.md +243 -0
- pltr_cli-0.3.0/docs/README.md +52 -0
- pltr_cli-0.3.0/docs/api/wrapper.md +625 -0
- pltr_cli-0.3.0/docs/examples/gallery.md +688 -0
- pltr_cli-0.3.0/docs/user-guide/aliases.md +257 -0
- pltr_cli-0.3.0/docs/user-guide/authentication.md +403 -0
- pltr_cli-0.3.0/docs/user-guide/commands.md +614 -0
- pltr_cli-0.3.0/docs/user-guide/quick-start.md +178 -0
- pltr_cli-0.3.0/docs/user-guide/troubleshooting.md +514 -0
- pltr_cli-0.3.0/docs/user-guide/workflows.md +522 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/mypy.ini +1 -1
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/pyproject.toml +5 -1
- pltr_cli-0.3.0/src/pltr/__main__.py +31 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/cli.py +21 -1
- pltr_cli-0.3.0/src/pltr/commands/admin.py +530 -0
- pltr_cli-0.3.0/src/pltr/commands/alias.py +241 -0
- pltr_cli-0.3.0/src/pltr/commands/completion.py +383 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/commands/dataset.py +20 -3
- pltr_cli-0.3.0/src/pltr/commands/ontology.py +502 -0
- pltr_cli-0.3.0/src/pltr/commands/shell.py +126 -0
- pltr_cli-0.3.0/src/pltr/commands/sql.py +358 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/commands/verify.py +2 -1
- pltr_cli-0.3.0/src/pltr/config/aliases.py +254 -0
- pltr_cli-0.3.0/src/pltr/services/__init__.py +5 -0
- pltr_cli-0.3.0/src/pltr/services/admin.py +314 -0
- pltr_cli-0.3.0/src/pltr/services/ontology.py +442 -0
- pltr_cli-0.3.0/src/pltr/services/sql.py +340 -0
- pltr_cli-0.3.0/src/pltr/utils/alias_resolver.py +56 -0
- pltr_cli-0.3.0/src/pltr/utils/completion.py +178 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/utils/formatting.py +208 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/utils/progress.py +1 -1
- pltr_cli-0.3.0/tests/integration/README.md +45 -0
- pltr_cli-0.3.0/tests/integration/__init__.py +1 -0
- pltr_cli-0.3.0/tests/integration/conftest.py +23 -0
- pltr_cli-0.3.0/tests/integration/test_auth_flow.py +397 -0
- pltr_cli-0.3.0/tests/integration/test_cli_integration.py +397 -0
- pltr_cli-0.3.0/tests/integration/test_data_workflows.py +224 -0
- pltr_cli-0.3.0/tests/integration/test_data_workflows_simple.py +89 -0
- pltr_cli-0.3.0/tests/integration/test_simple_integration.py +53 -0
- pltr_cli-0.3.0/tests/test_commands/test_admin.py +468 -0
- pltr_cli-0.3.0/tests/test_commands/test_alias.py +225 -0
- pltr_cli-0.3.0/tests/test_commands/test_completion.py +259 -0
- pltr_cli-0.3.0/tests/test_commands/test_ontology.py +404 -0
- pltr_cli-0.3.0/tests/test_commands/test_shell.py +183 -0
- pltr_cli-0.3.0/tests/test_commands/test_sql.py +471 -0
- pltr_cli-0.3.0/tests/test_config/test_aliases.py +220 -0
- pltr_cli-0.3.0/tests/test_services/test_admin.py +414 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_services/test_base.py +9 -9
- pltr_cli-0.3.0/tests/test_services/test_ontology.py +433 -0
- pltr_cli-0.3.0/tests/test_services/test_sql.py +349 -0
- pltr_cli-0.3.0/tests/test_utils/__init__.py +1 -0
- pltr_cli-0.3.0/tests/test_utils/test_alias_resolver.py +174 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/uv.lock +250 -1
- pltr_cli-0.1.2/DEVELOPMENT_PLAN.md +0 -381
- pltr_cli-0.1.2/PKG-INFO +0 -203
- pltr_cli-0.1.2/README.md +0 -167
- pltr_cli-0.1.2/src/pltr/services/__init__.py +0 -1
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/LICENSE +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/scripts/release.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/auth/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/auth/base.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/auth/manager.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/auth/oauth.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/auth/storage.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/auth/token.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/commands/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/commands/configure.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/config/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/config/profiles.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/config/settings.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/services/base.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/services/dataset.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/services/dataset_full.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/services/dataset_v2.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/src/pltr/utils/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/conftest.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_auth/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_auth/test_base.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_auth/test_manager.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_auth/test_oauth.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_auth/test_storage.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_auth/test_token.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_commands/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_commands/test_dataset.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_commands/test_verify_simple.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_config/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_config/test_profiles.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_config/test_settings.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_services/__init__.py +0 -0
- {pltr_cli-0.1.2 → pltr_cli-0.3.0}/tests/test_services/test_dataset.py +0 -0
|
@@ -41,7 +41,8 @@ jobs:
|
|
|
41
41
|
|
|
42
42
|
- name: Run tests with coverage
|
|
43
43
|
run: |
|
|
44
|
-
|
|
44
|
+
# Run all tests including integration tests (import issues fixed)
|
|
45
|
+
uv run pytest tests/ --cov=pltr --cov-report=xml --cov-report=term
|
|
45
46
|
|
|
46
47
|
- name: Upload coverage to Codecov
|
|
47
48
|
uses: codecov/codecov-action@v4
|
|
@@ -77,4 +78,4 @@ jobs:
|
|
|
77
78
|
- name: Run security checks (if configured)
|
|
78
79
|
run: |
|
|
79
80
|
# Add security scanning tools here if needed
|
|
80
|
-
echo "Security checks placeholder - add tools like bandit, safety, etc."
|
|
81
|
+
echo "Security checks placeholder - add tools like bandit, safety, etc."
|
|
@@ -62,7 +62,7 @@ jobs:
|
|
|
62
62
|
if: startsWith(github.ref, 'refs/tags/')
|
|
63
63
|
needs: build
|
|
64
64
|
runs-on: ubuntu-latest
|
|
65
|
-
environment:
|
|
65
|
+
environment:
|
|
66
66
|
name: pypi
|
|
67
67
|
url: https://pypi.org/project/pltr-cli/
|
|
68
68
|
permissions:
|
|
@@ -90,7 +90,7 @@ jobs:
|
|
|
90
90
|
steps:
|
|
91
91
|
- name: Checkout code
|
|
92
92
|
uses: actions/checkout@v4
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
- name: Download distribution artifacts
|
|
95
95
|
uses: actions/download-artifact@v4
|
|
96
96
|
with:
|
|
@@ -126,4 +126,4 @@ jobs:
|
|
|
126
126
|
body: ${{ steps.changelog.outputs.CHANGELOG }}
|
|
127
127
|
draft: false
|
|
128
128
|
prerelease: false
|
|
129
|
-
generate_release_notes: true
|
|
129
|
+
generate_release_notes: true
|
|
@@ -20,7 +20,7 @@ jobs:
|
|
|
20
20
|
test-build:
|
|
21
21
|
name: Test build and publish to TestPyPI
|
|
22
22
|
runs-on: ubuntu-latest
|
|
23
|
-
environment:
|
|
23
|
+
environment:
|
|
24
24
|
name: testpypi
|
|
25
25
|
url: https://test.pypi.org/project/pltr/
|
|
26
26
|
permissions:
|
|
@@ -46,7 +46,8 @@ jobs:
|
|
|
46
46
|
|
|
47
47
|
- name: Run tests
|
|
48
48
|
run: |
|
|
49
|
-
|
|
49
|
+
# Run all tests including integration tests (import issues fixed)
|
|
50
|
+
uv run pytest tests/ --cov=pltr --cov-report=xml --cov-report=term
|
|
50
51
|
|
|
51
52
|
- name: Run linting
|
|
52
53
|
run: |
|
|
@@ -85,12 +86,12 @@ jobs:
|
|
|
85
86
|
# Create a temporary pyproject.toml with test version
|
|
86
87
|
uv run python -c "
|
|
87
88
|
import tomllib, tomli_w
|
|
88
|
-
|
|
89
|
+
|
|
89
90
|
with open('pyproject.toml', 'rb') as f:
|
|
90
91
|
config = tomllib.load(f)
|
|
91
|
-
|
|
92
|
+
|
|
92
93
|
config['project']['version'] = '${{ steps.test_version.outputs.TEST_VERSION }}'
|
|
93
|
-
|
|
94
|
+
|
|
94
95
|
with open('pyproject.toml', 'wb') as f:
|
|
95
96
|
tomli_w.dump(config, f)
|
|
96
97
|
"
|
|
@@ -118,12 +119,12 @@ jobs:
|
|
|
118
119
|
run: |
|
|
119
120
|
# Wait a moment for TestPyPI to process the upload
|
|
120
121
|
sleep 30
|
|
121
|
-
|
|
122
|
+
|
|
122
123
|
# Try to install the package from TestPyPI
|
|
123
124
|
uv run pip install --index-url https://test.pypi.org/simple/ \
|
|
124
125
|
--extra-index-url https://pypi.org/simple/ \
|
|
125
126
|
pltr-cli==${{ steps.test_version.outputs.TEST_VERSION }}
|
|
126
|
-
|
|
127
|
+
|
|
127
128
|
# Test basic import and CLI functionality
|
|
128
129
|
uv run python -c "import pltr; print('Package import successful')"
|
|
129
130
|
uv run pltr --help
|
|
@@ -138,4 +139,4 @@ jobs:
|
|
|
138
139
|
echo "- **Status**: ✅ Successfully published and tested" >> $GITHUB_STEP_SUMMARY
|
|
139
140
|
else
|
|
140
141
|
echo "- **Status**: ❌ Test failed" >> $GITHUB_STEP_SUMMARY
|
|
141
|
-
fi
|
|
142
|
+
fi
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Pre-commit hooks for pltr-cli
|
|
2
|
+
# See https://pre-commit.com for more information
|
|
3
|
+
|
|
4
|
+
repos:
|
|
5
|
+
# General file fixes
|
|
6
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
7
|
+
rev: v4.5.0
|
|
8
|
+
hooks:
|
|
9
|
+
- id: trailing-whitespace
|
|
10
|
+
name: Fix trailing whitespace
|
|
11
|
+
description: Removes trailing whitespace
|
|
12
|
+
- id: end-of-file-fixer
|
|
13
|
+
name: Fix end of files
|
|
14
|
+
description: Ensures files end with a newline
|
|
15
|
+
- id: check-yaml
|
|
16
|
+
name: Check YAML files
|
|
17
|
+
description: Validates YAML file syntax
|
|
18
|
+
- id: check-added-large-files
|
|
19
|
+
name: Check for large files
|
|
20
|
+
description: Prevents large files from being committed
|
|
21
|
+
args: ['--maxkb=1000']
|
|
22
|
+
- id: check-toml
|
|
23
|
+
name: Check TOML files
|
|
24
|
+
description: Validates TOML file syntax
|
|
25
|
+
- id: check-json
|
|
26
|
+
name: Check JSON files
|
|
27
|
+
description: Validates JSON file syntax
|
|
28
|
+
- id: check-merge-conflict
|
|
29
|
+
name: Check merge conflicts
|
|
30
|
+
description: Checks for merge conflict markers
|
|
31
|
+
- id: check-ast
|
|
32
|
+
name: Check Python syntax
|
|
33
|
+
description: Validates Python file syntax
|
|
34
|
+
- id: debug-statements
|
|
35
|
+
name: Check for debug statements
|
|
36
|
+
description: Checks for Python debug statements
|
|
37
|
+
- id: mixed-line-ending
|
|
38
|
+
name: Fix mixed line endings
|
|
39
|
+
description: Checks for mixed line ending
|
|
40
|
+
args: ['--fix=lf']
|
|
41
|
+
|
|
42
|
+
# Python code formatting with Ruff
|
|
43
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
44
|
+
rev: v0.1.9
|
|
45
|
+
hooks:
|
|
46
|
+
- id: ruff
|
|
47
|
+
name: Ruff linter
|
|
48
|
+
description: Fast Python linter
|
|
49
|
+
args: [--fix]
|
|
50
|
+
- id: ruff-format
|
|
51
|
+
name: Ruff formatter
|
|
52
|
+
description: Fast Python formatter
|
|
53
|
+
|
|
54
|
+
# Type checking with mypy
|
|
55
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
56
|
+
rev: v1.8.0
|
|
57
|
+
hooks:
|
|
58
|
+
- id: mypy
|
|
59
|
+
name: mypy type checker
|
|
60
|
+
description: Static type checker for Python
|
|
61
|
+
additional_dependencies:
|
|
62
|
+
- types-requests
|
|
63
|
+
- types-setuptools
|
|
64
|
+
args: [--ignore-missing-imports, --no-strict-optional, --explicit-package-bases]
|
|
65
|
+
files: ^src/
|
|
66
|
+
|
|
67
|
+
# Security checks
|
|
68
|
+
- repo: https://github.com/PyCQA/bandit
|
|
69
|
+
rev: 1.7.6
|
|
70
|
+
hooks:
|
|
71
|
+
- id: bandit
|
|
72
|
+
name: Bandit security linter
|
|
73
|
+
description: Security linter for Python
|
|
74
|
+
args: ['-ll', '--skip', 'B101,B601']
|
|
75
|
+
files: ^src/
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# Configuration
|
|
79
|
+
default_language_version:
|
|
80
|
+
python: python3.9
|
|
81
|
+
|
|
82
|
+
# Run hooks on all files by default
|
|
83
|
+
default_install_hook_types: [pre-commit, pre-push]
|
|
84
|
+
|
|
85
|
+
# Exclude directories
|
|
86
|
+
exclude: |
|
|
87
|
+
(?x)^(
|
|
88
|
+
\.git/|
|
|
89
|
+
\.venv/|
|
|
90
|
+
venv/|
|
|
91
|
+
\.env/|
|
|
92
|
+
env/|
|
|
93
|
+
__pycache__/|
|
|
94
|
+
\.pytest_cache/|
|
|
95
|
+
\.mypy_cache/|
|
|
96
|
+
\.ruff_cache/|
|
|
97
|
+
build/|
|
|
98
|
+
dist/|
|
|
99
|
+
\.eggs/|
|
|
100
|
+
.*\.egg-info/|
|
|
101
|
+
uv\.lock
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# CI configuration
|
|
105
|
+
ci:
|
|
106
|
+
autofix_prs: true
|
|
107
|
+
autofix_commit_msg: '[pre-commit.ci] auto fixes from pre-commit hooks'
|
|
108
|
+
autoupdate_schedule: weekly
|
|
109
|
+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
## Dependency Management
|
|
2
|
-
|
|
3
|
-
Use uv for dependency management
|
|
4
|
-
|
|
5
|
-
|
|
6
1
|
## Development tips
|
|
7
2
|
|
|
8
|
-
Always keep @DEVELOPMENT_PLAN.md up to date
|
|
3
|
+
Always keep @DEVELOPMENT_PLAN.md up to date.
|
|
4
|
+
The basis of the SDK is https://github.com/palantir/foundry-platform-python . This is a
|
|
5
|
+
CLI that wraps around the SDK to give a CLI interface.
|
|
6
|
+
|
|
7
|
+
Use uv for dependency management.
|
|
8
|
+
Use uv to run python scripts.
|
|
9
9
|
|
|
10
10
|
## General Guidance
|
|
11
11
|
|
pltr_cli-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pltr-cli
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Command-line interface for Palantir Foundry APIs
|
|
5
|
+
Project-URL: Homepage, https://github.com/anjor/pltr-cli
|
|
6
|
+
Project-URL: Repository, https://github.com/anjor/pltr-cli
|
|
7
|
+
Project-URL: Issues, https://github.com/anjor/pltr-cli/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/anjor/pltr-cli/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Documentation, https://github.com/anjor/pltr-cli/blob/main/README.md
|
|
10
|
+
Author-email: anjor <anjor@umd.edu>
|
|
11
|
+
License: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: api,cli,data,foundry,ontology,palantir
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: System Administrators
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Classifier: Topic :: System :: Systems Administration
|
|
27
|
+
Classifier: Topic :: Utilities
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
|
+
Requires-Dist: click-repl>=0.3.0
|
|
30
|
+
Requires-Dist: foundry-platform-sdk>=1.27.0
|
|
31
|
+
Requires-Dist: keyring>=25.6.0
|
|
32
|
+
Requires-Dist: python-dotenv>=1.1.1
|
|
33
|
+
Requires-Dist: requests>=2.32.4
|
|
34
|
+
Requires-Dist: rich>=14.1.0
|
|
35
|
+
Requires-Dist: typer>=0.16.0
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# pltr-cli
|
|
39
|
+
|
|
40
|
+
A comprehensive command-line interface for Palantir Foundry APIs, providing 65+ commands for data analysis, ontology operations, SQL queries, and administrative tasks.
|
|
41
|
+
|
|
42
|
+
## Overview
|
|
43
|
+
|
|
44
|
+
`pltr-cli` provides a powerful and intuitive way to interact with Palantir Foundry from the command line. Built on top of the official `foundry-platform-sdk`, it offers comprehensive access to Foundry's capabilities with a focus on productivity and ease of use.
|
|
45
|
+
|
|
46
|
+
## ✨ Key Features
|
|
47
|
+
|
|
48
|
+
- 🔐 **Secure Authentication**: Token and OAuth2 support with encrypted credential storage
|
|
49
|
+
- 📊 **Dataset Operations**: Get dataset information and create new datasets (RID-based API)
|
|
50
|
+
- 🎯 **Comprehensive Ontology Access**: 13 commands for objects, actions, and queries
|
|
51
|
+
- 📝 **Full SQL Support**: Execute, submit, monitor, and export query results
|
|
52
|
+
- 👥 **Admin Operations**: User, group, role, and organization management (16 commands)
|
|
53
|
+
- 💻 **Interactive Shell**: REPL mode with tab completion and command history
|
|
54
|
+
- ⚡ **Shell Completion**: Auto-completion for bash, zsh, and fish
|
|
55
|
+
- 🎨 **Rich Output**: Beautiful terminal formatting with multiple export formats (table, JSON, CSV)
|
|
56
|
+
- 👤 **Multi-Profile Support**: Manage multiple Foundry environments seamlessly
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
### Using pip
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install pltr-cli
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### From source
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Clone the repository
|
|
70
|
+
git clone https://github.com/anjor/pltr-cli.git
|
|
71
|
+
cd pltr-cli
|
|
72
|
+
|
|
73
|
+
# Install with uv
|
|
74
|
+
uv sync
|
|
75
|
+
|
|
76
|
+
# Run the CLI
|
|
77
|
+
uv run pltr --help
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 🚀 Quick Start
|
|
81
|
+
|
|
82
|
+
### 1. Configure Authentication
|
|
83
|
+
|
|
84
|
+
Set up your Foundry credentials:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pltr configure configure
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Follow the interactive prompts to enter:
|
|
91
|
+
- Foundry hostname (e.g., `foundry.company.com`)
|
|
92
|
+
- Authentication method (token or OAuth2)
|
|
93
|
+
- Your credentials
|
|
94
|
+
|
|
95
|
+
### 2. Verify Connection
|
|
96
|
+
|
|
97
|
+
Test your setup:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pltr verify
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 3. Start Exploring
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Check current user
|
|
107
|
+
pltr admin user current
|
|
108
|
+
|
|
109
|
+
# List available ontologies
|
|
110
|
+
pltr ontology list
|
|
111
|
+
|
|
112
|
+
# Execute a simple SQL query
|
|
113
|
+
pltr sql execute "SELECT 1 as test"
|
|
114
|
+
|
|
115
|
+
# Start interactive mode for exploration
|
|
116
|
+
pltr shell
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 4. Enable Shell Completion
|
|
120
|
+
|
|
121
|
+
For the best experience:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
pltr completion install
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
📖 **Need more help?** See the **[Quick Start Guide](docs/user-guide/quick-start.md)** for detailed setup instructions.
|
|
128
|
+
|
|
129
|
+
## 📚 Documentation
|
|
130
|
+
|
|
131
|
+
pltr-cli provides comprehensive documentation to help you get the most out of the tool:
|
|
132
|
+
|
|
133
|
+
### 📖 User Guides
|
|
134
|
+
- **[Quick Start Guide](docs/user-guide/quick-start.md)** - Get up and running in 5 minutes
|
|
135
|
+
- **[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
|
|
137
|
+
- **[Common Workflows](docs/user-guide/workflows.md)** - Real-world data analysis patterns
|
|
138
|
+
- **[Troubleshooting](docs/user-guide/troubleshooting.md)** - Solutions to common issues
|
|
139
|
+
|
|
140
|
+
### 🔧 Developer Resources
|
|
141
|
+
- **[API Wrapper Documentation](docs/api/wrapper.md)** - Architecture and extension guide
|
|
142
|
+
- **[Examples Gallery](docs/examples/gallery.md)** - Real-world use cases and automation scripts
|
|
143
|
+
|
|
144
|
+
### 🎯 Quick Command Overview
|
|
145
|
+
|
|
146
|
+
**Most Common Commands:**
|
|
147
|
+
```bash
|
|
148
|
+
# Authentication & Setup
|
|
149
|
+
pltr configure configure # Set up authentication
|
|
150
|
+
pltr verify # Test connection
|
|
151
|
+
|
|
152
|
+
# Data Analysis
|
|
153
|
+
pltr sql execute "SELECT * FROM table" # Run SQL queries
|
|
154
|
+
pltr ontology list # List ontologies
|
|
155
|
+
pltr dataset get <rid> # Get dataset info
|
|
156
|
+
|
|
157
|
+
# Administrative
|
|
158
|
+
pltr admin user current # Current user info
|
|
159
|
+
pltr admin user list # List users
|
|
160
|
+
|
|
161
|
+
# Interactive & Tools
|
|
162
|
+
pltr shell # Interactive mode
|
|
163
|
+
pltr completion install # Enable tab completion
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
💡 **Tip**: Use `pltr --help` or `pltr <command> --help` for detailed command help.
|
|
167
|
+
|
|
168
|
+
For the complete command reference with examples, see **[Command Reference](docs/user-guide/commands.md)**.
|
|
169
|
+
|
|
170
|
+
## ⚙️ Configuration
|
|
171
|
+
|
|
172
|
+
pltr-cli stores configuration securely using industry best practices:
|
|
173
|
+
|
|
174
|
+
- **Profile Configuration**: `~/.config/pltr/profiles.json`
|
|
175
|
+
- **Credentials**: Encrypted in system keyring (never stored in plain text)
|
|
176
|
+
- **Shell History**: `~/.config/pltr/repl_history` (for interactive mode)
|
|
177
|
+
|
|
178
|
+
### Environment Variables
|
|
179
|
+
|
|
180
|
+
For CI/CD and automation, use environment variables:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Token authentication
|
|
184
|
+
export FOUNDRY_TOKEN="your-api-token"
|
|
185
|
+
export FOUNDRY_HOST="foundry.company.com"
|
|
186
|
+
|
|
187
|
+
# OAuth2 authentication
|
|
188
|
+
export FOUNDRY_CLIENT_ID="your-client-id"
|
|
189
|
+
export FOUNDRY_CLIENT_SECRET="your-client-secret"
|
|
190
|
+
export FOUNDRY_HOST="foundry.company.com"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
See **[Authentication Setup](docs/user-guide/authentication.md)** for complete configuration options.
|
|
194
|
+
|
|
195
|
+
## 🔧 Development
|
|
196
|
+
|
|
197
|
+
### Prerequisites
|
|
198
|
+
|
|
199
|
+
- Python 3.9+
|
|
200
|
+
- [uv](https://github.com/astral-sh/uv) for dependency management
|
|
201
|
+
|
|
202
|
+
### Quick Development Setup
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Clone the repository
|
|
206
|
+
git clone https://github.com/anjor/pltr-cli.git
|
|
207
|
+
cd pltr-cli
|
|
208
|
+
|
|
209
|
+
# Install dependencies and development tools
|
|
210
|
+
uv sync
|
|
211
|
+
|
|
212
|
+
# Install pre-commit hooks
|
|
213
|
+
uv run pre-commit install
|
|
214
|
+
|
|
215
|
+
# Run tests
|
|
216
|
+
uv run pytest
|
|
217
|
+
|
|
218
|
+
# Run linting and formatting
|
|
219
|
+
uv run ruff check src/
|
|
220
|
+
uv run ruff format src/
|
|
221
|
+
uv run mypy src/
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Project Architecture
|
|
225
|
+
|
|
226
|
+
pltr-cli uses a layered architecture:
|
|
227
|
+
|
|
228
|
+
- **CLI Layer** (Typer): Command-line interface and argument parsing
|
|
229
|
+
- **Command Layer**: Command implementations with validation
|
|
230
|
+
- **Service Layer**: Business logic and foundry-platform-sdk integration
|
|
231
|
+
- **Auth Layer**: Secure authentication and credential management
|
|
232
|
+
- **Utils Layer**: Formatting, progress, and helper functions
|
|
233
|
+
|
|
234
|
+
See **[API Wrapper Documentation](docs/api/wrapper.md)** for detailed architecture information and extension guides.
|
|
235
|
+
|
|
236
|
+
## 📊 Current Status
|
|
237
|
+
|
|
238
|
+
pltr-cli is **production-ready** with comprehensive features:
|
|
239
|
+
|
|
240
|
+
- ✅ **65+ Commands** across 8 command groups
|
|
241
|
+
- ✅ **273 Unit Tests** with 67% code coverage
|
|
242
|
+
- ✅ **Published on PyPI** with automated releases
|
|
243
|
+
- ✅ **Cross-Platform** support (Windows, macOS, Linux)
|
|
244
|
+
- ✅ **Comprehensive Documentation** (Quick start, guides, examples)
|
|
245
|
+
- ✅ **Interactive Shell** with tab completion and history
|
|
246
|
+
- ✅ **CI/CD Ready** with environment variable support
|
|
247
|
+
|
|
248
|
+
**Latest Release**: Available on [PyPI](https://pypi.org/project/pltr-cli/)
|
|
249
|
+
|
|
250
|
+
## 🤝 Contributing
|
|
251
|
+
|
|
252
|
+
Contributions are welcome! Whether you're fixing bugs, adding features, or improving documentation.
|
|
253
|
+
|
|
254
|
+
### Getting Started
|
|
255
|
+
|
|
256
|
+
1. Fork the repository
|
|
257
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
258
|
+
3. Make your changes following the existing patterns
|
|
259
|
+
4. Add tests for new functionality
|
|
260
|
+
5. Run the test suite and linting
|
|
261
|
+
6. Commit using conventional commit format (`feat:`, `fix:`, `docs:`, etc.)
|
|
262
|
+
7. Push to your branch and create a Pull Request
|
|
263
|
+
|
|
264
|
+
### Development Guidelines
|
|
265
|
+
|
|
266
|
+
- Follow existing code patterns and architecture
|
|
267
|
+
- Add tests for new functionality
|
|
268
|
+
- Update documentation for user-facing changes
|
|
269
|
+
- Use type hints throughout
|
|
270
|
+
- Follow the existing error handling patterns
|
|
271
|
+
|
|
272
|
+
See **[API Wrapper Documentation](docs/api/wrapper.md)** for detailed development guidelines.
|
|
273
|
+
|
|
274
|
+
## License
|
|
275
|
+
|
|
276
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
277
|
+
|
|
278
|
+
## Acknowledgments
|
|
279
|
+
|
|
280
|
+
Built on top of the official [Palantir Foundry Platform Python SDK](https://github.com/palantir/foundry-platform-python).
|