feat(cli): add clean analysis export with markdown/json output

This commit is contained in:
zphinx
2026-05-11 21:54:21 +02:00
parent 92ce7da28f
commit 2d8a5a66ca
7 changed files with 206 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ The tool may suggest remediation commands in output, but does not execute them.
- Live probe mode (`uname -a`)
- Diagnostics collection mode
- AI analysis mode
- Optional analysis export via `--output-file <path>` (`--output-format markdown|json`)
- Interactive loop with `/collect`, `/analyze`, `/help`, `/quit`
### AI and Prompting
@@ -164,6 +165,25 @@ tai run "docker daemon keeps failing" \
--runbooks ~/.tai/runbooks
```
### Write Analysis to File
```bash
tai run "sshd authentication failed" \
--host bastion01 \
--collect --analyze \
--output-file ./reports/sshd-analysis.md
```
JSON export:
```bash
tai run "sshd authentication failed" \
--host bastion01 \
--collect --analyze \
--output-file ./reports/sshd-analysis.json \
--output-format json
```
## Runbook Workflow
1. Write Markdown runbooks in `runbooks/` with frontmatter keys: `service`, `symptoms`, `tags`.
@@ -192,7 +212,7 @@ pytest tests/test_plan.py tests/test_ai.py tests/test_cli.py
## Known Limits
- Deep service-specific probes (known binary/config/package aliases) are richer for recognized services than generic service names.
- Session memory is available via `--session-memory`, but dedicated history UX commands (`tai history`, `/history`) are not implemented yet.
- Clipboard export is intentionally not implemented.
## Changelog and Roadmap