shortcuts
Classes
SkillSyncResult
Bases: BaseModel
Outcome of syncing one skill file via Shortcuts.sync_skill or one file
within a directory via Shortcuts.sync_skills.
Attributes:
| Name | Type | Description |
|---|---|---|
action |
Literal['created', 'updated', 'unchanged', 'skipped', 'failed']
|
What happened to this file. |
id |
Optional[str]
|
The Open WebUI id of the skill, when known. |
name |
Optional[str]
|
The display name of the skill, when known. |
path |
Optional[str]
|
The local file path this result refers to. |
error |
Optional[str]
|
For |
Shortcuts
Shortcuts(client: OpenWebUI)
A collection of convenience methods (shortcuts) that combine multiple API calls into single, easy-to-use workflows.
Access these via client.shortcuts.
- Code Reference client Classes OpenWebUI Attributes shortcuts
Source code in src/owui_client/shortcuts.py
Functions
sync_skill
sync_skill(path: str | Path) -> SkillSyncResult
Idempotently sync a local skill Markdown file to Open WebUI.
Parses the file (see owui_client.skillfiles), then reconciles it
against existing skills returned by SkillsClient.export_skills:
- No match (by id or by name): creates the skill. If the server
rejects the create with an
ID_TAKEN(HTTP 400) error — indicating another skill already owns that id but was not returned by export — falls back to updating the skill by id. - Match, unchanged: content, name, and description all equal the
existing skill. Returns
"unchanged"and performs NO write, so the server'supdated_atis not bumped. - Match, changed: updates the matched skill by id.
Never deletes, toggles, or modifies access grants. When updating,
access_grants is omitted (None + exclude_none) so existing
grants on the server are preserved.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to a Markdown skill file with YAML frontmatter
(non-empty |
required |
Returns:
| Type | Description |
|---|---|
SkillSyncResult
|
|
Raises:
| Type | Description |
|---|---|
`InvalidSkillFileError`
|
If the file has no/invalid frontmatter or is
missing a required field (propagated from |
HTTPStatusError
|
On any other server error (re-raised). |
Examples:
Source code in src/owui_client/shortcuts.py
sync_skills
sync_skills(dir_path: str | Path) -> list[SkillSyncResult]
Recursively sync every valid skill file under a directory.
Discovers all .md files under dir_path (arbitrary depth) via
discover_skill_files, then reconciles each valid skill against the
server using the same create / unchanged / update logic as
Shortcuts.sync_skill. Existing skills are fetched once via
SkillsClient.export_skills.
- Files that are not valid skills, or that collide on a duplicate
normalized id, are reported as
"skipped"and never sent to the server. - A server error on one file is recorded as
"failed"and does not abort the rest of the directory. - Nothing is ever deleted, toggled, or access-changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_path
|
str | Path
|
Directory to scan recursively. |
required |
Returns:
| Type | Description |
|---|---|
list[SkillSyncResult]
|
A list of |
Raises:
| Type | Description |
|---|---|
`InvalidSkillFileError`
|
If |