←
SIYUAN-3
Created: 2026-02-02
•
Updated: 2026-02-02
Relationships
Loading...
Attachments
Loading...
Comments (3)
qa-agent
·
2026-02-02
[QA] ✅ VERIFIED - All 7 document commands implemented correctly. Test suite passes 76/76 tests (100%). Code quality excellent, follows project standards. See /tmp/qa-SIYUAN-3.md for detailed report.
agent
·
2026-02-02
## Implementation Complete
Implemented all 7 document commands as specified:
### Client Methods Added to SiyuanClient (siyuan.py:140-208)
- `create_doc_with_md(notebook, path, markdown)` - Creates document via /api/filetree/createDocWithMd
- `rename_doc_by_id(doc_id, title)` - Renames via /api/filetree/renameDocByID
- `remove_doc_by_id(doc_id)` - Removes via /api/filetree/removeDocByID
- `move_docs_by_id(from_ids, to_id)` - Moves via /api/filetree/moveDocsByID
- `get_path_by_id(doc_id)` - Gets storage path via /api/filetree/getPathByID
- `get_hpath_by_id(doc_id)` - Gets human-readable path via /api/filetree/getHPathByID
- `export_md_content(doc_id)` - Exports markdown via /api/export/exportMdContent
### CLI Commands Added (siyuan.py:664-756)
- `siyuan doc create NOTEBOOK PATH MARKDOWN`
- `siyuan doc rename DOC_ID TITLE`
- `siyuan doc remove DOC_ID`
- `siyuan doc move DOC_IDS... TO_ID` (supports multiple source IDs)
- `siyuan doc path DOC_ID`
- `siyuan doc hpath DOC_ID`
- `siyuan doc export DOC_ID`
### Tests
- Unit tests: tests/test_doc.py (25 tests) - All passing
- Integration tests: tests/integration/test_doc_live.py (6 tests) - Ready for live server
### Verification
```
$ make test
76 passed, 22 deselected in 0.19s
```
All doc command tests pass with mocked API responses. Integration tests require SIYUAN_TOKEN to be set.
triage-agent
·
2026-02-02
## Feature Triage Complete
**Status:** NOT IMPLEMENTED
**Summary:** Document commands do not exist in the CLI. The current implementation only supports notebook operations. All 7 requested document commands (create, rename, remove, move, path, hpath, export) need to be implemented.
**Implementation Location:**
- Client methods: `SiyuanClient` class in `siyuan.py`
- Handlers: New `handle_doc_*` functions
- CLI: New `doc` command group with 7 subcommands
- Tests: `tests/test_doc.py` and `tests/integration/test_doc_live.py`
**Complexity:** Low-Medium (~350 lines total including tests)
**Key Finding:** Clear patterns exist from notebook commands to follow. All SiYuan API endpoints are documented at https://github.com/siyuan-note/siyuan/blob/master/API.md
See attached triage report for full implementation details including API specifications, response formats, and testing strategy.