Command line#
plone-client is installed with the cli extra.
Options of each command lists the arguments and options of every command, and plone-client <command> --help prints the same.
The examples on this page run against the Compose site, with the sample content of Run a Plone site for testing.
export PLONE_CLIENT_URL=http://localhost:8080/Plone
export PLONE_CLIENT_USERNAME=admin
export PLONE_CLIENT_PASSWORD=admin
Global options#
Option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Profile to use. |
|
str |
no |
— |
Site URL, instead of a profile; the password comes from $PLONE_CLIENT_PASSWORD. |
|
str |
no |
— |
Login name, with –url. |
|
file |
no |
— |
Configuration file. |
|
flag |
no |
— |
Refuse any change to the site. |
|
flag |
no |
— |
Print the changes instead of sending them. |
|
str |
no |
— |
Comma separated keys to keep in the output, such as ‘@id,title,review_state’. |
|
flag |
no |
— |
Print JSON on one line. |
|
flag |
no |
— |
Log each request to stderr. |
|
flag |
no |
— |
Show the version. |
|
flag |
no |
— |
Install completion for the current shell. |
|
flag |
no |
— |
Show completion for the current shell, to copy it or customize the installation. |
-p, --config, -n, -f, -c, and -v work anywhere on the line.
--url, -u, --read-only, and --version 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, converted to blocks; see Block types of converted pages. Needs the |
|
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. |
|
|
|
|
|
|
|
|
Advanced#
Command |
Does |
|---|---|
Send any request, for services without a command. |
|
Serve sites as an MCP server over standard input and output, or over HTTP; see MCP server. Needs the |
|
|
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. If the site rejected the profile’s credentials, the output has |
|
|
|
|
|
|
In the group rows, / separates the panels of the group’s help: Browse, then Write, then Membership or Connection.
Options of each command#
aliases#
Browse, add, and remove URL aliases (redirects) of items.
Subcommands: add, list, remove.
aliases add#
Make old paths redirect to an item.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Item the aliases point to. |
|
str |
yes |
— |
Old paths. |
aliases list#
List the aliases of an item, or every redirect of the site.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
|
Item; the site root lists every redirect. |
|
str |
no |
— |
Filter, on the site root. |
aliases remove#
Remove aliases.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Item the aliases point to. |
|
str |
yes |
— |
Alias paths. |
block-types#
List the blocks of the site, or show one (Volto’s @blocks-schema).
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Block whose docs, schema and variations to show. |
|
str |
no |
— |
Only the blocks that editors can add to this item. |
|
flag |
no |
— |
Print Markdown instead of JSON. |
blocks#
Summarize the blocks of an item, nested ones included.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path (/news/item), site URL, uid:<UID> or resolveuid link. |
|
flag |
no |
— |
List the links found in each block. |
copy#
Copy items into a folder.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Items to copy. |
|
str |
yes |
— |
Folder to copy into. |
create#
Create an item inside a folder.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path of the folder. |
|
str |
yes |
— |
Content type, such as Document. |
|
str |
no |
— |
Title. |
|
str |
no |
— |
Id (short name). |
|
str |
no |
— |
Description. |
|
str |
no |
— |
JSON object with field values; @file.json reads a file, - reads stdin. |
|
str |
no |
— |
Field value: key=text, or key:=json (subjects:=’[“a”]’). Repeatable. |
|
flag |
no |
|
Add title and description blocks when no blocks are given. |
|
str |
no |
— |
Run this workflow transition after creating, e.g. publish. |
|
flag |
no |
— |
Print the whole item, not a summary. |
create-page#
Create a page from Markdown or HTML, converted to blocks.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path of the folder. |
|
str |
yes |
— |
Markdown or HTML file; - reads standard input. |
|
flag |
no |
— |
The source is HTML, not Markdown. |
|
str |
no |
— |
Title; the leading # heading by default. |
|
str |
no |
— |
Description. |
|
str |
no |
|
Content type, with blocks. |
|
str |
no |
— |
Id (short name). |
|
str |
no |
— |
JSON object with field values; @file.json reads a file, - reads stdin. |
|
str |
no |
— |
Field value: key=text, or key:=json (subjects:=’[“a”]’). Repeatable. |
|
path |
no |
— |
File or image to upload inside the page. |
|
int range |
no |
— |
Position of the lead image among the files, 1 for the first; the first image by default. |
|
flag |
no |
— |
Do not set a lead image. |
|
str |
no |
— |
Run this workflow transition at the end, e.g. publish. |
|
str |
no |
— |
Block types to produce, as JSON, such as ‘{“codeBlock”: {“style”: “light”}, “slateTable”: false}’; merged over the profile’s. |
create-with-files#
Create an item with files and images inside it, and set its lead image.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path of the folder. |
|
str |
yes |
— |
Content type, such as ‘News Item’. |
|
path |
yes |
— |
Files and images to upload inside the item. |
|
str |
no |
— |
Title. |
|
str |
no |
— |
Description. |
|
str |
no |
— |
Id (short name). |
|
str |
no |
— |
JSON object with field values; @file.json reads a file, - reads stdin. |
|
str |
no |
— |
Field value: key=text, or key:=json (subjects:=’[“a”]’). Repeatable. |
|
int range |
no |
— |
Position of the lead image among the files, 1 for the first; the first image by default. |
|
flag |
no |
— |
Do not set a lead image. |
|
str |
no |
— |
Run this workflow transition at the end, e.g. publish. |
delete#
Delete items.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Items to delete. |
|
flag |
no |
— |
Do not ask. |
download#
Download the file or image of an item.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path (/news/item), site URL, uid:<UID> or resolveuid link. |
|
path |
no |
— |
File to write; - for stdout. |
|
str |
no |
— |
Field holding the file. |
get#
Print an item.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
|
Path (/news/item), site URL, uid:<UID> or resolveuid link. |
|
str |
no |
— |
Component to expand: breadcrumbs, translations… |
|
flag |
no |
— |
Serialize contained items in full. |
|
flag |
no |
|
Include the contained items. |
|
str |
no |
— |
Version from the history. |
groups#
Browse, create, and remove groups, and manage their members.
Subcommands: add-member, create, delete, get, list, remove-member.
groups add-member#
Add users to a group.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Group id. |
|
str |
yes |
— |
User ids. |
groups create#
Create a group.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Group id. |
|
str |
no |
— |
Title. |
|
str |
no |
— |
Description. |
|
str |
no |
— |
Global role. Repeatable. |
groups delete#
Delete a group.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Group id. |
|
flag |
no |
— |
Do not ask. |
groups get#
Show a group and its members.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Group id. |
groups list#
List groups.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Text in the id. |
groups remove-member#
Remove users from a group.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Group id. |
|
str |
yes |
— |
User ids. |
history#
List the versions and workflow history of an item.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path (/news/item), site URL, uid:<UID> or resolveuid link. |
info#
Show which site and user the client connects with.
ls#
List the items inside a folder, in order.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
|
Path (/news/item), site URL, uid:<UID> or resolveuid link. |
|
str |
no |
— |
Only this type. |
|
str |
no |
— |
Extra catalog column; _all for all. |
|
int |
no |
|
Maximum number of items. |
mcp#
Serve sites as an MCP server, over standard input and output or HTTP.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Profile to serve; repeat it for several sites. |
|
str |
no |
— |
Group of profiles to serve (see ‘profile groups’). |
|
flag |
no |
— |
Serve every profile. |
|
str |
no |
— |
Offer only this tool; repeat it for several. |
|
flag |
no |
— |
Serve over streamable HTTP, with a bearer token. |
|
str |
no |
|
Address to listen on, with –http. |
|
int |
no |
|
Port to listen on, with –http. |
mcp-token#
Manage the token MCP clients send to ‘plone-client mcp –http’.
Subcommands: delete, generate, set.
mcp-token delete#
Remove the token from the keyring.
mcp-token generate#
Make a new random token, store it in the keyring, and print it.
mcp-token set#
Store a token of your own in the keyring; it needs 32 characters.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
flag |
no |
— |
Read the token from standard input. |
move#
Move items into a folder.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Items to move. |
|
str |
yes |
— |
Folder to move into. |
order#
Move an item within its folder.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path of the folder. |
|
str |
yes |
— |
Id of the item to move. |
|
str |
yes |
— |
top, bottom, up, down, or a number of positions (-2 is two up). |
profile#
Manage connection profiles; secrets are kept in the system keyring.
Subcommands: add, defaults, group-remove, group-set, groups, list, remove, set-secret, show, test, use.
profile add#
Add a profile, and store its secret in the keyring.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Profile name. |
|
str |
yes |
— |
URL of the site root. |
|
str |
no |
— |
Login name; empty for anonymous. |
|
str |
no |
|
One of basic, jwt, token. |
|
str |
no |
|
Where the secret is: keyring, env, command, none. |
|
str |
no |
|
Variable holding the secret, with –secret env. |
|
str |
no |
— |
Command printing the secret, with –secret command. |
|
flag |
no |
— |
Refuse changes to this site. |
|
str |
no |
— |
The only workflow transition run on this site; repeat it to allow more. Without it, every transition runs. |
|
float |
no |
— |
Seconds to wait for the site. |
|
str |
no |
— |
Verify TLS certificates: true, false, or a CA bundle path. |
|
int |
no |
— |
Times a request is repeated after a network error. |
|
float |
no |
— |
Base delay in seconds between retries. |
|
str |
no |
— |
URL of the Volto frontend, when –url is the backend; used to list the site’s blocks. |
|
str |
no |
— |
Block types that Markdown and HTML become on this site, as JSON, such as ‘{“codeBlock”: true}’. |
|
str |
no |
— |
Free text. |
|
flag |
no |
— |
Read the secret from standard input. |
|
flag |
no |
— |
Make it the current profile. |
|
flag |
no |
— |
Replace an existing profile. |
profile defaults#
Show or change the connection settings shared by every profile.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
float |
no |
— |
Seconds to wait for the site. |
|
str |
no |
— |
Verify TLS certificates: true, false, or a CA bundle path. |
|
int |
no |
— |
Times a request is repeated after a network error. |
|
float |
no |
— |
Base delay in seconds between retries. |
|
flag |
no |
— |
Refuse changes to every site. |
|
str |
no |
— |
Remove a setting: timeout, verify, retries, backoff, api_prefix, read_only. |
profile group-remove#
Remove a group; its profiles are kept.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Group name. |
profile group-set#
Create a group of profiles, or replace its profiles.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Group name. |
|
str |
yes |
— |
Profiles in the group. |
profile groups#
List the groups of profiles.
profile list#
List the profiles; the current one is marked.
profile remove#
Remove a profile and its secret.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Profile name. |
|
flag |
no |
— |
Leave the secret in the keyring. |
profile set-secret#
Store or replace the secret of a profile in the keyring.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Profile name. |
|
flag |
no |
— |
Read the secret from standard input. |
profile show#
Show the settings of a profile (never its secret).
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Profile name; the current one by default. |
profile test#
Connect with a profile and report who the client is logged in as.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Profile name; the current one by default. |
profile use#
Make a profile the current one.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Profile name. |
registry#
Browse and change the site’s registry records.
Subcommands: get, list, set.
registry get#
Print the value of a record.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Record name. |
registry list#
List records with their values.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Text the record name must contain. |
|
int |
no |
|
Maximum number of records. |
registry set#
Change the value of a record.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Record name. |
|
str |
yes |
— |
New value, as JSON (“text”, 10, true, [..]). |
request#
Send any request to the site, for services without a command.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
GET, POST, PATCH, PUT or DELETE. |
|
str |
yes |
— |
Path with the service, such as /news/@workflow. |
|
str |
no |
— |
Query parameter key=value. Repeatable. |
|
str |
no |
— |
JSON body; @file.json or - for stdin. |
|
str |
no |
— |
Header ‘Name: value’. Repeatable. |
resolve#
Print the path, URL and UID of an item.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path (/news/item), site URL, uid:<UID> or resolveuid link. |
search#
Search the catalog, inside a folder (the whole site by default).
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
|
Path (/news/item), site URL, uid:<UID> or resolveuid link. |
|
str |
no |
— |
Full-text search. |
|
str |
no |
— |
Content type. |
|
str |
no |
— |
Workflow state. |
|
int |
no |
— |
Levels below the folder: 0 is itself, 1 its children. |
|
str |
no |
— |
Other index: Subject=plone, or key:=json for options. Repeatable. |
|
str |
no |
— |
Index to sort on. |
|
flag |
no |
— |
Sort descending. |
|
str |
no |
— |
Extra catalog column; _all for all. |
|
flag |
no |
— |
Return full serializations (slow). |
|
int |
no |
|
Maximum number of results. |
|
flag |
no |
— |
Print only the number of results. |
skill#
Show or install the agent skill that teaches coding agents this tool.
Subcommands: install, show.
skill install#
Install the skill, replacing an older copy.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
flag |
no |
— |
Install in ~/.claude/skills, for every project. |
|
path |
no |
— |
Skills directory to install in; .claude/skills by default. |
skill show#
Print the skill’s SKILL.md, or another file of the skill.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
|
File of the skill, such as references/ |
types#
List content types, or show the JSON schema of one.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Type whose schema to show. |
|
str |
no |
— |
List only the types that can be added in this folder. |
update#
Change fields of an item.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path (/news/item), site URL, uid:<UID> or resolveuid link. |
|
str |
no |
— |
Title. |
|
str |
no |
— |
Description. |
|
str |
no |
— |
JSON object with field values; @file.json reads a file, - reads stdin. |
|
str |
no |
— |
Field value: key=text, or key:=json (subjects:=’[“a”]’). Repeatable. |
|
str |
no |
— |
Token of a lock held on the item. |
|
flag |
no |
— |
Print the whole item, not a summary. |
upload#
Upload files as File or Image items.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path of the folder. |
|
file |
yes |
— |
Files to upload. |
|
str |
no |
— |
Content type; Image or File by default. |
|
str |
no |
— |
Title (one file only). |
|
str |
no |
— |
Id (one file only). |
|
flag |
no |
— |
Send in chunks, for large files. |
upload-tree#
Upload a local folder as pages, files and images, keeping its structure.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
directory |
yes |
— |
Local folder whose contents to upload. |
|
str |
yes |
— |
Folder of the site to upload into. |
|
str |
no |
|
Content type for folders. |
|
flag |
no |
— |
Turn Markdown and HTML files into pages (needs the ‘markdown’ extra); |
|
flag |
no |
— |
Also upload names starting with a dot. |
|
str |
no |
— |
Run this workflow transition at the end, e.g. publish. |
|
str |
no |
— |
Block types to produce, as JSON, such as ‘{“codeBlock”: {“style”: “light”}, “slateTable”: false}’; merged over the profile’s. |
users#
Browse, create, change, and remove users.
Subcommands: create, delete, get, list, update.
users create#
Create a user; by default the user gets an email to set the password.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Login name. |
|
str |
no |
— |
Email address. |
|
str |
no |
— |
Full name. |
|
str |
no |
— |
Global role. Repeatable. |
|
str |
no |
— |
Group. Repeatable. |
|
flag |
no |
|
Email the user a link to set the password. |
|
flag |
no |
— |
Read the password from standard input. |
|
str |
no |
— |
More fields, JSON. |
users delete#
Delete a user.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
User id. |
|
flag |
no |
— |
Do not ask. |
users get#
Show a user.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
User id. |
users list#
List users.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Text in id, name or email. |
|
str |
no |
— |
Only members of this group. |
|
int |
no |
|
Maximum number of users. |
users update#
Change a user; roles:=’{“Editor”: true}’ grants a role.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
User id. |
|
str |
no |
— |
Field: key=text or key:=json. Repeatable. |
|
str |
no |
— |
Fields, JSON. |
vocabulary#
List vocabularies, or the terms of one.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
no |
— |
Vocabulary name; without it, list the vocabularies. |
|
str |
no |
— |
Filter terms by title. |
|
int |
no |
|
Maximum number of terms. |
workflow#
Show the workflow state of an item, or run a transition.
Argument or option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
yes |
— |
Path (/news/item), site URL, uid:<UID> or resolveuid link. |
|
str |
no |
— |
Transition to run; without it, list the available ones. |
|
str |
no |
— |
Comment for the history. |
|
str |
no |
— |
Publication date, ISO 8601. |
|
str |
no |
— |
Expiration date, ISO 8601. |
|
flag |
no |
— |
Also run it on the items inside a folder. |
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.
ls prints a list of items, each with its @id, its @type, and the columns of the catalog.
plone-client ls /about
[
{
"@id": "http://localhost:8080/Plone/about/team",
"@type": "Document",
"description": "The people behind the site.",
"effective": "1969-12-31T00:00:00+00:00",
"end": null,
"getObjSize": "0 KB",
"getRemoteUrl": null,
"head_title": null,
"image_field": "",
"image_scales": null,
"mime_type": "text/plain",
"nav_title": null,
"review_state": "private",
"start": null,
"title": "Team",
"type_title": "Page"
}
]
search prints the same list.
--count prints only the total.
plone-client search -t Image -f @id,title,image_field
[
{
"@id": "http://localhost:8080/Plone/media/logo.png",
"title": "Logo",
"image_field": "image"
}
]
plone-client search -t Image --count
{
"items_total": 1
}
Commands that create or change an item print @id, @type, UID, id, title, and review_state.
plone-client update /about/team --description "The people behind the site"
{
"@id": "http://localhost:8080/Plone/about/team",
"@type": "Document",
"UID": "d5ad47d7684449d4b73788eaa13d8b76",
"id": "team",
"title": "Team",
"review_state": "private"
}
-f keeps the keys you name, and -c puts the result on one line.
plone-client update /about/team --description "The people behind the site" -f id,review_state -c
{"id": "team", "review_state": "private"}
--full prints the whole item, which has every field of its content type.
plone-client update /about/team --description "The people behind the site" --full -c | jq 'length'
39
-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.
On an answer with items, as request returns, it applies to the answer itself as soon as one of the keys is at its top level.
A key that is not there is left out without an error, and an entry with none of the keys prints as {}.
plone-client ls /about -f id -c
[{}]
ls and search results have no id key: use @id.
Errors and exit codes#
Errors are JSON on standard error.
plone-client get /missing
{
"error": {
"status_code": 404,
"type": "NotFound",
"message": "Resource not found: http://localhost:8080/Plone/++api++/missing",
"method": "GET",
"url": "http://localhost:8080/Plone/++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.