|
1 | 1 | # opencode-palantir |
2 | 2 |
|
3 | | -OpenCode plugin that provides Palantir Foundry documentation to AI agents via local Parquet storage. |
| 3 | +OpenCode plugin that provides **Palantir Foundry documentation** to AI agents via a local Parquet |
| 4 | +database. |
4 | 5 |
|
5 | 6 | ## Features |
6 | 7 |
|
7 | 8 | - Fetches all ~3,600 pages from Palantir's public documentation |
8 | | -- Stores in local Parquet file for fast offline access (~17MB) |
| 9 | +- Stores in a local Parquet file for fast offline access (~17MB) |
9 | 10 | - Exposes `get_doc_page` and `list_all_docs` tools for AI agents |
10 | 11 |
|
11 | | -## Setup |
| 12 | +## Quick start (OpenCode users) |
| 13 | + |
| 14 | +### 1) Install the plugin |
| 15 | + |
| 16 | +In your project repo, add the plugin as a dependency inside `.opencode/` (keeps plugin deps separate |
| 17 | +from your app deps): |
| 18 | + |
| 19 | +```bash |
| 20 | +mkdir -p .opencode |
| 21 | + |
| 22 | +cat > .opencode/package.json <<'EOF' |
| 23 | +{ |
| 24 | + "dependencies": { |
| 25 | + "@openontology/opencode-palantir": "^0.1.1" |
| 26 | + } |
| 27 | +} |
| 28 | +EOF |
| 29 | + |
| 30 | +(cd .opencode && bun install) |
| 31 | +``` |
| 32 | + |
| 33 | +### 2) Load it as an OpenCode plugin |
| 34 | + |
| 35 | +Create a tiny wrapper file in `.opencode/plugins/`: |
| 36 | + |
| 37 | +```bash |
| 38 | +mkdir -p .opencode/plugins |
| 39 | + |
| 40 | +cat > .opencode/plugins/opencode-palantir.js <<'EOF' |
| 41 | +import plugin from '@openontology/opencode-palantir'; |
| 42 | +
|
| 43 | +export default plugin; |
| 44 | +EOF |
| 45 | +``` |
| 46 | + |
| 47 | +OpenCode automatically loads `.js`/`.ts` files from `.opencode/plugins/` at startup. |
| 48 | + |
| 49 | +> If your OpenCode setup uses an `opencode.json` / `opencode.jsonc` that restricts plugin loading, |
| 50 | +> make sure `.opencode/plugins/` (or the specific plugin file) is included. |
| 51 | +
|
| 52 | +### 3) Get `docs.parquet` |
| 53 | + |
| 54 | +This package does **not** ship with docs bundled. You have two options: |
| 55 | + |
| 56 | +#### Option A (recommended): fetch inside OpenCode |
| 57 | + |
| 58 | +In OpenCode, run: |
| 59 | + |
| 60 | +- `/refresh-docs` |
| 61 | + |
| 62 | +This downloads the docs and writes them to `data/docs.parquet` in your project root. |
| 63 | + |
| 64 | +#### Option B: download a prebuilt Parquet file |
| 65 | + |
| 66 | +Download `data/docs.parquet` from this GitHub repo and place it at: |
| 67 | + |
| 68 | +- `<your-project>/data/docs.parquet` |
| 69 | + |
| 70 | +## Using the tools |
| 71 | + |
| 72 | +When installed, this plugin exposes: |
| 73 | + |
| 74 | +- **`get_doc_page`** - Retrieve a specific doc page by URL |
| 75 | +- **`list_all_docs`** - List all available documentation pages |
| 76 | + |
| 77 | +If `data/docs.parquet` is missing, both tools will instruct you to run `/refresh-docs`. |
| 78 | + |
| 79 | +## Setup (this repo) |
12 | 80 |
|
13 | 81 | ```bash |
14 | 82 | bun install |
@@ -73,24 +141,20 @@ When installed as an OpenCode plugin, exposes: |
73 | 141 | - **`list_all_docs`** - List all available documentation pages |
74 | 142 | - **`/refresh-docs`** - Command hook to re-fetch all documentation |
75 | 143 |
|
76 | | -### Installing in OpenCode (this project only) |
| 144 | +### Installing in OpenCode (this repo only) |
77 | 145 |
|
78 | | -Create a tiny wrapper plugin file that re-exports the built artifact into the project-level auto-discovered plugins directory: |
| 146 | +For local development against `dist/`, you can point the wrapper at the built artifact: |
79 | 147 |
|
80 | 148 | ```bash |
81 | 149 | mkdir -p .opencode/plugins |
82 | | -``` |
83 | 150 |
|
84 | | -```bash |
85 | 151 | cat > .opencode/plugins/opencode-palantir.js <<'EOF' |
86 | 152 | import plugin from '../../dist/index.js'; |
87 | 153 |
|
88 | 154 | export default plugin; |
89 | 155 | EOF |
90 | 156 | ``` |
91 | 157 |
|
92 | | -OpenCode automatically loads any `.js`/`.ts` files in `.opencode/plugins/` at startup. |
93 | | - |
94 | 158 | ## Development |
95 | 159 |
|
96 | 160 | Build the plugin: |
@@ -123,6 +187,10 @@ Format with Prettier: |
123 | 187 | mise run format |
124 | 188 | ``` |
125 | 189 |
|
| 190 | +## Release notes |
| 191 | + |
| 192 | +For maintainers, see `RELEASING.md`. |
| 193 | + |
126 | 194 | ## Author |
127 | 195 |
|
128 | 196 | Anand Pant <anand@shpit.dev> |
0 commit comments