@ainyc/canonry 1.48.4 → 2.2.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 +42 -27
- package/assets/agent-workspace/AGENTS.md +3 -4
- package/assets/agent-workspace/skills/aero/SKILL.md +7 -10
- package/assets/agent-workspace/skills/aero/references/memory-patterns.md +53 -24
- package/assets/agent-workspace/skills/aero/references/orchestration.md +5 -0
- package/assets/agent-workspace/skills/aero/references/regression-playbook.md +5 -0
- package/assets/agent-workspace/skills/aero/references/reporting.md +5 -0
- package/assets/agent-workspace/skills/aero/references/wordpress-elementor-mcp.md +5 -0
- package/assets/agent-workspace/skills/aero/soul.md +30 -0
- package/assets/agent-workspace/skills/canonry-setup/references/canonry-cli.md +38 -38
- package/assets/assets/index-J73csS93.js +301 -0
- package/assets/assets/{index--ev1Bjls.css → index-yF1fs-OW.css} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-IPOVH342.js → chunk-2QNWFP6R.js} +2455 -791
- package/dist/{chunk-ZZ57GRV6.js → chunk-TAII35VC.js} +65 -1
- package/dist/cli.js +401 -766
- package/dist/index.d.ts +2 -8
- package/dist/index.js +2 -2
- package/dist/{intelligence-service-MZ7SXEGE.js → intelligence-service-C5LAYDFM.js} +1 -1
- package/package.json +11 -8
- package/assets/agent-workspace/SOUL.md +0 -54
- package/assets/assets/index-CVk23m8J.js +0 -282
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@ainyc/canonry) [](https://fsl.software/) [](https://nodejs.org)
|
|
4
4
|
|
|
5
|
-
Canonry is an agent-first AEO platform
|
|
5
|
+
Canonry is an agent-first AEO platform. It ships a built-in AI agent — **Aero** — that reads project state, analyzes regressions, acts through a typed tool surface, and wakes up unprompted when runs complete. Users who prefer their own agent (Claude Code, Codex, custom) consume Canonry through the same CLI/API surface or subscribe via webhook. It tracks how ChatGPT, Gemini, Claude, and Perplexity cite your site, detects regressions, diagnoses causes, coordinates fixes, and reports results.
|
|
6
6
|
|
|
7
7
|
AEO (Answer Engine Optimization) is about making sure your content shows up accurately in AI-generated answers. As search shifts from links to synthesized responses, you need something that can monitor, analyze, and act across these engines continuously.
|
|
8
8
|
|
|
@@ -12,48 +12,65 @@ AEO (Answer Engine Optimization) is about making sure your content shows up accu
|
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npm install -g @ainyc/canonry
|
|
15
|
-
canonry
|
|
15
|
+
canonry init
|
|
16
|
+
canonry serve
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Interactive prompts guide you through provider keys, or pass everything as flags:
|
|
19
20
|
|
|
20
21
|
```bash
|
|
21
|
-
canonry
|
|
22
|
+
canonry init --gemini-key <key> --openai-key <key>
|
|
23
|
+
canonry serve
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
Open [http://localhost:4100](http://localhost:4100) for the web dashboard. Aero's command bar sits at the bottom of every project page.
|
|
27
|
+
|
|
28
|
+
### Talking to Aero (built-in agent)
|
|
29
|
+
|
|
30
|
+
From the CLI:
|
|
25
31
|
|
|
26
32
|
```bash
|
|
27
|
-
|
|
28
|
-
canonry agent
|
|
33
|
+
# One-shot turn — Aero picks the right tools and analyzes on its own.
|
|
34
|
+
canonry agent ask my-project "Why did the last run fail? Recommend a fix."
|
|
35
|
+
|
|
36
|
+
# Pick a specific LLM:
|
|
37
|
+
ANTHROPIC_API_KEY=... canonry agent ask my-project "…" --provider anthropic
|
|
38
|
+
ZAI_API_KEY=... canonry agent ask my-project "…" --provider zai
|
|
29
39
|
```
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
Aero uses whichever LLM has an API key configured in `~/.canonry/config.yaml`
|
|
42
|
+
or exported (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`,
|
|
43
|
+
`ZAI_API_KEY`). Conversations persist across invocations per project.
|
|
32
44
|
|
|
33
|
-
|
|
45
|
+
Aero also wakes up **unprompted** after each run completes — analyzing the
|
|
46
|
+
new data and writing the result back to the project's transcript so you see
|
|
47
|
+
it next time you open the bar or run `canonry agent ask`.
|
|
34
48
|
|
|
35
|
-
|
|
49
|
+
### Bringing your own agent (webhook)
|
|
50
|
+
|
|
51
|
+
If you'd rather drive Canonry from Claude Code, Codex, or a custom agent,
|
|
52
|
+
wire a webhook to receive run/insight events:
|
|
36
53
|
|
|
37
54
|
```bash
|
|
38
|
-
|
|
39
|
-
canonry init
|
|
40
|
-
canonry serve
|
|
55
|
+
canonry agent attach my-project --url https://my-agent.example.com/hooks/canonry
|
|
41
56
|
```
|
|
42
57
|
|
|
43
|
-
|
|
58
|
+
Your agent receives `run.completed`, `insight.critical`, `insight.high`, and
|
|
59
|
+
`citation.gained` notifications. Detach with `canonry agent detach my-project`.
|
|
44
60
|
|
|
45
|
-
|
|
61
|
+
## How agents use Canonry
|
|
46
62
|
|
|
47
|
-
|
|
48
|
-
- **Analyzes** regressions, emerging opportunities, and correlates visibility shifts with site changes
|
|
49
|
-
- **Operates** across your content, schema markup, indexing submissions, and `llms.txt` to coordinate fixes and generate action-oriented reports
|
|
50
|
-
- **Remembers** client context across sessions: canonical domains, historical patterns, known issues
|
|
63
|
+
Canonry's CLI and API are the agent interface — no special SDK, no MCP layer, no virtual filesystem. Every command supports `--format json`; every dashboard view has a matching API endpoint.
|
|
51
64
|
|
|
52
|
-
|
|
65
|
+
- **Monitor** visibility sweeps across providers on a schedule, tracking citation changes over time
|
|
66
|
+
- **Analyze** regressions, emerging opportunities, and correlations with site changes
|
|
67
|
+
- **Coordinate** fixes across content, schema markup, indexing submissions, and `llms.txt`
|
|
68
|
+
- **Report** results in a machine-readable form agents can act on
|
|
53
69
|
|
|
54
70
|
## Features
|
|
55
71
|
|
|
56
|
-
- **
|
|
72
|
+
- **Built-in AI agent (Aero).** Reads state, analyzes regressions, fires write tools (`run_sweep`, `dismiss_insight`, `update_schedule`, etc.), wakes up unprompted after runs. Backed by [`pi-agent-core`](https://github.com/badlogic/pi-mono) — 15+ LLM providers, streaming first.
|
|
73
|
+
- **Agent-first.** Every CLI command supports `--format json`; every UI view has a matching API endpoint.
|
|
57
74
|
- **Multi-provider.** Query Gemini, OpenAI, Claude, Perplexity, and local LLMs from a single platform.
|
|
58
75
|
- **Config-as-code.** Kubernetes-style YAML files. Version control your monitoring, let agents apply changes declaratively.
|
|
59
76
|
- **Self-hosted.** Runs locally with SQLite. No cloud account required.
|
|
@@ -64,17 +81,17 @@ Every action the agent takes goes through the same CLI and API available to ever
|
|
|
64
81
|
|
|
65
82
|
## How It Works
|
|
66
83
|
|
|
67
|
-
|
|
84
|
+
A typical cycle — run manually or from an external agent:
|
|
68
85
|
|
|
69
86
|
```bash
|
|
70
87
|
canonry apply canonry.yaml --format json # define projects from YAML specs
|
|
71
88
|
canonry run my-project --wait --format json # sweep all providers
|
|
72
89
|
canonry evidence my-project --format json # inspect citation evidence
|
|
73
|
-
canonry insights my-project --format json #
|
|
90
|
+
canonry insights my-project --format json # DB-backed insight analysis
|
|
74
91
|
canonry health my-project --format json # visibility health snapshot
|
|
75
92
|
```
|
|
76
93
|
|
|
77
|
-
|
|
94
|
+
Schedule cron-based sweeps with `canonry schedule` and subscribe an agent webhook via `canonry agent attach` to act on results as they land.
|
|
78
95
|
|
|
79
96
|
## Config-as-Code
|
|
80
97
|
|
|
@@ -148,9 +165,7 @@ Integration setup guides: [Google Search Console](docs/google-search-console-set
|
|
|
148
165
|
|
|
149
166
|
## Skills
|
|
150
167
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
**Claude Code** also picks up the skill automatically from `.claude/skills/canonry-setup/` when you open this repo.
|
|
168
|
+
Canonry ships a bundled `canonry-setup` skill that documents the CLI commands, provider setup, analysis workflows, and troubleshooting patterns an agent needs to operate the platform. **Claude Code** picks up the skill automatically from `.claude/skills/canonry-setup/` when you open this repo.
|
|
154
169
|
|
|
155
170
|
## Deployment
|
|
156
171
|
|
|
@@ -9,13 +9,13 @@ All data access goes through the canonry CLI. Never read the SQLite database dir
|
|
|
9
9
|
canonry <command> --format json
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
The canonry server must be running for most commands. Verify
|
|
12
|
+
The canonry server must be running for most commands. Verify by hitting the health endpoint (`GET /health`) or by listing projects:
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
canonry
|
|
15
|
+
canonry project list --format json
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
If the server isn't running, start it with `canonry serve
|
|
18
|
+
If the server isn't running, start it with `canonry serve`.
|
|
19
19
|
|
|
20
20
|
## Key Commands
|
|
21
21
|
|
|
@@ -78,7 +78,6 @@ Provider APIs have rate limits. Follow these guidelines:
|
|
|
78
78
|
|
|
79
79
|
Reference skills are available in `skills/` for domain-specific guidance:
|
|
80
80
|
|
|
81
|
-
- `skills/aero/` -- Aero agent skill definition
|
|
82
81
|
- `skills/canonry-setup/` -- Canonry installation and configuration reference
|
|
83
82
|
|
|
84
83
|
## Error Handling
|
|
@@ -8,10 +8,11 @@ repository: https://github.com/AINYC/aero
|
|
|
8
8
|
|
|
9
9
|
# Aero Orchestration Skill
|
|
10
10
|
|
|
11
|
-
You coordinate across
|
|
12
|
-
- **canonry** for
|
|
13
|
-
- **aeo-audit**
|
|
14
|
-
|
|
11
|
+
You coordinate across two tools to deliver comprehensive AEO monitoring:
|
|
12
|
+
- **canonry** — the source of truth for project state (runs, snapshots, timelines, insights, audit log). Query it with `canonry <command> --format json`; never maintain a parallel copy in agent memory.
|
|
13
|
+
- **aeo-audit** — on-demand site analysis and fix generation.
|
|
14
|
+
|
|
15
|
+
Persist only *user-scoped* context (operator preferences, communication style) in your platform's native memory. Project-scoped facts live in canonry and must be read back, not remembered.
|
|
15
16
|
|
|
16
17
|
## Judgment Rules
|
|
17
18
|
|
|
@@ -34,10 +35,6 @@ You coordinate across three tools to deliver comprehensive AEO monitoring:
|
|
|
34
35
|
- Be specific: "You lost the ChatGPT citation for 'roof repair phoenix' between March 28-April 2" not "your visibility decreased"
|
|
35
36
|
- Action-oriented: every observation ends with a recommended next step
|
|
36
37
|
|
|
37
|
-
## Reference
|
|
38
|
+
## Reference Playbooks
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
- [memory-patterns.md](references/memory-patterns.md) — What to persist per client
|
|
41
|
-
- [regression-playbook.md](references/regression-playbook.md) — Detection through response
|
|
42
|
-
- [reporting.md](references/reporting.md) — Report generation templates
|
|
43
|
-
- [wordpress-elementor-mcp.md](references/wordpress-elementor-mcp.md) — Elementor MCP tools for page management
|
|
40
|
+
Detailed playbooks (workflows, regression diagnosis, reporting templates, integrations) are bundled as separate docs. Call `list_skill_docs` to see what's available, then `read_skill_doc({ slug })` to load one when a task matches. Don't guess slugs — list first.
|
|
@@ -1,37 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-patterns
|
|
3
|
+
description: When to remember vs. re-query — project state lives in canonry, only durable user-scoped facts go in Aero memory. Read when unsure whether to call remember or look up.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Memory Patterns
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
Canonry is the source of truth for project state. Do **not** maintain a parallel copy of project facts in Aero memory — it will drift from the DB and mislead the next session.
|
|
9
|
+
|
|
10
|
+
Aero now ships with a built-in durable notes store — the `remember`, `forget`, and `recall` tools — backed by the `agent_memory` table. The N most-recently-updated notes are injected into the system prompt at every session start, so you usually see relevant memory without calling `recall`.
|
|
11
|
+
|
|
12
|
+
## What belongs where
|
|
13
|
+
|
|
14
|
+
| Scope | Examples | Home |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| **Project state** | Baselines, historical regressions, citation rates per keyword/provider, recent insights, sweep history, audit trail | Canonry DB — query via CLI / API / read tools |
|
|
17
|
+
| **Operator facts** | Personal preferences, non-observable context ("content lead is Sarah", "migrating off Webflow next quarter"), tone/voice preferences the operator confirmed | Aero memory (`remember`) |
|
|
18
|
+
| **Session scratch** | "I just tried X and it failed", intermediate reasoning, turn-local state | Nowhere — let it die with the session |
|
|
19
|
+
|
|
20
|
+
## How to read project state from canonry
|
|
4
21
|
|
|
5
|
-
|
|
22
|
+
Prefer Aero's read tools (`get_status`, `get_health`, `get_timeline`, `get_insights`, `list_keywords`, `list_competitors`, `get_run`) over shelling out, but the CLI exists for operators too:
|
|
6
23
|
|
|
24
|
+
```bash
|
|
25
|
+
canonry status <project> --format json
|
|
26
|
+
canonry health <project> --format json
|
|
27
|
+
canonry timeline <project> --since <YYYY-MM-DD> --format json
|
|
28
|
+
canonry insights <project> --format json
|
|
29
|
+
canonry evidence <project> --format json
|
|
30
|
+
canonry audit <project> --format json
|
|
7
31
|
```
|
|
8
|
-
Client: <business name>
|
|
9
|
-
Domain: <domain>
|
|
10
|
-
Project: <project slug>
|
|
11
32
|
|
|
12
|
-
|
|
13
|
-
Overall cited rate: <X>% (<N>/<total> keyword-provider pairs)
|
|
14
|
-
Best provider: <provider> (<X>% cited)
|
|
15
|
-
Worst provider: <provider> (<X>% cited)
|
|
16
|
-
Top keyword: "<keyword>" (cited on <N>/<total> providers)
|
|
17
|
-
Worst keyword: "<keyword>" (cited on <N>/<total>)
|
|
33
|
+
If the data you need isn't reachable with a single read tool or CLI call, that's a bug in canonry's API surface — file it rather than working around it in memory.
|
|
18
34
|
|
|
19
|
-
|
|
20
|
-
<domain> — <trend description>
|
|
35
|
+
## Regenerate, don't remember
|
|
21
36
|
|
|
22
|
-
|
|
23
|
-
<page type> drives <X>% of citations
|
|
37
|
+
Derived interpretations (trend summaries, correlations between events) are cheap to recompute from the underlying DB rows. Prefer running the analysis again on fresh data over recalling what you concluded last session — conclusions age, the data doesn't.
|
|
24
38
|
|
|
25
|
-
|
|
26
|
-
- <description>
|
|
39
|
+
## Using `remember` / `forget` / `recall`
|
|
27
40
|
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
- `remember(key, value)` — upsert a project-scoped note. Capped at 2 KB per value. Same key replaces the prior value, so use stable keys (e.g. `operator-pref.reporting-tone`, not `note-2026-04-17`).
|
|
42
|
+
- `forget(key)` — remove a single note. Returns `status: missing` when the key never existed (non-fatal).
|
|
43
|
+
- `recall(limit?)` — read notes newest-first. Usually unnecessary — the top 20 are already in the system prompt under `<memory>`. Reach for it when you need older context or the full value of a note that's been summarized.
|
|
44
|
+
|
|
45
|
+
**Reserved prefix.** Keys starting with `compaction:` are reserved for LLM-summarized transcript slices. `remember` and `forget` both reject them. Compaction notes are pruned automatically — you can `recall` them but never write or delete them by hand.
|
|
46
|
+
|
|
47
|
+
**CLI parity.** Operators can manage memory without talking to you:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
canonry agent memory list <project> --format json
|
|
51
|
+
canonry agent memory set <project> --key <k> --value <v>
|
|
52
|
+
canonry agent memory forget <project> --key <k>
|
|
30
53
|
```
|
|
31
54
|
|
|
32
|
-
##
|
|
55
|
+
## Good remember candidates
|
|
56
|
+
|
|
57
|
+
- Operator-confirmed facts canonry can't observe (team names, migration plans, vendor lock-in, upcoming content bets).
|
|
58
|
+
- Stable preferences the operator has validated at least once ("report weekly", "prefer Claude over GPT for prose", "never auto-dismiss insights").
|
|
59
|
+
- Non-obvious decisions made mid-investigation that a future turn would re-derive wastefully ("confirmed competitor X is out of scope").
|
|
60
|
+
|
|
61
|
+
## Bad remember candidates
|
|
33
62
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
63
|
+
- Anything canonry already tracks (runs, insights, citation rates, schedules). Query it.
|
|
64
|
+
- Turn-local state that's useful for one follow-up and then noise ("user just asked about keyword Y").
|
|
65
|
+
- Raw evidence or long transcripts — persist a conclusion, not a dump.
|
|
66
|
+
- Unvalidated guesses. Memory isn't a place to think aloud; it's a place to record things you're willing to act on next session.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wordpress-elementor-mcp
|
|
3
|
+
description: WordPress + Elementor MCP integration guide — prerequisites, auth, widget manipulation. Read only when the task involves editing WordPress/Elementor pages.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Elementor + WordPress MCP Development Guide
|
|
2
7
|
|
|
3
8
|
## Overview
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aero-soul
|
|
3
|
+
description: Aero's persona, values, and voice — context-agnostic identity that applies whether Aero runs as the built-in agent or wraps around an external agent shell.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Who You Are
|
|
7
|
+
|
|
8
|
+
You are **Aero** — an AEO analyst. You help operators understand how AI answer engines cite their domain, and you act decisively on what the data shows.
|
|
9
|
+
|
|
10
|
+
## Values
|
|
11
|
+
|
|
12
|
+
- **Evidence over opinion.** Numbers before interpretation. "You lost the ChatGPT citation for 'roof repair phoenix' between March 28 and April 2" beats "your visibility decreased."
|
|
13
|
+
- **Proactive, not passive.** Regressions don't wait to be asked about. Surface them when you spot them. Flag emerging competitors the moment they appear in citations you own.
|
|
14
|
+
- **Honest about uncertainty.** When the data is ambiguous, say so. Don't manufacture confidence. Don't promise fixes will appear in the next sweep — AEO changes take weeks.
|
|
15
|
+
- **Cautious with writes.** Sweeps cost quota. Schedules shape downstream notifications. Keywords define what gets tracked. Confirm intent before mutating state the operator will notice.
|
|
16
|
+
- **Canonry is the source of truth.** Read state back; never maintain a parallel copy in your head. Conclusions age, the data doesn't.
|
|
17
|
+
|
|
18
|
+
## Voice
|
|
19
|
+
|
|
20
|
+
Concise, peer-to-peer, action-oriented. The operator is a practitioner — skip the disclaimers and the 101 explanations. Every observation ends with a next step.
|
|
21
|
+
|
|
22
|
+
Analyst energy: sharp, confident, direct. You don't sugarcoat bad news, but you lead with what to do about it. No hedging filler, no emoji, no corporate warmth. Just signal.
|
|
23
|
+
|
|
24
|
+
You have opinions. If a client's setup is actively hurting them, say so plainly.
|
|
25
|
+
|
|
26
|
+
## Boundaries
|
|
27
|
+
|
|
28
|
+
- Never fabricate citation data. If you haven't run a sweep, say so.
|
|
29
|
+
- Never speculate why an AI cited a competitor without evidence — stick to what canonry observed.
|
|
30
|
+
- Private client data stays private.
|
|
@@ -298,51 +298,51 @@ canonry sitemap inspect <project>
|
|
|
298
298
|
|
|
299
299
|
## Agent
|
|
300
300
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
301
|
+
Canonry ships the built-in **Aero** agent (backed by pi-agent-core) for users
|
|
302
|
+
who don't already have one, plus a webhook integration for users who want to
|
|
303
|
+
drive Canonry from Claude Code / Codex / a custom agent.
|
|
304
|
+
|
|
305
|
+
### Built-in Aero (one-shot CLI)
|
|
305
306
|
|
|
306
307
|
```bash
|
|
307
|
-
#
|
|
308
|
-
canonry agent
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
canonry agent
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
canonry agent setup --agent-provider <id> # LLM provider (default: anthropic)
|
|
324
|
-
canonry agent setup --agent-key <key> # API key for agent LLM
|
|
325
|
-
canonry agent setup --agent-model <model> # model id (e.g. anthropic/claude-sonnet-4-6)
|
|
326
|
-
canonry agent setup --gateway-port 3579 # gateway WebSocket port
|
|
327
|
-
canonry agent setup --gemini-key <key> # monitoring provider keys (passed to init)
|
|
328
|
-
canonry agent setup --openai-key <key>
|
|
329
|
-
canonry agent setup --claude-key <key>
|
|
330
|
-
canonry agent setup --perplexity-key <key>
|
|
331
|
-
|
|
332
|
-
# Webhook lifecycle
|
|
333
|
-
canonry agent attach <project> # register agent webhook for project
|
|
334
|
-
canonry agent attach <project> --format json # JSON output
|
|
335
|
-
canonry agent detach <project> # remove agent webhook from project
|
|
336
|
-
canonry agent detach <project> --format json # JSON output
|
|
308
|
+
# One-shot turn — Aero picks its own tools, streams events to stdout.
|
|
309
|
+
canonry agent ask <project> "<prompt>"
|
|
310
|
+
canonry agent ask <project> "<prompt>" --format json # JSON event stream
|
|
311
|
+
|
|
312
|
+
# Select a specific provider / model (otherwise auto-detected from config).
|
|
313
|
+
canonry agent ask <project> "<prompt>" --provider anthropic --model claude-opus-4-7
|
|
314
|
+
canonry agent ask <project> "<prompt>" --provider zai --model glm-5.1
|
|
315
|
+
canonry agent ask <project> "<prompt>" --provider openai
|
|
316
|
+
canonry agent ask <project> "<prompt>" --provider google
|
|
317
|
+
|
|
318
|
+
# Restrict the tool surface. Default is --scope all (full 13-tool surface:
|
|
319
|
+
# 7 read + 6 write). --scope read-only exposes only the 7 read tools and
|
|
320
|
+
# is what the dashboard bar uses by default so pasted "Copy as CLI"
|
|
321
|
+
# commands can't enable writes the UI turn couldn't perform.
|
|
322
|
+
canonry agent ask <project> "<prompt>" --scope read-only
|
|
323
|
+
canonry agent ask <project> "<prompt>" --scope all
|
|
337
324
|
```
|
|
338
325
|
|
|
339
|
-
**
|
|
326
|
+
**Provider detection order** when `--provider` is omitted: `anthropic` →
|
|
327
|
+
`openai` → `google` → `zai`, whichever has an API key present first
|
|
328
|
+
(from `~/.canonry/config.yaml` providers block, or the matching env var
|
|
329
|
+
`ANTHROPIC_API_KEY` / `OPENAI_API_KEY` / `GEMINI_API_KEY` / `ZAI_API_KEY`).
|
|
330
|
+
|
|
331
|
+
Conversations **persist per project** — `canonry agent ask` continues the
|
|
332
|
+
same rolling thread each invocation. Reset with `DELETE /api/v1/projects/<name>/agent/transcript`
|
|
333
|
+
or via the dashboard bar's reset button.
|
|
340
334
|
|
|
341
|
-
|
|
335
|
+
### External agents (webhook)
|
|
342
336
|
|
|
343
|
-
|
|
337
|
+
```bash
|
|
338
|
+
# Wire an external agent webhook to a project
|
|
339
|
+
canonry agent attach <project> --url <webhook-url> # register webhook subscription
|
|
340
|
+
canonry agent attach <project> --url <url> --format json # JSON output
|
|
341
|
+
canonry agent detach <project> # remove the agent webhook
|
|
342
|
+
canonry agent detach <project> --format json # JSON output
|
|
343
|
+
```
|
|
344
344
|
|
|
345
|
-
**Agent webhooks
|
|
345
|
+
**Agent webhooks** fire on `run.completed`, `insight.critical`, `insight.high`, and `citation.gained`. The attach/detach pair is idempotent per project (one agent webhook per project, matched by source tag).
|
|
346
346
|
|
|
347
347
|
## Output Formats
|
|
348
348
|
|