Skip to main content
skill CX Codex

cli-anything-qgis — Claude Code skill: QGIS from the terminal

Drives a QGIS project from the shell: GeoPackage layers, WKT features, print layouts, PDF export and qgis_process algorithms. Useful when the map has to be built without clicking.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add HKUDS/CLI-Anything --skill cli-anything-qgis -a claude-code
Open on GitHub

What cli-anything-qgis does

The skill turns a terminal session into a stateful QGIS client. Projects open and save as .qgs or .qgz, vector layers get written into GeoPackage files, features arrive as WKT geometry plus typed attributes. Command groups cover project, layer, feature, layout, export, process and session. Run it with no subcommand and you land in a REPL where the session stays alive between calls.

For agent work the author points at --json, so output parses without scraping tables. A one-shot call against an existing project takes --project <path>. Layout export is not drawn by the CLI itself; it rides on native:printlayouttopdf and native:printlayouttoimage. Need something broader? process help and process run reach whatever qgis_process exposes.

It only works where QGIS is actually installed. qgis_process has to sit on PATH, and PyQGIS must import from the same Python environment that runs the CLI, on Python 3.10 or newer. Check that before handing an agent a mapping task, because a missing runtime stops the first command dead.

What it helps with

  • build a project file with the right CRS
  • create a GeoPackage vector layer with typed fields
  • insert point features from WKT and read them back
  • lay out a map with a label on the page
  • run native:buffer through qgis_process

Example prompts for the agent

  • Create a project at demo.qgz with --crs EPSG:4326, then add a places layer with name:string and score:int fields, all with --json.
  • Add POINT(1 2) to places using --attr name=HQ --attr score=5, then list the first 10 features.
  • Build a Main layout with a map and a label, then export it to output.pdf.

How to install cli-anything-qgis

1Skills CLI (Vercel)

npx skills add HKUDS/CLI-Anything --skill cli-anything-qgis -a claude-code

2Manually: put the files in place

~/.claude/skills/cli-anything-qgis/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cli-anything-qgis/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cli-anything-qgis

How do I install cli-anything-qgis in Claude Code?

Run npx skills add HKUDS/CLI-Anything --skill cli-anything-qgis -a claude-code. The skill file lands at ~/.claude/skills/cli-anything-qgis/SKILL.md.

What does cli-anything-qgis do?

It manages QGIS projects from the terminal: creates layers and features, assembles print layouts, exports them, and runs qgis_process algorithms. The work happens on the real QGIS runtime.

What do I need for it to work?

A local QGIS install with qgis_process on PATH, PyQGIS importable from the Python environment that runs the CLI, and Python 3.10+.

Source text

SKILL.md · Apache-2.0
---
name: "cli-anything-qgis"
description: Stateful QGIS CLI for projects, writable layers, features, layouts, exports, and qgis_process operations using the real QGIS runtime.
---

# cli-anything-qgis

Use this skill when you need to inspect or modify QGIS projects from the terminal through the real QGIS runtime.

## Requirements

- QGIS installed with `qgis_process` on `PATH`
- PyQGIS importable from the Python environment running the CLI
- Python 3.10+

## Agent guidance

- Prefer `--json` for all machine-driven use.
- For one-shot commands, pass `--project <path>` when operating on an existing project.
- Running `cli-anything-qgis` with no subcommand starts a stateful REPL.
- Layout export is backed by real QGIS processing algorithms:
  - `native:printlayouttopdf`
  - `native:printlayouttoimage`

## What this CLI covers

- create, open, save, and inspect `.qgs` / `.qgz` projects
- create writable GeoPackage-backed vector layers
- add features via WKT geometry and typed `key=value` attributes
- create print layouts and add map/label items
- export layouts to PDF or image
- inspect and run generic `qgis_process` algorithms
- inspect session status and history

## Command groups

### `project`
- `new -o/--output [--title] [--crs]`
- `open PATH`
- `save [PATH]`
- `info`
- `set-crs CRS`

### `layer`
- `create-vector --name --geometry --crs [--field name:type ...]`
- `list`
- `info LAYER`
- `remove LAYER`

### `feature`
- `add --layer LAYER --wkt WKT [--attr key=value ...]`
- `list --layer LAYER [--limit N]`

### `layout`
- `create --name [--page-size] [--orientation]`
- `list`
- `info LAYOUT`
- `remove LAYOUT`
- `add-map --layout LAYOUT --x --y --width --height [--extent xmin,ymin,xmax,ymax]`
- `add-label --layout LAYOUT --text TEXT --x --y --width --height [--font-size N]`

### `export`
- `presets`
- `pdf OUTPUT --layout LAYOUT [--dpi] [--force-vector] [--force-raster] [--georeference/--no-georeference] [--overwrite]`
- `image OUTPUT --layout LAYOUT [--dpi] [--overwrite]`

### `process`
- `list`
- `help ALGORITHM_ID`
- `run ALGORITHM_ID [--param KEY=VALUE ...]`

### `session`
- `status`
- `history [--limit N]`

## Examples

### Create a project and add a writable layer

```bash
cli-anything-qgis --json project new -o demo.qgz --title "Demo" --crs EPSG:4326
cli-anything-qgis --json --project demo.qgz layer create-vector \
  --name places \
  --geometry point \
  --field name:string \
  --field score:int
```

### Add features and inspect them

```bash
cli-anything-qgis --json --project demo.qgz feature add \
  --layer places \
  --wkt "POINT(1 2)" \
  --attr name=HQ \
  --attr score=5

cli-anything-qgis --json --project demo.qgz feature list --layer places --limit 10
```

### Create and export a layout

```bash
cli-anything-qgis --json --project demo.qgz layout create --name Main
cli-anything-qgis --json --project demo.qgz layout add-map --layout Main --x 10 --y 20 --width 180 --height 120
cli-anything-qgis --json --project demo.qgz layout add-label --layout Main --text "Demo map" --x 10 --y 8 --width 100 --height 10
cli-anything-qgis --json --project demo.qgz export pdf output.pdf --layout Main --overwrite
```

### Inspect or run processing algorithms

```bash
cli-anything-qgis --json process help native:buffer
cli-anything-qgis --json --project demo.qgz process run native:buffer \
  --param INPUT=/tmp/demo_data.gpkg|layername=places \
  --param DISTANCE=1 \
  --param SEGMENTS=8 \
  --param END_CAP_STYLE=0 \
  --param JOIN_STYLE=0 \
  --param MITER_LIMIT=2 \
  --param DISSOLVE=false \
  --param OUTPUT=/tmp/buffer.geojson
```

### REPL

```bash
cli-anything-qgis
```

Example interactive flow:

```text
project new -o demo.qgz --title "Demo"
layer create-vector --name places --geometry point --field name:string
feature add --layer places --wkt "POINT(1 2)" --attr name=HQ
layout create --name Main
session status
quit
```

© HKUDS · Apache-2.0 · HKUDS/CLI-Anything

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set55

cli-anything-godot Controls Godot projects from the command line, including scenes, GDScript runs, and exports. Useful when an agent needs to change or inspect a game project. CX Codex +1 548installs cli-anything-comfyui A skill that hands your coding agent a terminal for ComfyUI, so it can queue workflows, browse models and pull finished images without a GUI in the way. CX Codex +1 546installs cli-anything-ollama Skill for working with local LLMs through the Ollama REST API directly from your editor. Lets agents run models, generate text, chat, and create embeddings without a GUI. CX Codex +1 542installs cli-anything-kdenlive Controls Kdenlive video editing through a stateful terminal tool. Helps coding agents build timelines, apply filters, and export projects to MLT XML without manual GUI work. CX Codex +1 536installs cli-anything-audacity A skill that puts a stateful Audacity CLI in your agent's hands: edit tracks, clips and effects, then render without opening the GUI. CX Codex +1 530installs cli-anything-n8n A skill that hands your agent a command line for n8n: workflows, executions, credentials, variables and tags. Useful when automation lives in scripts, not the UI. CX Codex +1 515installs cli-anything-mermaid Command-line tool to create and export Mermaid diagrams to SVG or PNG without a GUI. Useful for AI agents generating architecture flowcharts directly from terminal sessions. CX Codex +1 519installs cli-anything-obs-studio Guides an agent through editing OBS Studio JSON scene collections with a CLI for scenes, sources, filters, audio, and output settings. CX Codex +1 516installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor