> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invoke0.indevs.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Save

> Save your work

Takes a snapshot of all your changes so you can upload them later.

## Usage

```bash theme={null}
ag save [message] [options]
```

## Arguments

| Argument  | What it is                              | Required? |
| --------- | --------------------------------------- | --------- |
| `message` | A short description of what you changed | No        |

## Options

| Option      | What it does                                       |
| ----------- | -------------------------------------------------- |
| `--preview` | Show what would be saved without actually doing it |

## Writing a good save message

A short description helps you and your team remember what changed:

```bash theme={null}
ag save "Added the search bar"
ag save "Fixed the broken link on the home page"
ag save "Updated the team photo"
```

If you don't provide a message, Anchor4Git uses the current date and time:

```text theme={null}
anchor4git: Save 240715-143022
```

> This is fine, but a descriptive message is much more helpful later!

## What gets saved?

**Everything in your workspace** is saved in one snapshot:

* New files you created
* Changes to existing files
* Files you deleted

**One thing is never saved:** the Anchor4Git configuration file (your personal settings stay private).

## Preview mode

To see what would be saved:

```bash theme={null}
ag save --preview
```

This shows:

* The save message
* Your name and email (as the author)
* A list of every changed file

## If there's nothing to save

If you run `ag save` but haven't changed anything, you'll see:

```text theme={null}
[INFO] Nothing to save. Workspace is clean.
```

This means no files have changed since the last save.

## When should I save?

Save whenever you've completed a piece of work:

* After finishing a feature
* Before taking a break
* Before running `ag fetch` (it auto-saves anyway, but it's good practice)
* Before running `ag upload`

## Examples

```bash theme={null}
# Save with a description
ag save "Finished the contact form"

# Quick save (auto-generates message)
ag save

# See what would be saved
ag save --preview

# Multi-word message
ag save "Fixed the navigation menu and added icons"
```
