New to Claude Skills? Learn how to install them →

hkuds on GitHub

QGIS CLI Tool

Free

Manage QGIS projects directly from your terminal.

by hkuds46.9k stars on hkuds/cli-anything
2 views
Updated Aug 3, 2026
Get this skill

Free · Opens the source repo

What QGIS CLI Tool does

The QGIS CLI Tool is designed for users who need to interact with QGIS projects through a command-line interface. This skill allows you to create, open, modify, and export QGIS projects using the real QGIS runtime, making it ideal for developers and data analysts who prefer terminal-based workflows. With this tool, you can manage writable layers, add features, create layouts, and run processing algorithms without launching the QGIS GUI.

To utilize this skill, you need to have QGIS installed with qgis_process available in your PATH and ensure that PyQGIS is importable in your Python environment. The CLI supports JSON output for machine-driven use, which is particularly useful for automation and scripting tasks. You can start a stateful REPL session for interactive use, or run one-off commands directly from the terminal.

The skill covers a broad range of functionalities including the creation and inspection of .qgs and .qgz projects, managing vector layers, adding features using WKT geometries, and exporting layouts to various formats like PDF and images. Additionally, you can inspect and execute QGIS processing algorithms directly from the command line, facilitating complex geospatial analyses without the need for a graphical interface.

Overall, this skill is an essential tool for users who need to perform geospatial tasks efficiently from the terminal, providing a powerful alternative to the traditional QGIS GUI.

When to use it

Use this tool when you need to automate QGIS tasks or prefer command-line interactions for geospatial project management.

When not to use it

This skill may not be suitable for users who are unfamiliar with command-line interfaces or prefer visual tools for geospatial analysis.

What you can build with it

Automate QGIS Project Creation

Quickly create and configure new QGIS projects from the terminal, streamlining your workflow.

Batch Processing of Geospatial Data

Run multiple QGIS processing algorithms in sequence without needing to open the GUI, saving time on repetitive tasks.

Interactive Geospatial Analysis

Use the REPL mode to interactively manage layers and features within your QGIS projects during exploratory analysis.

How to install QGIS CLI Tool

View source

1. Install with the skills CLI

npx skills add hkuds/cli-anything/skills --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by hkuds

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

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

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

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

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

cli-anything-qgis

Example interactive flow:

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

Frequently asked questions about QGIS CLI Tool

Similar skills