Command line#
plone-client is installed with the cli extra.
Run plone-client <command> --help for the options of each command.
Global options#
Option |
Meaning |
Anywhere on the line |
|---|---|---|
|
Profile to use; also |
Yes |
|
Configuration file; also |
Yes |
|
Site URL, instead of a profile; the password comes from |
No |
|
Login name, with |
No |
|
Refuse any change to the site. |
No |
|
Print the changes instead of sending them. |
Yes |
|
Comma-separated keys to keep in the output. |
Yes |
|
Print JSON on one line. |
Yes |
|
Log each request to standard error. |
Yes |
|
Print the version. |
No |
Options marked “No” must come before the command, because profile add has options with the same names.
Commands#
plone-client --help lists the commands in the groups below, and each command group splits its subcommands into Browse (read only) and Write panels.
In a terminal, the help draws each group as a box.
When the output goes to a pipe or a file, as it does for scripts and coding agents, the help is plain text with the same groups as titled sections.
To get plain help in a terminal too, set TYPER_USE_RICH=0.
<ref> accepts a path, a URL inside the site, uid:<UID>, or a resolveuid link.
Read content#
Command |
Does |
|---|---|
|
Print an item. |
|
List the items inside a folder, in order. |
|
Search the catalog, inside a folder or the whole site. |
|
Print the path, URL, and UID of an item. |
|
Summarize the blocks of an item, nested ones included. |
|
List the versions and workflow history of an item. |
|
Show the local roles of an item. |
Change content#
Command |
Does |
|---|---|
|
Create an item inside a folder. |
|
Create a page from Markdown, or HTML with |
|
Create an item, upload files and images inside it, and set its lead image; |
|
Change fields of an item. |
|
Show the workflow state and transitions of an item, or run a transition. |
|
Copy items into a folder. |
|
Move items into a folder. |
|
Move an item within its folder: |
|
Delete items. |
Files#
Command |
Does |
|---|---|
|
Upload files as |
|
Upload the contents of a local folder as pages, files, and images, keeping its structure; |
|
Download the file or image of an item. |
Site users, settings, and types#
Command |
Does |
|---|---|
|
List content types, or show the JSON schema of one. |
|
List the blocks of the site, or show the docs, schema, and variations of one; |
|
List vocabularies, or the terms of one. |
|
Browse and manage users. |
|
Browse and manage groups and their members. |
|
Browse and change registry records. |
|
Browse and manage URL aliases. |
Advanced#
Command |
Does |
|---|---|
|
Send any request, for services without a command. |
|
Serve sites as an MCP server over standard input and output: the selected profile, or several with |
create-page, create-with-files, and upload-tree run the operations of plone_client.operations and print their result: created, changed, and every request in requests.
When one of them stops part way, the error on standard error also has a result with what was already done, and the exit code is that of the request that failed.
Connection, profiles, and agents#
Command |
Does |
|---|---|
|
Show the profile, site, and user the command line connects with, and the Plone version. |
|
Manage connection profiles; |
|
List, create or replace, and remove groups of profiles; see Groups. |
|
Print the agent skill, or install it in |
In the group rows, / separates the panels of the group’s help: Browse, then Write, then Membership or Connection.
Field values#
create and update merge field values from these options, each one winning over the previous.
Order |
Option |
Value |
|---|---|---|
1 |
|
A JSON object, |
2 |
|
|
3 |
|
The title and the description. |
create adds a title block and a description block to an item created without blocks, unless given --no-blocks.
Output#
Results are JSON on standard output, indented unless -c is given.
Commands that create or change an item print @id, @type, UID, id, title, and review_state, unless given --full.
-f keeps the listed keys of an item, of each item in a list, and of each entry in the items of a folder or a search.
Errors and exit codes#
Errors are JSON on standard error.
{
"error": {
"status_code": 404,
"type": "NotFound",
"message": "Resource not found: https://example.org/++api++/missing",
"method": "GET",
"url": "https://example.org/++api++/missing"
}
}
Code |
Meaning |
|---|---|
0 |
Success. |
1 |
Unexpected error, or a refused confirmation. |
2 |
Invalid usage, invalid JSON, or a destructive command without |
3 |
Configuration: unknown profile, missing secret, or no site configured. |
4 |
Not authenticated, not allowed, or the item is locked. |
5 |
Not found. |
6 |
Invalid request or conflict. |
7 |
Refused by |
8 |
The site could not be reached. |
9 |
Server error. |
Confirmation#
delete, users delete, and groups delete ask for confirmation.
Without a terminal they require --yes.
With --dry-run they need neither.