# drive

> Every coline drive command, with its flags and the action it runs.

Source: https://docs.coline.app/cli/reference/drive

{/* Generated by apps/docs/scripts/cli-reference.ts from coline's command tree and the cli action catalog. Don't edit it: run `pnpm --filter @colineapp/docs cli:reference`. */}

Drive: upload, download and every drive action. Every `coline drive` command, 42 in all.

## drive upload

Upload files and whole folders to Drive, as Drive's upload does: large files go in parts straight to storage. A folder arrives as a folder of the same name with everything in it; a link inside it that leads out of it is skipped, as are empty files and files Drive won't take, and the exit code is 1 unless --skip-ok. Progress goes to stderr; with --json, one line per file as each finishes, and one with skipped: true and the reason for each file left out.

If an upload stops (Ctrl-C, a dropped connection), run the same command with --resume within a day to carry on where it left off. - reads stdin, named with --name.

```text
coline drive upload <path…> [flags]
```

**Built into coline.** · **Calls** `drive.drives.list`, `drive.files.list`, `drive.folders.create`, `POST /api/workspaces/[workspaceSlug]/uploads/initiate`, `GET /api/workspaces/[workspaceSlug]/uploads/part`, `POST /api/workspaces/[workspaceSlug]/uploads/complete`, `POST /api/workspaces/[workspaceSlug]/uploads/abort` · **Effect** write · **Can wait for your approval** no

| Flag            | What it does                                                                                         |
| --------------- | ---------------------------------------------------------------------------------------------------- |
| `--to <folder>` | The folder to upload into: its link from Drive or its id (default: the top of your drive)            |
| `--drive <id>`  | The drive, when --to is a folder id outside your default drive (coline drive drives list)            |
| `--name <name>` | The file's name in Drive; needed for stdin (-)                                                       |
| `--resume`      | Carry on uploads that stopped, from the parts already sent.                                          |
| `--skip-ok`     | Exit 0 when files were left out (a link out of the folder, an empty file, a type Drive doesn't take) |

```bash
coline drive upload report.pdf
coline drive upload ./photos --to 'https://coline.app/acme/drive?driveId=d_1&parentId=f_2'
pg_dump app | gzip | coline drive upload - --name backup.sql.gz --json
```

## drive download

Download a file from Drive, named by its link or id: its bytes are saved as they come, under its own name here or -o \<path> (-o - writes to stdout). A note, doc, sheet or board comes as a Coline package (.coline). A folder, or several things at once, comes as the zip Drive makes; --unzip unpacks it into a folder instead, refusing any entry that would land outside it.

Nothing is written over without --force. If a file's download stops, run it again with --resume to carry on. --url prints a short-lived storage link instead of downloading.

```text
coline drive download <file|folder…> [flags]
```

**Built into coline.** · **Calls** `drive.files.preview.get`, `GET /api/workspaces/[workspaceSlug]/files/[fileId]/download`, `POST /api/workspaces/[workspaceSlug]/drive/download` · **Effect** read, changes nothing · **Can wait for your approval** no

| Flag                  | What it does                                                               |
| --------------------- | -------------------------------------------------------------------------- |
| `-o, --output <path>` | Where to save it; a folder saves inside it; - writes to stdout.            |
| `--unzip`             | Unpack a folder's zip into a folder (default name: the folder's)           |
| `--force`             | Replace a file that already exists.                                        |
| `--resume`            | Carry on a file's download that stopped.                                   |
| `--url`               | Print a storage link to the file, for a minute, instead of downloading it. |

```bash
coline drive download 'https://coline.app/acme/drive?driveId=d_1&fileId=f_2'
coline drive download f_2 -o report.pdf --resume
coline drive download 'https://coline.app/acme/drive?driveId=d_1&parentId=f_9' --unzip -o reports
```

## drive cat

Print a file from Drive to stdout, named by its link or id. A file that isn't text is printed only when stdout isn't a terminal, or with --force.

```text
coline drive cat <file> [flags]
```

**Built into coline.** · **Calls** `drive.files.preview.get`, `GET /api/workspaces/[workspaceSlug]/files/[fileId]/download` · **Effect** read, changes nothing · **Can wait for your approval** no

| Flag      | What it does                                         |
| --------- | ---------------------------------------------------- |
| `--force` | Print a file that isn't text to the terminal anyway. |

```bash
coline drive cat f_2
coline drive cat 'https://coline.app/acme/drive?driveId=d_1&fileId=f_2' | head
coline drive cat f_3 > photo.png
```

## drive sync

Make a Drive folder match a folder here (--up), or a folder here match a Drive folder (--down): one way per run, named every time. A file missing on the far side is sent; one whose size differs, or that changed later on the near side, is replaced. Drive gives no content hash, so a file edited to the same size on both sides at once isn't noticed.

Nothing that exists is changed without --confirm: replacing a changed file (on Drive, the old copy goes to the trash) and, with --delete, removing what the near side doesn't have. Without it, sync lists those and changes nothing. Notes, docs and sheets are not files and are skipped. --dry-run lists everything it would do.

```text
coline drive sync <local folder> <Drive folder> [flags]
```

**Built into coline.** · **Calls** `drive.drives.list`, `drive.files.list`, `drive.folders.create`, `drive.files.trash`, `POST /api/workspaces/[workspaceSlug]/uploads/initiate`, `GET /api/workspaces/[workspaceSlug]/uploads/part`, `POST /api/workspaces/[workspaceSlug]/uploads/complete`, `POST /api/workspaces/[workspaceSlug]/uploads/abort`, `GET /api/workspaces/[workspaceSlug]/files/[fileId]/download` · **Effect** destructive, removes or overwrites · **Can wait for your approval** no

| Flag           | What it does                                                          |
| -------------- | --------------------------------------------------------------------- |
| `--up`         | Send the folder here to Drive.                                        |
| `--down`       | Bring the Drive folder here.                                          |
| `--delete`     | Also remove what the near side doesn't have (needs --confirm)         |
| `--drive <id>` | The drive, when the Drive folder is an id outside your default drive. |

```bash
coline drive sync ./site 'https://coline.app/acme/drive?driveId=d_1&parentId=f_2' --up --dry-run
coline drive sync ./site f_2 --up --confirm
coline drive sync ./reports f_9 --down --delete --confirm --json
```

## drive import

Import a Coline package (.coline) into Drive, as Drive's Import does: the notes, docs, sheets, boards and folders in it arrive as they were. coline drive download saves a note, doc, sheet, board or folder as one.

```text
coline drive import <file.coline> [flags]
```

**Built into coline.** · **Calls** `drive.drives.list`, `drive.files.list`, `POST /api/workspaces/[workspaceSlug]/drive/import` · **Effect** write · **Can wait for your approval** no

| Flag            | What it does                                                                              |
| --------------- | ----------------------------------------------------------------------------------------- |
| `--to <folder>` | The folder to import into: its link from Drive or its id (default: the top of your drive) |
| `--drive <id>`  | The drive, when --to is a folder id outside your default drive.                           |

```bash
coline drive import Plan.coline
coline drive import Plan.coline --to 'https://coline.app/acme/drive?driveId=d_1&parentId=f_2'
coline drive import Plan.coline -w acme --json
```

## drive drives create

Makes a new shared drive in the team workspace. Only the workspace's owner can.

```text
coline drive drives create [flags]
```

**Action** `drive.drives.create` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                   | What it does                                                  |
| ---------------------- | ------------------------------------------------------------- |
| `--name <text>`        | Required.                                                     |
| `--access-mode <text>` | Default restricted. One of `workspace_default`, `restricted`. |
| `--input <file>`       | Read the input as JSON from a file; - reads stdin.            |

```bash
coline drive drives create -w acme --name "…"
coline drive drives create -w acme --json '{"name":"…"}' --fields id
```

## drive drives list

Lists the drives the person can open in this workspace (their personal drive, the team's shared drives).

It changes nothing.

```text
coline drive drives list [flags]
```

**Action** `drive.drives.list` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag             | What it does                                       |
| ---------------- | -------------------------------------------------- |
| `--input <file>` | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive drives list -w acme
coline drive drives list -w acme --json '{}' --fields id
```

## drive drives mount

Adds a drive the person can open to their sidebar, optionally hidden from teammates' graph.

```text
coline drive drives mount [flags]
```

**Action** `drive.drives.mount` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag              | What it does                                       |
| ----------------- | -------------------------------------------------- |
| `--drive-id <id>` | Drive id from list\_drives. Required.              |
| `--is-private`    | Default false.                                     |
| `--input <file>`  | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive drives mount -w acme --drive-id <drive-id>
coline drive drives mount -w acme --json '{"driveId":"<drive-id>"}' --fields id
```

## drive drives mounts

Lists the drives the person keeps in their sidebar.

It changes nothing.

```text
coline drive drives mounts [flags]
```

**Action** `drive.drives.mounts` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag             | What it does                                       |
| ---------------- | -------------------------------------------------- |
| `--input <file>` | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive drives mounts -w acme
coline drive drives mounts -w acme --json '{}' --fields id
```

## drive drives permissions get

Reads who may open, edit or manage a drive. Needs manage access.

It changes nothing.

```text
coline drive drives permissions get [flags]
```

**Action** `drive.drives.permissions.get` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag              | What it does                                       |
| ----------------- | -------------------------------------------------- |
| `--drive-id <id>` | Drive id from list\_drives. Required.              |
| `--input <file>`  | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive drives permissions get -w acme --drive-id <drive-id>
coline drive drives permissions get -w acme --json '{"driveId":"<drive-id>"}' --fields id
```

## drive drives permissions set

Sets whether everyone in the workspace can open a drive, or only the teammates and roles given.

Set grants with --json '\{…}' or --input.

```text
coline drive drives permissions set [flags]
```

**Action** `drive.drives.permissions.set` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                   | What it does                                        |
| ---------------------- | --------------------------------------------------- |
| `--drive-id <id>`      | Drive id from list\_drives. Required.               |
| `--access-mode <text>` | Required. One of `workspace_default`, `restricted`. |
| `--input <file>`       | Read the input as JSON from a file; - reads stdin.  |

```bash
coline drive drives permissions set -w acme --drive-id <drive-id> --access-mode workspace_default
coline drive drives permissions set -w acme --json '{"driveId":"<drive-id>","accessMode":"workspace_default"}' --fields id
```

## drive drives rename

Renames a shared drive the person manages.

```text
coline drive drives rename [flags]
```

**Action** `drive.drives.rename` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag              | What it does                                       |
| ----------------- | -------------------------------------------------- |
| `--drive-id <id>` | Drive id from list\_drives. Required.              |
| `--name <text>`   | Required.                                          |
| `--input <file>`  | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive drives rename -w acme --drive-id <drive-id> --name "…"
coline drive drives rename -w acme --json '{"driveId":"<drive-id>","name":"…"}' --fields id
```

## drive drives unmount

Takes a drive out of the person's sidebar. Their own drive and the workspace's stay.

```text
coline drive drives unmount [flags]
```

**Action** `drive.drives.unmount` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag              | What it does                                       |
| ----------------- | -------------------------------------------------- |
| `--drive-id <id>` | Drive id from list\_drives. Required.              |
| `--input <file>`  | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive drives unmount -w acme --drive-id <drive-id>
coline drive drives unmount -w acme --json '{"driveId":"<drive-id>"}' --fields id
```

## drive files copy

Makes a copy of a file or a whole folder in a drive and folder the person can add to.

```text
coline drive files copy [flags]
```

**Action** `drive.files.copy` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                           | What it does                                                          |
| ------------------------------ | --------------------------------------------------------------------- |
| `--file-id <id>`               | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--destination-drive-id <id>`  | Drive id from list\_drives. Required.                                 |
| `--destination-parent-id <id>` | Folder id from list\_drive\_files.                                    |
| `--name <text>`                |                                                                       |
| `--input <file>`               | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files copy -w acme --file-id <file-id> --destination-drive-id <destination-drive-id>
coline drive files copy -w acme --json '{"fileId":"<file-id>","destinationDriveId":"<destination-drive-id>"}' --fields id
```

## drive files create

Creates an empty file of a type Coline knows (a note, doc, sheet, board, folder or an app's file type) in a drive.

```text
coline drive files create [flags]
```

**Action** `drive.files.create` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                 | What it does                                                         |
| -------------------- | -------------------------------------------------------------------- |
| `--drive-id <id>`    | Drive id from list\_drives. Required.                                |
| `--parent-id <id>`   | Folder id from list\_drive\_files.                                   |
| `--name <text>`      | Required.                                                            |
| `--file-type <text>` | A file type key, e.g. note, doc, sheet, taskboard, folder. Required. |
| `--input <file>`     | Read the input as JSON from a file; - reads stdin.                   |

```bash
coline drive files create -w acme --drive-id <drive-id> --name "…" --file-type "…"
coline drive files create -w acme --json '{"driveId":"<drive-id>","name":"…","fileType":"…"}' --fields id
```

## drive files delete-permanently

Permanently deletes a file or folder that's already in trash, with everything in it. This can't be undone.

It removes or overwrites something, so it runs only with --confirm.

```text
coline drive files delete-permanently [flags]
```

**Action** `drive.files.deletePermanently` · **Effect** destructive, runs only with `--confirm` · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files delete-permanently -w acme --file-id <file-id> --confirm
coline drive files delete-permanently -w acme --json '{"fileId":"<file-id>"}' --fields id --confirm
```

## drive files list

Lists files and folders in a drive or folder, or the person's recent or starred files. Follow nextCursor for more.

It changes nothing.

```text
coline drive files list [flags]
```

**Action** `drive.files.list` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag                 | What it does                                                                                                                                      |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--drive-id <id>`    | Default: the person's default drive.                                                                                                              |
| `--parent-id <id>`   | A folder; default: the drive's top level.                                                                                                         |
| `--view <text>`      | recent and starred span every drive; picker lists what can be picked to attach. Default default. One of `default`, `recent`, `starred`, `picker`. |
| `--limit <number>`   | Default 50.                                                                                                                                       |
| `--cursor <text>`    |                                                                                                                                                   |
| `--file-type <text>` | Only folders.                                                                                                                                     |
| `--trashed`          | What's in the trash instead. Default false.                                                                                                       |
| `--input <file>`     | Read the input as JSON from a file; - reads stdin.                                                                                                |

```bash
coline drive files list -w acme
coline drive files list -w acme --json '{}' --fields id
```

## drive files permissions get

Reads who else may open, edit or manage a file beyond its drive. Needs manage access.

It changes nothing.

```text
coline drive files permissions get [flags]
```

**Action** `drive.files.permissions.get` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files permissions get -w acme --file-id <file-id>
coline drive files permissions get -w acme --json '{"fileId":"<file-id>"}' --fields id
```

## drive files permissions set

Sets whether a file follows its drive's access or is restricted, and which teammates or roles may open, edit or manage it.

Set grants with --json '\{…}' or --input.

```text
coline drive files permissions set [flags]
```

**Action** `drive.files.permissions.set` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                   | What it does                                                          |
| ---------------------- | --------------------------------------------------------------------- |
| `--file-id <id>`       | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--access-mode <text>` | Required. One of `inherit`, `restricted`.                             |
| `--input <file>`       | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files permissions set -w acme --file-id <file-id> --access-mode inherit
coline drive files permissions set -w acme --json '{"fileId":"<file-id>","accessMode":"inherit"}' --fields id
```

## drive files preview get

How a Drive file previews for you: the app's own rendering when an installed app made it, a plain card naming the app when it can't render, or just the file's name and type for everything else (notes, docs, sheets, uploads). To read what a file says, use drive.files.read.

It changes nothing.

```text
coline drive files preview get [flags]
```

**Action** `drive.files.preview.get` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag               | What it does                                                                                                          |
| ------------------ | --------------------------------------------------------------------------------------------------------------------- |
| `--file-id <id>`   | The file's id, from drive.files.list or search. Required.                                                             |
| `--variant <text>` | preview for the full preview, inline for the small card shown in a chat. Default preview. One of `preview`, `inline`. |
| `--input <file>`   | Read the input as JSON from a file; - reads stdin.                                                                    |

```bash
coline drive files preview get -w acme --file-id <file-id>
coline drive files preview get -w acme --json '{"fileId":"<file-id>"}' --fields id
```

## drive files publish get

Whether a note is published to the web, and its address.

It changes nothing.

```text
coline drive files publish get [flags]
```

**Action** `drive.files.publish.get` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files publish get -w acme --file-id <file-id>
coline drive files publish get -w acme --json '{"fileId":"<file-id>"}' --fields id
```

## drive files publish password

Sets or removes the password on a published note.

```text
coline drive files publish password [flags]
```

**Action** `drive.files.publish.password` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                | What it does                                                          |
| ------------------- | --------------------------------------------------------------------- |
| `--file-id <id>`    | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--password <text>` | Required.                                                             |
| `--input <file>`    | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files publish password -w acme --file-id <file-id> --password "…"
coline drive files publish password -w acme --json '{"fileId":"<file-id>","password":"…"}' --fields id
```

## drive files read

Reads a Drive file's text (extracted from PDFs, Office files and Coline's own formats), a window at a time: pass nextOffset as offset to keep reading, or a query for the most relevant excerpt.

It changes nothing.

```text
coline drive files read [flags]
```

**Action** `drive.files.read` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag                   | What it does                                                |
| ---------------------- | ----------------------------------------------------------- |
| `--file-id <id>`       | File id from list\_drive\_files, search or fetch. Required. |
| `--query <text>`       |                                                             |
| `--max-chars <number>` | Default 6000.                                               |
| `--offset <number>`    | Default 0.                                                  |
| `--input <file>`       | Read the input as JSON from a file; - reads stdin.          |

```bash
coline drive files read -w acme --file-id <file-id>
coline drive files read -w acme --json '{"fileId":"<file-id>"}' --fields id
```

## drive files restore

Brings a file or folder back from trash.

```text
coline drive files restore [flags]
```

**Action** `drive.files.restore` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files restore -w acme --file-id <file-id>
coline drive files restore -w acme --json '{"fileId":"<file-id>"}' --fields id
```

## drive files shares get

Reads how a file is shared: with whom, and whether people outside can open it by link.

It changes nothing.

```text
coline drive files shares get [flags]
```

**Action** `drive.files.shares.get` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files shares get -w acme --file-id <file-id>
coline drive files shares get -w acme --json '{"fileId":"<file-id>"}' --fields id
```

## drive files shares update

Shares a file with people by name or email (they're told), and sets who else may open it: only them, anyone signed in to Coline, or anyone with the link.

It reaches people outside Coline right away.

Set recipients with --json '\{…}' or --input.

```text
coline drive files shares update [flags]
```

**Action** `drive.files.shares.update` · **Effect** external, reaches people outside Coline · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                           | What it does                                                          |
| ------------------------------ | --------------------------------------------------------------------- |
| `--file-id <id>`               | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--general-access-mode <text>` | Required. One of `restricted`, `coline_users`, `anyone`.              |
| `--public-password <text>`     |                                                                       |
| `--create-authenticated-link`  |                                                                       |
| `--input <file>`               | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files shares update -w acme --file-id <file-id> --general-access-mode restricted
coline drive files shares update -w acme --json '{"fileId":"<file-id>","recipients":"…","generalAccessMode":"restricted"}' --fields id
```

## drive files star

Stars a file for the person (it shows in their starred files), or unstars it if it's starred.

```text
coline drive files star [flags]
```

**Action** `drive.files.star` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--starred`      | true stars it, false unstars it; leave it out to toggle.              |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files star -w acme --file-id <file-id>
coline drive files star -w acme --json '{"fileId":"<file-id>"}' --fields id
```

## drive files tags add

Adds a tag to a file, like project/launch. New tags join the workspace's tag list.

```text
coline drive files tags add [flags]
```

**Action** `drive.files.tags.add` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--tag <text>`   | Required.                                                             |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files tags add -w acme --file-id <file-id> --tag "…"
coline drive files tags add -w acme --json '{"fileId":"<file-id>","tag":"…"}' --fields id
```

## drive files tags list

Lists the tags on a file.

It changes nothing.

```text
coline drive files tags list [flags]
```

**Action** `drive.files.tags.list` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files tags list -w acme --file-id <file-id>
coline drive files tags list -w acme --json '{"fileId":"<file-id>"}' --fields id
```

## drive files tags remove

Takes a tag off a file.

```text
coline drive files tags remove [flags]
```

**Action** `drive.files.tags.remove` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--tag <text>`   | Required.                                                             |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files tags remove -w acme --file-id <file-id> --tag "…"
coline drive files tags remove -w acme --json '{"fileId":"<file-id>","tag":"…"}' --fields id
```

## drive files tags replace

Replaces the tags set by hand on a file. Tags written in the file itself stay.

```text
coline drive files tags replace [flags]
```

**Action** `drive.files.tags.replace` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--tags <list>`  | Required.                                                             |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files tags replace -w acme --file-id <file-id> --tags "…"
coline drive files tags replace -w acme --json '{"fileId":"<file-id>","tags":"…"}' --fields id
```

## drive files trash

Moves a file or folder (with what's in it) to trash, where it can be restored.

It removes or overwrites something, so it runs only with --confirm.

```text
coline drive files trash [flags]
```

**Action** `drive.files.trash` · **Effect** destructive, runs only with `--confirm` · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files trash -w acme --file-id <file-id> --confirm
coline drive files trash -w acme --json '{"fileId":"<file-id>"}' --fields id --confirm
```

## drive files unpublish

Takes a published note off the web.

It removes or overwrites something, so it runs only with --confirm.

```text
coline drive files unpublish [flags]
```

**Action** `drive.files.unpublish` · **Effect** destructive, runs only with `--confirm` · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag             | What it does                                                          |
| ---------------- | --------------------------------------------------------------------- |
| `--file-id <id>` | File or folder id from list\_drive\_files, search or fetch. Required. |
| `--input <file>` | Read the input as JSON from a file; - reads stdin.                    |

```bash
coline drive files unpublish -w acme --file-id <file-id> --confirm
coline drive files unpublish -w acme --json '{"fileId":"<file-id>"}' --fields id --confirm
```

## drive files update

Renames, recolors or moves a file or folder, within its drive or (files only) to another drive.

```text
coline drive files update [flags]
```

**Action** `drive.files.update` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag               | What it does                                                                 |
| ------------------ | ---------------------------------------------------------------------------- |
| `--file-id <id>`   | File or folder id from list\_drive\_files, search or fetch. Required.        |
| `--name <text>`    |                                                                              |
| `--drive-id <id>`  | Move it to this drive.                                                       |
| `--parent-id <id>` | Move it into this folder; null for the drive's top level.                    |
| `--color <text>`   | One of `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`, `gray`. |
| `--input <file>`   | Read the input as JSON from a file; - reads stdin.                           |

```bash
coline drive files update -w acme --file-id <file-id>
coline drive files update -w acme --json '{"fileId":"<file-id>"}' --fields id
```

## drive folders create

Creates a folder in a drive, at its top level or inside another folder.

```text
coline drive folders create [flags]
```

**Action** `drive.folders.create` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag               | What it does                                       |
| ------------------ | -------------------------------------------------- |
| `--name <text>`    | Required.                                          |
| `--drive-id <id>`  | Default: the person's default drive.               |
| `--parent-id <id>` | Folder id from list\_drive\_files.                 |
| `--input <file>`   | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive folders create -w acme --name "…"
coline drive folders create -w acme --json '{"name":"…"}' --fields id
```

## drive graph

Everyone in the workspace and their drives, for Drive's map view.

It changes nothing.

```text
coline drive graph [flags]
```

**Action** `drive.graph` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag             | What it does                                       |
| ---------------- | -------------------------------------------------- |
| `--input <file>` | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive graph -w acme
coline drive graph -w acme --json '{}' --fields id
```

## drive saved-views create

Saves a filter on an app's file list for the person.

Set filters with --json '\{…}' or --input.

```text
coline drive saved-views create [flags]
```

**Action** `drive.savedViews.create` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                    | What it does                                       |
| ----------------------- | -------------------------------------------------- |
| `--app <text>`          | Required.                                          |
| `--name <text>`         | Required.                                          |
| `--icon <text>`         |                                                    |
| `--sort-order <number>` |                                                    |
| `--input <file>`        | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive saved-views create -w acme --app "…" --name "…"
coline drive saved-views create -w acme --json '{"app":"…","name":"…","filters":"…"}' --fields id
```

## drive saved-views delete

Deletes one of the person's saved views.

It removes or overwrites something, so it runs only with --confirm.

```text
coline drive saved-views delete [flags]
```

**Action** `drive.savedViews.delete` · **Effect** destructive, runs only with `--confirm` · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag             | What it does                                       |
| ---------------- | -------------------------------------------------- |
| `--id <text>`    | Required.                                          |
| `--input <file>` | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive saved-views delete -w acme --id "…" --confirm
coline drive saved-views delete -w acme --json '{"id":"…"}' --fields id --confirm
```

## drive saved-views list

Lists the person's saved filters for one app's file list.

It changes nothing.

```text
coline drive saved-views list [flags]
```

**Action** `drive.savedViews.list` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag             | What it does                                       |
| ---------------- | -------------------------------------------------- |
| `--app <text>`   | Required.                                          |
| `--input <file>` | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive saved-views list -w acme --app "…"
coline drive saved-views list -w acme --json '{"app":"…"}' --fields id
```

## drive saved-views update

Renames a saved view or changes its filters.

Set filters with --json '\{…}' or --input.

```text
coline drive saved-views update [flags]
```

**Action** `drive.savedViews.update` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                    | What it does                                       |
| ----------------------- | -------------------------------------------------- |
| `--id <text>`           | Required.                                          |
| `--name <text>`         |                                                    |
| `--icon <text>`         |                                                    |
| `--sort-order <number>` |                                                    |
| `--input <file>`        | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive saved-views update -w acme --id "…"
coline drive saved-views update -w acme --json '{"id":"…"}' --fields id
```

## drive tags list

Lists the workspace's tags, optionally matching a few letters or a category.

It changes nothing.

```text
coline drive tags list [flags]
```

**Action** `drive.tags.list` · **Effect** read, changes nothing · **Can wait for your approval** no · **Scope** `files.read` · **Workspace** yes, `-w`

| Flag                 | What it does                                       |
| -------------------- | -------------------------------------------------- |
| `--q <text>`         |                                                    |
| `--category <text>`  |                                                    |
| `--include-archived` |                                                    |
| `--limit <number>`   | Default 50.                                        |
| `--input <file>`     | Read the input as JSON from a file; - reads stdin. |

```bash
coline drive tags list -w acme
coline drive tags list -w acme --json '{}' --fields id
```

## drive tags save

Creates a workspace tag or changes its category, color, description or icon, or archives it.

```text
coline drive tags save [flags]
```

**Action** `drive.tags.save` · **Effect** write · **Can wait for your approval** no · **Scope** `files.write` · **Workspace** yes, `-w`

| Flag                    | What it does                                                                 |
| ----------------------- | ---------------------------------------------------------------------------- |
| `--name <text>`         | Required.                                                                    |
| `--category <text>`     |                                                                              |
| `--color <text>`        | One of `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`, `gray`. |
| `--description <text>`  |                                                                              |
| `--icon <text>`         |                                                                              |
| `--sort-order <number>` |                                                                              |
| `--archived`            |                                                                              |
| `--input <file>`        | Read the input as JSON from a file; - reads stdin.                           |

```bash
coline drive tags save -w acme --name "…"
coline drive tags save -w acme --json '{"name":"…"}' --fields id
```
