@leverstack/arcq 1.0.0 → 1.0.1
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.
- package/README.md +5 -1
- package/package.json +4 -3
- package/skills/arcq/SKILL.md +64 -0
package/README.md
CHANGED
|
@@ -72,9 +72,13 @@ npm run lint # lint
|
|
|
72
72
|
|
|
73
73
|
## Using arcq with coding agents
|
|
74
74
|
|
|
75
|
-
The
|
|
75
|
+
The package ships a ready-made [Agent Skill](skills/arcq/SKILL.md) covering discovery, the quoting rule, output shaping, the exit-code contract, and TLS behavior. For Claude Code, install it with:
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
+
# from an npm install
|
|
79
|
+
cp -r "$(npm root -g)/@leverstack/arcq/skills/arcq" ~/.claude/skills/
|
|
80
|
+
|
|
81
|
+
# or from a clone
|
|
78
82
|
cp -r skills/arcq ~/.claude/skills/
|
|
79
83
|
```
|
|
80
84
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverstack/arcq",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "CLI for querying ArcGIS feature services",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"dist"
|
|
8
|
+
"dist",
|
|
9
|
+
"skills"
|
|
9
10
|
],
|
|
10
11
|
"scripts": {
|
|
11
12
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"node": ">=18"
|
|
40
41
|
},
|
|
41
42
|
"bin": {
|
|
42
|
-
"arcq": "
|
|
43
|
+
"arcq": "dist/bin/arcq.js"
|
|
43
44
|
},
|
|
44
45
|
"type": "module",
|
|
45
46
|
"dependencies": {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arcq
|
|
3
|
+
description: Query ArcGIS feature services from the command line with arcq. Use when exploring, testing, or verifying data behind any ArcGIS FeatureServer or MapServer layer - discover layers and fields, run bounded SQL queries, and branch on a strict exit-code contract instead of parsing prose.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# arcq
|
|
7
|
+
|
|
8
|
+
`arcq` queries ArcGIS REST services directly, so you can prove what the data
|
|
9
|
+
actually is instead of trusting a UI, a cached response, or passing tests.
|
|
10
|
+
stdout is always pure JSON; human-readable summaries go to stderr.
|
|
11
|
+
|
|
12
|
+
## Discovery (don't guess)
|
|
13
|
+
|
|
14
|
+
Never guess layer or field names - look them up first:
|
|
15
|
+
|
|
16
|
+
- `arcq layers --names` - the configured layer shortcuts
|
|
17
|
+
- `arcq fields <layer>` - field names, types, aliases as JSON
|
|
18
|
+
- `arcq list <service-or-url>` - layer ids and names in a service
|
|
19
|
+
- `arcq active` - the currently selected layer (exit 0 even if none)
|
|
20
|
+
|
|
21
|
+
If no layers are configured yet, set them up once:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
arcq services add <name> <FeatureServer-url>
|
|
25
|
+
arcq refresh && arcq sync # index the catalog, generate layer shortcuts
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Querying
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
arcq query <layer> "<where>" --out-fields a,b,c --limit 20 --quiet
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- `<layer>` is a config shortcut (see `arcq layers --names`) or a raw URL.
|
|
35
|
+
- **Quoting rule:** the `where` clause is ArcGIS SQL, and string literals
|
|
36
|
+
need SINGLE quotes inside the double-quoted shell argument:
|
|
37
|
+
`arcq query parcels "STATUS = 'ACTIVE'"`. Double-quoted literals are an
|
|
38
|
+
ArcGIS syntax error (exit 1).
|
|
39
|
+
- Keep output bounded: `--limit <N>` caps rows, `--count` returns only
|
|
40
|
+
`{"count":N}`, `--out-fields` trims columns, `--order-by "<field> DESC"`
|
|
41
|
+
sorts server-side.
|
|
42
|
+
- `--quiet` suppresses the stderr summary; stdout stays clean JSON either
|
|
43
|
+
way, so piping to `jq` always works.
|
|
44
|
+
|
|
45
|
+
## Exit codes (branch on these)
|
|
46
|
+
|
|
47
|
+
- `0` - success. An empty `[]` is a real, trustworthy answer, not an error:
|
|
48
|
+
arcq surfaces the failures ArcGIS hides inside HTTP-200 bodies.
|
|
49
|
+
- `1` - error (bad where clause, unknown layer, server failure). The message
|
|
50
|
+
on stderr says what went wrong; unknown layer names include closest-match
|
|
51
|
+
suggestions.
|
|
52
|
+
- `2` - token missing, invalid, or expired. Ask the user to run
|
|
53
|
+
`arcq token set <token>`, then retry.
|
|
54
|
+
|
|
55
|
+
## TLS
|
|
56
|
+
|
|
57
|
+
Certificates are verified by default. If a query fails with a TLS
|
|
58
|
+
certificate error, the server's chain is not publicly trusted (self-signed
|
|
59
|
+
or private CA). Do not silently disable verification - tell the user; for a
|
|
60
|
+
server they trust, they can opt in with `--insecure`, `ARCQ_INSECURE=1`, or
|
|
61
|
+
`"insecure": true` in `~/.arcq.json`. When insecure mode is already active
|
|
62
|
+
you will see one stderr line per invocation
|
|
63
|
+
(`[arcq] WARNING: TLS certificate verification is disabled`) - that is
|
|
64
|
+
expected, not a failure.
|