create
Creates a new file or folder. Can also be used to upload files.
Synopsis
Implements the API documented at https://developers.google.com/drive/api/v3/reference/files/create
gsm files create [flags]
Options
--appProperties strings A collection of arbitrary key-value pairs which are private to the requesting app.
Entries with null values are cleared in update and copy requests.
--copyRequiresWriterPermission Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
--createdTime string The time at which the file was created (RFC 3339 date-time).
--description string A short description of the file.
--fields string Fields allows partial responses to be retrieved.
See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
--folderColorRgb string The color for a folder as an RGB hex string.
The supported colors are published in the folderColorPalette field of the About resource.
If an unsupported color is specified, the closest color in the palette will be used instead.
-h, --help help for create
--id string The ID of the file.
--ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file.
Domain administrators can choose to make all uploaded files visible to the domain by default;
this parameter bypasses that behavior for the request.
Permissions are still inherited from parent folders.
--includePermissionsForView string Specifies which additional view's permissions to include in the response.
Only 'published' is supported.
--indexableText string Text to be indexed for the file to improve fullText queries.
This is limited to 128KB in length and may contain HTML elements.
--keepRevisionForever Whether to set the 'keepForever' field in the new head revision.
This is only applicable to files with binary content in Google Drive.
Only 200 revisions for the file can be kept forever.
If the limit is reached, try deleting pinned revisions.
--localFilePath string Path to a file or folder on the local disk.
--mimeType string The target MIME type of the file.
Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided.
The value cannot be changed unless a new revision is uploaded.
If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible.
The supported import formats are published in the About resource.
--modifiedTime string The last time the file was modified by anyone (RFC 3339 date-time).
Note that setting modifiedTime will also update modifiedByMeTime for the user.
--name string The name of the file. This is not necessarily unique within a folder.
Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant.
--ocrLanguage string A language hint for OCR processing during image import (ISO 639-1 code).
--originalFilename string The original filename of the uploaded content if available, or else the original value of the name field.
This is only available for files with binary content in Google Drive.
--parent string The single parent of the file.
--properties strings A collection of arbitrary key-value pairs which are visible to all apps.
Entries with null values are cleared in update and copy requests.
--readOnly Whether the content of the file is read-only.
If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified.
--readOnlyReason string Reason for why the content of the file is restricted.
This is only mutable on requests that also set readOnly=true.
--sourceMimeType string The MIME type of the source file to upload.
Set this to "text/csv" and "mimeType" to "application/vnd.google-apps.spreadsheet" in order to import a CSV file as a Sheet
--starred Whether the user has starred the file.
--targetId string The ID of the file that this shortcut points to.
--thumbnailImage string The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
--thumbnailMimeType string The MIME type of the thumbnail.
--useContentAsIndexableText Whether users with only writer permission can modify the file's permissions.
Not populated for items in shared drives.
--viewedByMeTime string The last time the file was viewed by the user (RFC 3339 date-time).
--writersCanShare Whether users with only writer permission can modify the file's permissions.
Not populated for items in shared drives.
Options inherited from parent commands
--compressOutput By default, GSM outputs "pretty" (indented) objects. By setting this flag, GSM's output will be compressed. This may or may not improve performance in scripts.
--config string config file (default is $HOME/.config/gsm/.gsm.yaml)
--delay int This delay (plus a random jitter between 0 and 50) will be applied after every command to avoid reaching quota and rate limits. Set to 0 to disable.
--dwdSubject string Specify a subject used for DWD impersonation (overrides value in config file)
--log string Set the path of the log file. Default is either ~/gsm.log or defined in your config file
--maxElapsedTime int This is the maximum total time that will be spent retrying a request in minutes. (default 15)
--maxRetryInterval int This is the maximum interval that will be used between retry attempts in seconds. (default 320)
--redirectPort int This is the TCP port on which GSM will create web server if you authenticate with a user account for the first time. This is necessary for the OAuth flow. See https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback (default 8081)
--retryOn ints Specify the HTTP error code(s) that GSM should retry on. Note that GSM will always retry on HTTP 403 errors that indicate a quota / rate limit error
--streamOutput Setting this flag will cause GSM to output slice values to stdout one by one, instead of one large object
SEE ALSO
- gsm files - Managed files (Part of Drive API)
- gsm files create batch - Batch creates new files or folders. Can also be used to upload files using a CSV file as input.