# CLI Anything Qgis

Stateful QGIS CLI for projects, writable layers, features, layouts, exports, and...

- Repository: https://github.com/HKUDS/CLI-Anything (58029 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-09-22
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add HKUDS/CLI-Anything --skill cli-anything-qgis -g -a claude-code -y`
Codex: `npx skills add HKUDS/CLI-Anything --skill cli-anything-qgis -g -a codex -y`
Cursor: `npx skills add HKUDS/CLI-Anything --skill cli-anything-qgis -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/CLI-Anything --skill cli-anything-qgis -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add HKUDS/CLI-Anything`

## Description

Stateful QGIS CLI for projects, writable layers, features, layouts, exports, and qgis_process operations using the real QGIS runtime.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

The rest: https://github.com/HKUDS/CLI-Anything/blob/HEAD/QGIS/agent-harness/cli_anything/qgis/skills/SKILL.md
