| name | lauyer | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Search Portuguese court jurisprudence (DGSI) and legislation (Diário da República). Use for finding court decisions, laws, portarias, decretos-lei, and any Portuguese legal information. | ||||||||||||||||||||||||||||||||
| metadata |
|
Search Portuguese court jurisprudence (DGSI) and legislation (Diário da República). Outputs clean markdown optimized for LLM consumption.
No Rust or compilation required. Download the pre-built binary for your platform from Releases:
curl -L https://github.com/nikuscs/lauyer/releases/latest/download/lauyer-macos-arm64.tar.gz | tar xz
chmod +x lauyer
sudo mv lauyer /usr/local/bin/curl -L https://github.com/nikuscs/lauyer/releases/latest/download/lauyer-linux-x64.tar.gz | tar xz
chmod +x lauyer
sudo mv lauyer /usr/local/bin/Download lauyer-windows-x64.zip from Releases, extract, and add the folder to your PATH.
lauyer --helpUse this skill when the user asks:
- "search Portuguese law for..."
- "find court decisions about..."
- "what does Portuguese law say about..."
- "search DGSI for..."
- "find jurisprudência about..."
- "search Diário da República..."
- "latest portarias about..."
- "decretos-lei about..."
- "today's legislation"
- "what laws were published today?"
- Any mention of Portuguese law, court decisions, jurisprudence, DGSI, Diário da República, portarias, decretos-lei, leis, despachos, or legal research in Portugal
Search court decisions across 10 Portuguese courts in parallel.
# Search all courts
lauyer dgsi search "usucapião"
# Search specific court
lauyer dgsi search "contrato trabalho" --court stj
# Multiple courts
lauyer dgsi search "responsabilidade civil" --court stj --court rel-porto
# Date filtering
lauyer dgsi search "despejo" --since 2024-01-01 --until 2024-12-31
lauyer dgsi search "arrendamento" --recent 1y
# Sort and limit
lauyer dgsi search "herança" --limit 10 --sort date
# Fetch full decision text
lauyer dgsi search "abuso de direito" --court stj --limit 3 --fetch-full
# Fetch a single decision by URL
lauyer dgsi fetch "https://www.dgsi.pt/jstj.nsf/..."
# List all courts
lauyer dgsi courtsCourts: stj, sta, conflitos, rel-porto, rel-lisboa, rel-coimbra, rel-guimaraes, rel-evora, tca-sul, tca-norte
| Flag | Description | Example |
|---|---|---|
--court |
Filter by court (repeatable) | --court stj --court sta |
--since |
Earliest date (YYYY-MM-DD) | --since 2024-01-01 |
--until |
Latest date (YYYY-MM-DD) | --until 2024-12-31 |
--recent |
Relative window (30d, 6m, 1y) | --recent 1y |
--limit |
Max results (default: 50) | --limit 10 |
--sort |
Sort order: relevance, date | --sort date |
--fetch-full |
Fetch full decision text | --fetch-full |
--field |
Structured search field name | --field relator |
--value |
Structured search field value | --value "Santos Cabral" |
Search legislation, portarias, decretos-lei, and other official acts.
# Search Portarias from the past week
lauyer dr search --type portaria --recent 1w
# Full-text search
lauyer dr search "trabalho" --type decreto-lei --recent 1m
# Search 2nd series (Despachos, Avisos)
lauyer dr search --content atos-2 --type despacho --recent 1w
# Judicial decisions published in DR
lauyer dr search --content decisoes --recent 1m
# Date range
lauyer dr search --type portaria --since 2026-03-01 --until 2026-03-21
# Fetch full text for each result
lauyer dr search --type portaria --recent 1w --limit 3 --fetch-full
# Today's publications
lauyer dr today
lauyer dr today --type portaria
# List available act types
lauyer dr typesContent types: atos-1 (1st series), atos-2 (2nd series), dr (whole DR issues), decisoes (judicial decisions)
Act types: portaria, decreto-lei, lei, despacho, decreto, aviso, resolucao, retificacao, decreto-regulamentar, lei-organica
| Flag | Description | Example |
|---|---|---|
--type |
Act type filter (repeatable) | --type portaria --type lei |
--content |
Content type filter (repeatable) | --content atos-1 |
--since |
Earliest date (YYYY-MM-DD) | --since 2026-01-01 |
--until |
Latest date (YYYY-MM-DD) | --until 2026-03-21 |
--recent |
Relative window (1w, 1m, 1y) | --recent 1w |
--limit |
Max results (default: 50) | --limit 10 |
--fetch-full |
Fetch full legislation text | --fetch-full |
lauyer dgsi search "insolvência" --court stj --format json # structured JSON
lauyer dgsi search "insolvência" --court stj --format table # terminal table
lauyer dr search --type lei --recent 1m --output resultados.json # write to file (format auto-detected)lauyer dgsi search "penhora" --no-compact # full output, no boilerplate stripping
lauyer dr search "IRS" --recent 1w --strip-stopwords # remove Portuguese stop words| Flag | Description | Example |
|---|---|---|
--format |
Output: markdown, json, table | --format json |
--output |
Write to file | --output results.md |
--no-compact |
Disable boilerplate stripping | --no-compact |
--strip-stopwords |
Remove Portuguese stop words | --strip-stopwords |
--proxy |
Proxy URL (socks5/http) | --proxy socks5://host:port |
--config |
Path to config file | --config ~/lauyer.toml |
--quiet |
Suppress progress bars | --quiet |
# 1. Get recent STJ decisions
lauyer dgsi search "usucapião" --court stj --recent 2y --sort date --limit 20
# 2. Get full text of the most relevant ones
lauyer dgsi search "usucapião" --court stj --recent 2y --sort date --limit 3 --fetch-full
# 3. Check for related legislation
lauyer dr search "usucapião" --content atos-1 --recent 1y# Today's portarias
lauyer dr today --type portaria
# This week's decretos-lei
lauyer dr search --type decreto-lei --recent 1w
# All publications from a date range
lauyer dr search --since 2026-03-01 --until 2026-03-21# Same topic across multiple courts
lauyer dgsi search "responsabilidade civil" --court stj --limit 5
lauyer dgsi search "responsabilidade civil" --court sta --limit 5
lauyer dgsi search "responsabilidade civil" --court rel-porto --limit 5# Extract just case references
lauyer dgsi search "insolvência" --court stj --format json | jq '.[].processo'
# Count results per court
lauyer dgsi search "trabalho" --format json | jq 'group_by(.court) | map({court: .[0].court, count: length})'If the user has a lauyer server running, they must provide the base URL (e.g. http://localhost:3000 or https://lauyer.example.com). Do not guess the URL — ask the user for it. To start a local server:
lauyer serve --port 3000
# Env vars: LAUYER_PORT, LAUYER_HOSTAll endpoints return markdown by default. Add ?format=json for JSON, ?format=table for table. Examples below use $LAUYER_URL as a placeholder — replace with the actual server URL.
Returns {"status":"ok","version":"0.1.0"}.
| Param | Required | Description |
|---|---|---|
q |
yes | Search query |
court |
no | Comma-separated court aliases (default: all) |
since |
no | Start date YYYY-MM-DD |
until |
no | End date YYYY-MM-DD |
limit |
no | Max results (default: 50) |
sort |
no | relevance (default) or date |
fetch_full |
no | true to fetch full decision text |
compact |
no | true/false override compact mode |
format |
no | markdown, json, table |
curl "$LAUYER_URL/dgsi/search?q=usucapiao&court=stj,sta&limit=5&sort=date&format=json"| Param | Required | Description |
|---|---|---|
url |
yes | Full DGSI decision URL |
format |
no | markdown, json, table |
compact |
no | true/false |
curl "$LAUYER_URL/dgsi/fetch?url=https://www.dgsi.pt/jstj.nsf/...&format=json"| Param | Required | Description |
|---|---|---|
format |
no | markdown (default) or json |
| Param | Required | Description |
|---|---|---|
q |
no | Full-text search query |
type |
no | Comma-separated act type aliases (portaria, lei, etc.) |
content |
no | Comma-separated content types (default: atos-1) |
since |
no | Start date YYYY-MM-DD |
until |
no | End date YYYY-MM-DD |
limit |
no | Max results (default: 50) |
fetch_full |
no | true to fetch full legislation text |
compact |
no | true/false |
format |
no | markdown, json, table |
curl "$LAUYER_URL/dr/search?q=trabalho&type=portaria,lei&content=atos-1&since=2026-03-01&format=json"| Param | Required | Description |
|---|---|---|
type |
no | Comma-separated act type aliases |
compact |
no | true/false |
format |
no | markdown, json, table |
curl "$LAUYER_URL/dr/today?type=portaria&format=json"| Param | Required | Description |
|---|---|---|
format |
no | markdown (default) or json |
Fetch full text of a specific DR legislation act by its document ID.
| Param | Required | Description |
|---|---|---|
id |
yes | Document ID (conteudo_id from search results) |
tipo |
no | Act type (e.g. portaria, decreto-lei) |
numero |
no | Act number (e.g. 123-A/2026/1) |
year |
no | Publication year |
format |
no | markdown, json, table |
compact |
no | true/false |
curl "$LAUYER_URL/dr/fetch?id=1075294778&tipo=portaria&numero=123-A/2026/1&year=2026&format=json"Extracted text MAY contain interpretation errors. When presenting DR full text to users, always include the official verification link (dr_url or eli from the response) so they can check the original source.
- Default to markdown output when presenting to users — it's pre-compacted for LLM context
- Use
--format jsonwhen you need to process or filter results programmatically - Limit results with
--limit 5-10for quick answers,--limit 20-50for thorough research - Use
--fetch-fullonly when the user needs actual decision/legislation text, not just metadata - Use
--recentto scope searches temporally —1w,1m,6m,1y - Combine
--courtwith--sort datefor targeted, chronological results - For DR follow-ups, search by act name with
--fetch-full:lauyer dr search "portaria 123-A/2026" --limit 1 --fetch-full - The
conteudo_idfield in DR search results can be used later to fetch full text via/dr/fetch
When presenting results to users:
- Show the most relevant 3-5 results with case number, date, court, and summary
- Include the DGSI URL for each result so users can read the full decision
- Mention total results found and suggest narrowing if too many
- For DR results, highlight the act type, number, and publication date
- When showing DR full text, always include the
dr_urllink for official verification - Offer to fetch full text if the user wants to read a specific decision or legislation
- STJ (Supremo Tribunal de Justiça) — Supreme Court, highest civil/criminal court
- STA (Supremo Tribunal Administrativo) — Supreme Administrative Court
- Relações (rel-porto, rel-lisboa, etc.) — Appeals courts by region
- TCA (tca-sul, tca-norte) — Central Administrative Courts
- Conflitos — Conflicts tribunal (jurisdiction disputes)
Start with STJ for authoritative precedent, use Relações for regional case law.
# SOCKS5 proxy
lauyer --proxy "socks5://127.0.0.1:1080" dgsi search "trabalho"
# HTTP proxy
lauyer --proxy "http://proxy:8080" dgsi search "trabalho"- DGSI uses Latin-1 encoding — lauyer handles the conversion automatically
- DR requires session initialization (CSRF + cookies) — lauyer handles this transparently
- Compact mode strips legal boilerplate headers — use
--no-compactfor raw output --strip-stopwordsremoves common Portuguese words for minimal token usage- Configuration can be set via
lauyer.tomlin the working directory or~/.config/lauyer/lauyer.toml