Skip to main content

mr resource from-local

Create a Resource from a file already present on the server's filesystem. Differs from upload (which streams bytes over HTTP) in that the server reads the file in place. The --path flag is required and must resolve on the target server. Useful for bulk-importing existing files or deploying pre-staged assets.

Usage

mr resource from-local

Examples

Create from a server-local path

mr resource from-local --path /var/mahresources/incoming/photo.jpg

With metadata

mr resource from-local --path /srv/imports/doc.pdf --name "Doc" --tags 3,7

Flags

FlagTypeDefaultDescription
--pathstring``Local server path (required) (required)
--namestring``Resource name
--descriptionstring``Resource description
--tagsstring``Comma-separated tag IDs
--groupsstring``Comma-separated group IDs
--owner-iduint0Owner group ID
--metastring``Meta JSON string

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output

Resource object with id

Exit Codes

0 on success; 1 on any error

See Also