# Manage assets

Add, rename, set the cover of and remove the characters, locations and props of a project, and keep pictures in your library.

An asset is a character, a location or a prop that a project uses. Each one has a name, a description and pictures. Scripts and prompts point at an asset by its name, such as `@Lin Xia`. These commands do what the **资产** tab in the MiniCut app does, with the same rules.

Before you start, sign in and make a project. See [Quickstart](/docs/cli/quickstart). Every command here needs a signed-in computer. Each `minicut asset` command prints one line of JSON. Run the commands in the project folder, `~/.minicut/projects/rain-shop` here.

## Add an asset

1. Put a picture of the character in the project folder, `lin.png`. A picture is PNG, JPG or WebP, up to 25 MB, and a command takes up to 12.
2. Add the character with its picture and a note:

```bash Terminal
minicut asset add rain-shop characters "Lin Xia" --note "shop owner" lin.png
```

```json Output
{"id":"lin-xia","kind":"characters","name":"Lin Xia","folder":"library/characters/lin-xia"}
```

The `id` comes from the name, in lowercase Latin letters and `-`. A name with no Latin letters gets an id such as `character-01`. Use the `id` in the commands below. The pictures are saved as `image-01`, `image-02`, and on, with their own extension.

3. Optional: add a location or a prop. They need no picture.

```bash Terminal
minicut asset add rain-shop locations "Night shop"
minicut asset add rain-shop props "Umbrella"
```

A name is 1 to 40 characters and cannot hold `/`, `\`, `@` or a vertical bar. A name that the project already uses is refused with `name_taken`.

## Rename an asset

1. Rename the item by its `id`:

```bash Terminal
minicut asset rename rain-shop characters lin-xia "Lin"
```

```json Output
{"name":"Lin","files_changed":0}
```

`rename` changes every `@Lin Xia` in `script.md` and `story.md`, and in `script.md`, `shots.md`, `assets.md` and `prompts.md` of each episode, in every project that uses the item. `files_changed` is how many files it rewrote.

## Set the cover

1. Set the picture that stands for the item, by its file name:

```bash Terminal
minicut asset cover rain-shop characters lin-xia image-01.png
```

```json Output
{"cover":"image-01.png"}
```

## Pick a take

1. Set the take that a shot uses. The arguments are the project, the episode, the shot and the take:

```bash Terminal
minicut asset pick rain-shop ep01 c03 t02
```

```json Output
{"pick":"t02"}
```

## Remove an asset

1. Remove the item from the project:

```bash Terminal
minicut asset remove rain-shop props umbrella
```

```json Output
{"moved":true,"name":"Umbrella"}
```

The item's folder goes to the system Trash. When another project still uses the item, the folder stays in your library, and `moved` is `false`.

## Keep a picture in your library

1. Keep a picture you already have as a character, location, prop or style picture, and list it in the project:

```bash Terminal
minicut save character lin.png --id lin-xia --as sheet-02 --project rain-shop
```

It prints `Saved` with the path in your library, and says whether the project already lists the item. When the file is already there, it prints `already in the library, not overwritten`.

`minicut save` never writes over a file that is already in the library. To keep a finished video as the take of a shot, see [minicut save](/docs/cli/projects#minicut-save). To make pictures with a model, see [Generate](/docs/cli/generate).

## Check it worked

Each command prints its result and exits with code 0. The folder `~/.minicut/library/characters/lin-xia` holds the pictures, and the project's `series.json` lists `lin-xia` under `library.characters`.

## If a step fails

The `error` field holds a fixed code.

The exit code is 1 when the action is refused.
It is 2 when the words after `asset` are wrong.
It is 5 when a picture is outside your work folders.

| Error | What to do |
|---|---|
| `name_taken` | Pick a name the project does not use yet |
| `bad_name` | Use 1 to 40 characters, with no `/`, `\`, `@` or vertical bar |
| `no_project` | Check the project id, or use `.` inside the project folder |
| `no_asset` | Use an `id` that the project lists in `series.json` |
| `no_file` | Use the file name of one of the item's pictures |
| `no_clip` | Check the episode and shot ids. The shot needs a folder in `clips` |
| `no_take` | Use a take that the shot has, such as `t02` |
| `bad_type` | Give a PNG, JPG or WebP picture |
| `too_large` | Give a picture of 25 MB or less |
| `bad_request` | Check the kind. It is `characters`, `locations` or `props` |
| `path_outside` | Move the picture into your project folder, then add it again |

## Next

[Projects](/docs/cli/projects) [Generate](/docs/cli/generate) [Use a canvas board](/docs/cli/use-a-canvas-board)
