viewinline 0.3.1__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.
@@ -0,0 +1,44 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it using the metadata from this file."
3
+ title: "viewinline"
4
+ abstract: >-
5
+ A tiny, non-interactive command-line viewer that displays rasters/photos,
6
+ vectors, and tabular data (CSV/Parquet) inline in the terminal — no GUI,
7
+ no X11, and no file downloads. Designed for quick visual inspection at the
8
+ command line, and especially useful on HPC systems and remote servers over
9
+ SSH, where images render on the local terminal.
10
+ type: software
11
+ authors:
12
+ - given-names: Keiko
13
+ family-names: Nomura
14
+ # orcid: "https://orcid.org/0000-0000-0000-0000" # optional: add if you have one
15
+ - given-names: Filip
16
+ family-names: Kral
17
+ # orcid: "https://orcid.org/0000-0000-0000-0000" # optional: add if you have one
18
+ repository-code: "https://github.com/nkeikon/inlineviewer"
19
+ url: "https://github.com/nkeikon/inlineviewer"
20
+ license: Apache-2.0
21
+ version: 0.3.2
22
+ date-released: 2026-06-06
23
+ # ---------------------------------------------------------------------------
24
+ # The DOI below is the VERSION DOI for v0.3.2 (a specific archived snapshot).
25
+ # To make citations always resolve to your LATEST release, replace it with the
26
+ # Zenodo CONCEPT / "all versions" DOI, shown on the record under "Cite all
27
+ # versions". The version DOI stays useful in `identifiers` for reproducibility.
28
+ # ---------------------------------------------------------------------------
29
+ doi: "10.5281/zenodo.20564266"
30
+ identifiers:
31
+ - type: doi
32
+ value: "10.5281/zenodo.20564266"
33
+ description: "Zenodo archive of version v0.3.2"
34
+ keywords:
35
+ - geospatial
36
+ - raster
37
+ - vector
38
+ - terminal
39
+ - command-line
40
+ - visualization
41
+ - GeoTIFF
42
+ - NetCDF
43
+ - GeoParquet
44
+ - remote-sensing
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: viewinline
3
- Version: 0.3.1
3
+ Version: 0.4.0
4
4
  Summary: Quick look geospatial viewer for the terminal, with inline image previews
5
5
  Project-URL: Homepage, https://github.com/nkeikon/viewinline
6
6
  Project-URL: Repository, https://github.com/nkeikon/viewinline
@@ -81,6 +81,11 @@ viewinline hyperspectral.nc --subset 22 --bands 10-54 --gallery 5x11
81
81
  viewinline path/to/vector.geojson
82
82
  viewinline boundaries.geoparquet --color-by population --colormap viridis
83
83
 
84
+ # Save to file
85
+ viewinline path/to/file.tif --export out.png # save the rendered image as PNG (or .jpg)
86
+ viewinline scene.tif --rgb 4 3 2 --export rgb.png
87
+ viewinline dem.tif --colormap terrain --display 1 --export dem.png # full-res with colormap
88
+
84
89
  # CSV and Parquet
85
90
  viewinline data.csv # preview rows and columns
86
91
  viewinline data.parquet --describe # summary statistics
@@ -134,6 +139,7 @@ You can also force the chafa path on any terminal by setting `INLINE_VIEWER_ENGI
134
139
  - **NetCDF/HDF Support:** Display variables from NetCDF (.nc) and HDF5 (.h5, .hdf5) files with automatic nodata detection and multi-slice navigation
135
140
  - **Parquet/GeoParquet:** Render GeoParquet as vector maps or view as tabular data
136
141
  - **Tabular View for Vectors:** Use `--table` to access CSV-style operations (filter, sort, describe, hist) on any vector file
142
+ - **AI-agent inspection:** `--info` returns file metadata and statistics as JSON; `--export` saves a quick-look image for an agent to inspect. Designed for AI coding-agent workflows.
137
143
 
138
144
  ## Supported formats
139
145
  **Rasters**
@@ -180,6 +186,7 @@ You can also force the chafa path on any terminal by setting `INLINE_VIEWER_ENGI
180
186
  - Variables with 4+ dimensions are not supported
181
187
  - For a complete variable list, use `ncdump -h file.nc` or `viewtif`
182
188
 
189
+
183
190
  ## Dependencies
184
191
 
185
192
  **Core dependencies** (installed automatically):
@@ -213,16 +220,18 @@ You can also force the chafa path on any terminal by setting `INLINE_VIEWER_ENGI
213
220
  ```
214
221
  General:
215
222
  --display DISPLAY Resize only the displayed image (0.5=smaller, 2=bigger). Default: auto-fit to terminal.
223
+ --info Print file metadata and statistics as JSON, then exit (agent-facing). For NetCDF/HDF, lists variables; combine with --subset N to inspect one. Always returns JSON, including on error.
224
+ --export PATH Save the rendered image to PATH (.png/.jpg) and open it. Works with any display flag. Prints {"path": "..."} as the final line.
216
225
 
217
226
  Raster:
218
227
  --band BAND Band number to display (single raster), or slice number for NetCDF. (default: 1)
219
228
  --bands BANDS Display multiple bands as a grid. Accepts ranges (30-40), lists (3,4,5), or mixed (1,5,10-15).
229
+ --rgb R G B Three band numbers for RGB display (e.g., --rgb 4 3 2). Overrides default 1 2 3.
230
+ --rgbfiles R G B Three single-band rasters for RGB composite. Can also provide as positional arguments.
220
231
  --timestep INTEGER Alias for --band when working with NetCDF files.
221
232
  --subset INTEGER Variable index for NetCDF/HDF files (e.g., --subset 1).
222
233
  --reduce DIM_NAME For 3D NetCDF variables, specify which dimension to use as the band/slider axis. Auto-detected if omitted.
223
234
  --colormap Apply colormap to single-band rasters. Flag without the color scheme → 'terrain'.
224
- --rgb R G B Three band numbers for RGB display (e.g., --rgb 4 3 2). Overrides default 1 2 3.
225
- --rgbfiles R G B Three single-band rasters for RGB composite. Can also provide as positional arguments.
226
235
  --vmin VMIN Minimum pixel value for raster display scaling.
227
236
  --vmax VMAX Maximum pixel value for raster display scaling.
228
237
  --nodata NODATA Override nodata value for rasters if dataset metadata is missing or incorrect.
@@ -249,6 +258,95 @@ CSV and Parquet:
249
258
  --select COLUMNS Select specific columns (space separated). Example: --select Country City
250
259
  --sql QUERY Execute full DuckDB SQL query. Use 'data' as table name. Example: --sql "SELECT * FROM data WHERE Poverty > 40"
251
260
  ```
261
+ ## AI-agent inspection (`--info`, `--export`)
262
+
263
+ An optional command aimed at AI coding-agent workflows (Claude Code, Codex, Cursor, and similar). An agent can confirm its code *ran*, but not whether the geospatial file it produced is *sensible* — wrong CRS, unexpected dimensions, all-NoData, NaN/Inf values, or a flipped output. `--info` answers **"what did I create?"** as machine-readable JSON.
264
+
265
+ ```bash
266
+ viewinline result.tif --info # metadata + statistics as JSON, then exit
267
+ ```
268
+
269
+ It reports facts, not judgments: format, dimensions, bands, dtype, CRS, resolution, bounds, nodata, and per-band statistics. For NetCDF/HDF it lists variables; add `--subset N` to inspect one:
270
+
271
+ ```bash
272
+ viewinline data.nc --info # list variables
273
+ viewinline data.nc --subset 7 --info # inspect variable 7
274
+ viewinline scene.hdf --subset 1 --info # inspect HDF subdataset 1
275
+ ```
276
+
277
+ `--info` always returns JSON, including a `{"readable": false, "error": ...}` object on unreadable input, so an agent can always parse the result. Pairs well with `--export` (see Usage) when the agent wants to *see* the output too, not just read its metadata.
278
+
279
+ ### `--info` — structured inspection
280
+
281
+ Prints file metadata as JSON and exits (no image is drawn). Reports facts, not judgments — the agent interprets them in context.
282
+
283
+ ```bash
284
+ viewinline result.tif --info
285
+ ```
286
+ ```json
287
+ {
288
+ "format": "GTiff",
289
+ "filename": "result.tif",
290
+ "dimensions": [1001, 1001],
291
+ "bands": 3,
292
+ "dtype": "uint16",
293
+ "crs": "EPSG:32631",
294
+ "resolution": [10.0, 10.0],
295
+ "bounds": [590520.0, 5780620.0, 600530.0, 5790630.0],
296
+ "nodata": null,
297
+ "statistics": {
298
+ "method": "full",
299
+ "bands_total": 3,
300
+ "bands_reported": 3,
301
+ "per_band": [
302
+ {"band": 1, "min": 0.0, "max": 10964.0, "mean": 1009.32, "valid_fraction": 1.0, "naninf_fraction": 0.0}
303
+ ]
304
+ }
305
+ }
306
+ ```
307
+
308
+ For **NetCDF and HDF**, `--info` lists the file's variables/subdatasets; add `--subset N` to inspect one:
309
+
310
+ ```bash
311
+ viewinline data.nc --info # list variables
312
+ viewinline data.nc --subset 7 --info # inspect variable 7 (dims, dtype, units, stats)
313
+ viewinline scene.hdf --subset 1 --info # inspect HDF subdataset 1
314
+ ```
315
+
316
+ `--info` **always returns JSON**, including on failure. Unsupported or unreadable inputs return a structured error rather than crashing, so an agent can always parse the result:
317
+
318
+ ```json
319
+ {"error": "no directly-readable bands (file has subdatasets)", "readable": false, "subdataset_count": 22}
320
+ ```
321
+
322
+ Notes on the output:
323
+ - `crs` is an `EPSG:code` when one can be resolved, the full WKT string when the CRS has no EPSG code (e.g. MODIS Sinusoidal), or `null` when the file has no CRS.
324
+ - Statistics exclude NoData and non-finite pixels; `valid_fraction` and `naninf_fraction` report how much was excluded.
325
+ - For files with many bands, per-band stats are capped (a `bands_reported` < `bands_total` and a `note` indicate truncation — absence of a band's stats does **not** imply a problem).
326
+ - Large rasters are sampled for statistics (`"method": "sampled"`); small ones use every pixel (`"method": "full"`).
327
+
328
+ ### `--export` — visual inspection
329
+
330
+ Saves the rendered image to a file (PNG or JPEG, chosen by extension) so an agent can also inspect it with its vision capabilities, then prints the path as JSON:
331
+
332
+ ```bash
333
+ viewinline result.tif --export out.png
334
+ ```
335
+ ```json
336
+ {"path": "/abs/path/out.png"}
337
+ ```
338
+
339
+ `--export` works with **any display option** — the saved image is exactly what viewinline would render, after all flags are applied:
340
+
341
+ ```bash
342
+ viewinline scene.tif --rgb 4 3 2 --export rgb.png
343
+ viewinline dem.tif --colormap terrain --export dem.png
344
+ viewinline result.tif --display 1 --export full_res.png # full resolution instead of terminal-fit
345
+ ```
346
+
347
+ The exported image is a quick-look representation for catching problems metadata can't reveal — blank output, stripes, artifacts, holes, wrong orientation, unexpected extent, or bad color scaling — **not** a publication-quality rendering.
348
+
349
+ > **Scope:** `--info` and `--export` tell you what a file *is* and what it *looks like*. Neither claims the scientific result is *correct* — that judgment stays with the agent.
252
350
 
253
351
  ## Need help?
254
352
  NASA staff can ask questions about usage via the documentation-based assistant 'viewtif + viewgeom + viewinline Helper' via the ChatGSFC Agent Marketplace.
@@ -48,6 +48,11 @@ viewinline hyperspectral.nc --subset 22 --bands 10-54 --gallery 5x11
48
48
  viewinline path/to/vector.geojson
49
49
  viewinline boundaries.geoparquet --color-by population --colormap viridis
50
50
 
51
+ # Save to file
52
+ viewinline path/to/file.tif --export out.png # save the rendered image as PNG (or .jpg)
53
+ viewinline scene.tif --rgb 4 3 2 --export rgb.png
54
+ viewinline dem.tif --colormap terrain --display 1 --export dem.png # full-res with colormap
55
+
51
56
  # CSV and Parquet
52
57
  viewinline data.csv # preview rows and columns
53
58
  viewinline data.parquet --describe # summary statistics
@@ -101,6 +106,7 @@ You can also force the chafa path on any terminal by setting `INLINE_VIEWER_ENGI
101
106
  - **NetCDF/HDF Support:** Display variables from NetCDF (.nc) and HDF5 (.h5, .hdf5) files with automatic nodata detection and multi-slice navigation
102
107
  - **Parquet/GeoParquet:** Render GeoParquet as vector maps or view as tabular data
103
108
  - **Tabular View for Vectors:** Use `--table` to access CSV-style operations (filter, sort, describe, hist) on any vector file
109
+ - **AI-agent inspection:** `--info` returns file metadata and statistics as JSON; `--export` saves a quick-look image for an agent to inspect. Designed for AI coding-agent workflows.
104
110
 
105
111
  ## Supported formats
106
112
  **Rasters**
@@ -147,6 +153,7 @@ You can also force the chafa path on any terminal by setting `INLINE_VIEWER_ENGI
147
153
  - Variables with 4+ dimensions are not supported
148
154
  - For a complete variable list, use `ncdump -h file.nc` or `viewtif`
149
155
 
156
+
150
157
  ## Dependencies
151
158
 
152
159
  **Core dependencies** (installed automatically):
@@ -180,16 +187,18 @@ You can also force the chafa path on any terminal by setting `INLINE_VIEWER_ENGI
180
187
  ```
181
188
  General:
182
189
  --display DISPLAY Resize only the displayed image (0.5=smaller, 2=bigger). Default: auto-fit to terminal.
190
+ --info Print file metadata and statistics as JSON, then exit (agent-facing). For NetCDF/HDF, lists variables; combine with --subset N to inspect one. Always returns JSON, including on error.
191
+ --export PATH Save the rendered image to PATH (.png/.jpg) and open it. Works with any display flag. Prints {"path": "..."} as the final line.
183
192
 
184
193
  Raster:
185
194
  --band BAND Band number to display (single raster), or slice number for NetCDF. (default: 1)
186
195
  --bands BANDS Display multiple bands as a grid. Accepts ranges (30-40), lists (3,4,5), or mixed (1,5,10-15).
196
+ --rgb R G B Three band numbers for RGB display (e.g., --rgb 4 3 2). Overrides default 1 2 3.
197
+ --rgbfiles R G B Three single-band rasters for RGB composite. Can also provide as positional arguments.
187
198
  --timestep INTEGER Alias for --band when working with NetCDF files.
188
199
  --subset INTEGER Variable index for NetCDF/HDF files (e.g., --subset 1).
189
200
  --reduce DIM_NAME For 3D NetCDF variables, specify which dimension to use as the band/slider axis. Auto-detected if omitted.
190
201
  --colormap Apply colormap to single-band rasters. Flag without the color scheme → 'terrain'.
191
- --rgb R G B Three band numbers for RGB display (e.g., --rgb 4 3 2). Overrides default 1 2 3.
192
- --rgbfiles R G B Three single-band rasters for RGB composite. Can also provide as positional arguments.
193
202
  --vmin VMIN Minimum pixel value for raster display scaling.
194
203
  --vmax VMAX Maximum pixel value for raster display scaling.
195
204
  --nodata NODATA Override nodata value for rasters if dataset metadata is missing or incorrect.
@@ -216,6 +225,95 @@ CSV and Parquet:
216
225
  --select COLUMNS Select specific columns (space separated). Example: --select Country City
217
226
  --sql QUERY Execute full DuckDB SQL query. Use 'data' as table name. Example: --sql "SELECT * FROM data WHERE Poverty > 40"
218
227
  ```
228
+ ## AI-agent inspection (`--info`, `--export`)
229
+
230
+ An optional command aimed at AI coding-agent workflows (Claude Code, Codex, Cursor, and similar). An agent can confirm its code *ran*, but not whether the geospatial file it produced is *sensible* — wrong CRS, unexpected dimensions, all-NoData, NaN/Inf values, or a flipped output. `--info` answers **"what did I create?"** as machine-readable JSON.
231
+
232
+ ```bash
233
+ viewinline result.tif --info # metadata + statistics as JSON, then exit
234
+ ```
235
+
236
+ It reports facts, not judgments: format, dimensions, bands, dtype, CRS, resolution, bounds, nodata, and per-band statistics. For NetCDF/HDF it lists variables; add `--subset N` to inspect one:
237
+
238
+ ```bash
239
+ viewinline data.nc --info # list variables
240
+ viewinline data.nc --subset 7 --info # inspect variable 7
241
+ viewinline scene.hdf --subset 1 --info # inspect HDF subdataset 1
242
+ ```
243
+
244
+ `--info` always returns JSON, including a `{"readable": false, "error": ...}` object on unreadable input, so an agent can always parse the result. Pairs well with `--export` (see Usage) when the agent wants to *see* the output too, not just read its metadata.
245
+
246
+ ### `--info` — structured inspection
247
+
248
+ Prints file metadata as JSON and exits (no image is drawn). Reports facts, not judgments — the agent interprets them in context.
249
+
250
+ ```bash
251
+ viewinline result.tif --info
252
+ ```
253
+ ```json
254
+ {
255
+ "format": "GTiff",
256
+ "filename": "result.tif",
257
+ "dimensions": [1001, 1001],
258
+ "bands": 3,
259
+ "dtype": "uint16",
260
+ "crs": "EPSG:32631",
261
+ "resolution": [10.0, 10.0],
262
+ "bounds": [590520.0, 5780620.0, 600530.0, 5790630.0],
263
+ "nodata": null,
264
+ "statistics": {
265
+ "method": "full",
266
+ "bands_total": 3,
267
+ "bands_reported": 3,
268
+ "per_band": [
269
+ {"band": 1, "min": 0.0, "max": 10964.0, "mean": 1009.32, "valid_fraction": 1.0, "naninf_fraction": 0.0}
270
+ ]
271
+ }
272
+ }
273
+ ```
274
+
275
+ For **NetCDF and HDF**, `--info` lists the file's variables/subdatasets; add `--subset N` to inspect one:
276
+
277
+ ```bash
278
+ viewinline data.nc --info # list variables
279
+ viewinline data.nc --subset 7 --info # inspect variable 7 (dims, dtype, units, stats)
280
+ viewinline scene.hdf --subset 1 --info # inspect HDF subdataset 1
281
+ ```
282
+
283
+ `--info` **always returns JSON**, including on failure. Unsupported or unreadable inputs return a structured error rather than crashing, so an agent can always parse the result:
284
+
285
+ ```json
286
+ {"error": "no directly-readable bands (file has subdatasets)", "readable": false, "subdataset_count": 22}
287
+ ```
288
+
289
+ Notes on the output:
290
+ - `crs` is an `EPSG:code` when one can be resolved, the full WKT string when the CRS has no EPSG code (e.g. MODIS Sinusoidal), or `null` when the file has no CRS.
291
+ - Statistics exclude NoData and non-finite pixels; `valid_fraction` and `naninf_fraction` report how much was excluded.
292
+ - For files with many bands, per-band stats are capped (a `bands_reported` < `bands_total` and a `note` indicate truncation — absence of a band's stats does **not** imply a problem).
293
+ - Large rasters are sampled for statistics (`"method": "sampled"`); small ones use every pixel (`"method": "full"`).
294
+
295
+ ### `--export` — visual inspection
296
+
297
+ Saves the rendered image to a file (PNG or JPEG, chosen by extension) so an agent can also inspect it with its vision capabilities, then prints the path as JSON:
298
+
299
+ ```bash
300
+ viewinline result.tif --export out.png
301
+ ```
302
+ ```json
303
+ {"path": "/abs/path/out.png"}
304
+ ```
305
+
306
+ `--export` works with **any display option** — the saved image is exactly what viewinline would render, after all flags are applied:
307
+
308
+ ```bash
309
+ viewinline scene.tif --rgb 4 3 2 --export rgb.png
310
+ viewinline dem.tif --colormap terrain --export dem.png
311
+ viewinline result.tif --display 1 --export full_res.png # full resolution instead of terminal-fit
312
+ ```
313
+
314
+ The exported image is a quick-look representation for catching problems metadata can't reveal — blank output, stripes, artifacts, holes, wrong orientation, unexpected extent, or bad color scaling — **not** a publication-quality rendering.
315
+
316
+ > **Scope:** `--info` and `--export` tell you what a file *is* and what it *looks like*. Neither claims the scientific result is *correct* — that judgment stays with the agent.
219
317
 
220
318
  ## Need help?
221
319
  NASA staff can ask questions about usage via the documentation-based assistant 'viewtif + viewgeom + viewinline Helper' via the ChatGSFC Agent Marketplace.
@@ -0,0 +1,199 @@
1
+ ---
2
+ name: viewinline
3
+ description: Terminal viewer for rasters, vectors, and tabular data. Use for quick visual inspection without leaving the shell—preview images in a folder gallery, inspect geospatial files after GDAL workflows, explore CSV data with histograms/scatter plots, or verify files before commit. Provides machine-readable `--info` (metadata + statistics as JSON) and `--export` (save the rendered image) for programmatically checking generated geospatial files. Non-interactive; everything controlled via command-line flags.
4
+ tags: [visualization, terminal, raster, vector, csv, geospatial, gdal, ml, inspection, workflow]
5
+ ---
6
+
7
+ # Viewinline Skill
8
+
9
+ Quick-look terminal viewer for geospatial and tabular data. Think of it as `ls` for visual files—designed for command-line workflows where you want to inspect data without leaving the terminal or opening a separate application.
10
+
11
+ Renders natively in iTerm2, WezTerm, Konsole, Rio, and Contour. Falls back to `chafa` (ASCII art with 24-bit color) in other terminals like kitty, Ghostty, Terminal.app, VS Code, and Linux terminals. Works over SSH without X11 forwarding or VNC.
12
+
13
+ ## When to Use
14
+
15
+ - **File browsing**: `find . -name "*.jpg" | xargs -n1 viewinline` to visually scan results
16
+ - **Gallery view**: `viewinline path/to/folder --gallery 4x3` to preview all images in a directory
17
+ - **Band inspection**: Display specific bands of a raster as a grid: `--bands 10-50` or `--bands 11,15,30,45`
18
+ - **Geospatial workflows**: Inspect raster/vector outputs after GDAL transformations
19
+ - **ML training data**: Review training image galleries without switching windows
20
+ - **Data exploration**: Quick CSV visualizations (histograms, scatter plots, summary stats)
21
+ - **Pre-commit checks**: Verify images, maps, and data files before pushing
22
+ - **Remote servers**: Works over SSH from your local terminal
23
+ - **Verify generated files (agent workflows)**: After writing a GeoTIFF/NetCDF/vector with GDAL, rasterio, or xarray, run `viewinline FILE --info` to check the result is sensible (correct CRS, dimensions, value range, not all-NoData/NaN) as JSON, and `viewinline FILE --export out.png` to visually inspect it
24
+
25
+ ## Supported Formats
26
+
27
+ **Rasters:** GeoTIFF, PNG, JPEG, NetCDF, HDF5, HDF4
28
+ **Vectors:** GeoJSON, Shapefile, GeoPackage, GeoParquet
29
+ **Tabular:** CSV, Parquet (with `pyarrow`)
30
+
31
+ ## Inspecting Files (JSON output)
32
+
33
+ For programmatic checks, two flags return machine-readable output instead of drawing an image. Useful after generating a file to confirm it's sensible before continuing.
34
+
35
+ - `--info` — print file metadata and statistics as JSON, then exit. Reports facts, not judgments (the caller interprets them).
36
+ - Rasters (GeoTIFF, NetCDF, HDF): format, dimensions, bands, dtype, CRS, resolution, bounds, nodata, per-band stats (min/max/mean, valid_fraction, naninf_fraction).
37
+ - Vectors (GeoJSON, Shapefile, GeoPackage, GeoParquet): feature count, geometry type, CRS, bounds, columns.
38
+ - For NetCDF/HDF: `--info` lists variables/subdatasets; add `--subset N` to inspect one.
39
+ - Always returns JSON, including `{"readable": false, "error": ...}` on unreadable input — safe to parse in all cases.
40
+ - `--export PATH` — save the rendered image to PATH (`.png`/`.jpg`) and print `{"path": "..."}`. Works with any display flag (`--rgb`, `--colormap`, `--band`, `--display`), saving exactly what would be drawn.
41
+
42
+ ```bash
43
+ # check a raster you just wrote
44
+ viewinline result.tif --info
45
+
46
+ # check a vector
47
+ viewinline boundaries.geojson --info
48
+
49
+ # NetCDF: list variables, then inspect one
50
+ viewinline data.nc --info
51
+ viewinline data.nc --subset 7 --info
52
+
53
+ # save a quick-look image to inspect visually
54
+ viewinline result.tif --export out.png
55
+ viewinline scene.tif --rgb 4 3 2 --export rgb.png
56
+ ```
57
+
58
+ Note: `--info` and `--export` report what a file *is* and what it *looks like* — not whether the scientific result is correct.
59
+
60
+ ## Core Flags
61
+
62
+ **Inspection (JSON output, no image):**
63
+ - `--info` — print metadata + statistics as JSON, then exit (rasters and vectors; lists variables for NetCDF/HDF with `--subset N`)
64
+ - `--export PATH` — save the rendered image to PATH (`.png`/`.jpg`); prints `{"path": "..."}`
65
+
66
+ **Raster Display:**
67
+ - `--rgb R G B` — Specify band order for RGB (e.g., `--rgb 4 3 2`)
68
+ - `--rgbfiles R.tif G.tif B.tif` — Create RGB composite from separate files
69
+ - `--band N` — Display specific band or NetCDF timestep
70
+ - `--bands RANGE` — Display multiple bands as a grid (e.g., `10-50` or `11,15,30,45`)
71
+ - `--gallery NxM` — Show all images in folder as thumbnails (e.g., `4x3` grid)
72
+ - `--colormap NAME` — Apply colormap (e.g., `plasma`, `viridis`, `terrain`)
73
+ - `--vmin VAL --vmax VAL` — Set min/max for scaling
74
+ - `--display SCALE` — Resize displayed output (0.5=smaller, 2=bigger)
75
+
76
+ **Vector Display:**
77
+ - `--color-by COLUMN` — Color features by attribute value
78
+ - `--colormap NAME` — Apply colormap to coloring
79
+ - `--width W` — Line width for boundaries
80
+ - `--edgecolor COLOR` — Edge color (hex or named)
81
+ - `--table` — Display as tabular data instead of rendering geometry
82
+
83
+ **Tabular Data (CSV/Parquet):**
84
+ - `--describe [COL]` — Summary statistics for all numeric columns or one
85
+ - `--hist [COL]` — Histograms for numeric columns
86
+ - `--scatter X Y` — Scatter plot of two columns
87
+ - `--where EXPR` — Filter rows (DuckDB required): `--where "year > 2010"`
88
+ - `--sort COL` — Sort by column (ascending); use `--desc` for descending
89
+ - `--limit N` — Limit output rows
90
+ - `--select COL1 COL2` — Choose specific columns to display
91
+ - `--sql QUERY` — Full DuckDB SQL (use `data` as table name)
92
+
93
+ **NetCDF/HDF:**
94
+ - `--subset N` — Select variable by index
95
+ - `--band N` or `--timestep N` — Select slice along time/band axis
96
+ - `--reduce DIM_NAME` — Override auto-detected band axis for non-standard dimensions
97
+
98
+ ## Examples
99
+
100
+ ### Image browsing
101
+ ```bash
102
+ # Browse all JPGs in directory
103
+ find . -name "*.jpg" | xargs viewinline
104
+
105
+ # Gallery of all images in a folder (4 columns × 3 rows)
106
+ viewinline path/to/images --gallery 4x3
107
+ ```
108
+
109
+ ### Raster workflows
110
+ ```bash
111
+ # Display single band
112
+ viewinline data.tif --band 2
113
+
114
+ # RGB composite from three bands
115
+ viewinline multiband.tif --rgb 4 3 2
116
+
117
+ # Create RGB from separate files
118
+ viewinline R.tif G.tif B.tif
119
+
120
+ # Display band range as gallery
121
+ viewinline hyperspectral.tif --bands 10-50 --gallery 5x5
122
+
123
+ # Apply colormap with min/max scaling
124
+ viewinline temp.nc --subset 1 --colormap plasma --vmin 273 --vmax 310
125
+ ```
126
+
127
+ ### GDAL verification
128
+ ```bash
129
+ # Reproject and check result
130
+ gdalwarp -t_srs EPSG:3857 input.tif temp.tif
131
+ viewinline temp.tif --colormap terrain
132
+
133
+ # Resample and verify
134
+ gdal_translate -outsize 50% 50% temp.tif output.tif
135
+ viewinline output.tif
136
+ ```
137
+
138
+ ### Vector inspection
139
+ ```bash
140
+ # View vector file
141
+ viewinline boundaries.geojson
142
+
143
+ # Color features by attribute, with colormap
144
+ viewinline boundaries.geoparquet --color-by population --colormap viridis
145
+
146
+ # View vector as tabular data
147
+ viewinline counties.shp --table
148
+ viewinline data.geoparquet --table --where "POP > 100000" --sort POP --desc
149
+ ```
150
+
151
+ ### Data exploration
152
+ ```bash
153
+ # Preview CSV
154
+ viewinline data.csv
155
+
156
+ # Summary statistics
157
+ viewinline data.parquet --describe
158
+
159
+ # Histograms for all numeric columns
160
+ viewinline data.csv --hist
161
+
162
+ # Scatter plot
163
+ viewinline data.csv --scatter area_km2 year
164
+
165
+ # Filter and sort
166
+ viewinline data.csv --where "year > 2010" --sort population --desc
167
+
168
+ # SQL query
169
+ viewinline data.csv --sql "SELECT * FROM data WHERE area > 100 ORDER BY year"
170
+
171
+ # Batch CSV inspection with xargs (use -I {} to control argument order)
172
+ find . -name "*.csv" | xargs -n1 -I {} viewinline {} --describe
173
+ ```
174
+
175
+ ### Verify generated files (agent workflows)
176
+ ```bash
177
+ # Reproject, then check the result is sensible as JSON
178
+ gdalwarp -t_srs EPSG:3857 input.tif output.tif
179
+ viewinline output.tif --info
180
+
181
+ # Confirm a written raster isn't all-NoData / has expected CRS and range
182
+ viewinline result.tif --info
183
+
184
+ # List a NetCDF's variables, then inspect the data variable
185
+ viewinline output.nc --info
186
+ viewinline output.nc --subset 7 --info
187
+
188
+ # Save a quick-look PNG to inspect visually
189
+ viewinline result.tif --export check.png
190
+ ```
191
+
192
+ ## Tips
193
+
194
+ - Use `--gallery` to quickly preview batches of training images or search results
195
+ - Pipe with `xargs`: `find . -newer file.txt | xargs viewinline` to inspect recent changes
196
+ - Add aliases: `alias check='viewinline --describe --hist'`
197
+ - Works in tmux if outer terminal is iTerm2; falls back to ASCII art in other terminals
198
+ - Install `chafa` for better coverage: `brew install chafa` (macOS), `apt install chafa` (Linux)
199
+ - SSH-friendly: images render on your local terminal, not the remote server
@@ -0,0 +1,20 @@
1
+ ```json
2
+ {
3
+ "$schema": "https://context7.com/schema/context7.json",
4
+ "projectTitle": "viewinline",
5
+ "description": "Terminal inline geospatial preview tool for rasters and vectors over SSH and HPC workflows, with machine-readable --info and --export for AI-agent file inspection.",
6
+ "excludeFolders": [
7
+ "tests",
8
+ "examples/large-data",
9
+ "build",
10
+ "dist"
11
+ ],
12
+ "rules": [
13
+ "Prefer SSH and terminal-based workflows in examples.",
14
+ "Use inline terminal image rendering instead of GUI workflows.",
15
+ "Highlight support for GeoTIFF, NetCDF, GeoJSON, and GeoParquet.",
16
+ "Emphasize compatibility limitations for terminal graphics protocols.",
17
+ "For programmatic or AI-agent use, note --info (JSON metadata) and --export (save rendered image)."
18
+ ]
19
+ }
20
+ ```