Interact with a BookStack wiki through its REST API using the bundled Python script. No external dependencies beyond Python 3 standard library.
Credentials live in ~/.clawdbot/clawdbot.json under the bookstack skill entry:
{
"skills": {
"entries": {
"bookstack": {
"env": {
"BOOKSTACK_URL": "https://your-bookstack.example.com",
"BOOKSTACK_TOKEN_ID": "your-token-id",
"BOOKSTACK_TOKEN_SECRET": "your-token-secret"
}
}
}
}
}
Generate a token from BookStack: Profile > API Tokens > Create Token. The user's role needs the "Access System API" permission enabled.
All commands follow the pattern:
python3 scripts/bookstack.py <command> [args] [options]
Pass the env vars from the config above when executing.
| Action | Command | ||
|---|---|---|---|
| -------- | --------- | ||
| Search | `search "query" [--type page\ | book\ | chapter]` |
| List pages | list_pages [--count N] | ||
| Read page | `get_page | --markdown]` | |
| Create page | create_page --book-id | ||
| Update page | update_page | ||
| Delete page | delete_page |
The same CRUD pattern applies to books, chapters, and shelves. For the full command list with all flags and options, see references/api-commands.md.
User-Agent header because BookStack instances behind Cloudflare reject requests without one (HTTP 403). If you get a 403, this is likely why.--markdown for Markdown input. When reading, get_page --content returns HTML, --markdown returns Markdown.共 1 个版本