# atuin history

<!-- Generated by web/apps/docs/scripts/gen-reference.ts from the Atuin source. Do not edit. -->

Manipulate shell history

```sh
atuin history <COMMAND>
```

## `atuin history start`

Begins a new command in the history

```sh
atuin history start [OPTIONS] [COMMAND]...
```

### Arguments

- `<COMMAND>...`

### Options

- `--author <AUTHOR>`: Author of this command, eg `ellie`, `claude`, or `copilot`
- `--author-kind <AUTHOR_KIND>`: Whether a human or an AI agent ran this command
  
  Without it, Atuin makes a best guess.
  - `user`: A human ran this command
  - `agent`: An AI agent ran this command
- `--intent <INTENT>`: Optional intent/rationale for running this command

## `atuin history end`

Finishes a new command in the history (adds time, exit code)

```sh
atuin history end [OPTIONS] --exit <EXIT> <ID>
```

### Arguments

- `<ID>`

### Options

- `-e <EXIT>`, `--exit <EXIT>`: Required.
- `-d <DURATION>`, `--duration <DURATION>`

## `atuin history tail`

Stream history events from the daemon as they are received

```sh
atuin history tail
```

## `atuin history list`

List all items in history

```sh
atuin history list [OPTIONS]
```

### Options

- `-c`, `--cwd`
- `-s`, `--session`
- `--human`
- `--cmd-only`: Show only the text of the command
- `--print0`: Terminate the output with a null, for better multiline support
- `-r <REVERSE>`, `--reverse <REVERSE>`: Default: `true`.
- `--timezone <TIMEZONE>`: Display the command time in another timezone other than the configured default.
  
  This option takes one of the following kinds of values:
  
  - the special value "local" (or "l") which refers to the system time zone
  - a time zone name (e.g. "Europe/Berlin")
  - an offset from UTC (e.g. "+9", "-2:30")
- `-f <FORMAT>`, `--format <FORMAT>`: Available variables: {command}, {directory}, {duration}, {user}, {host}, {author}, {intent}, {exit}, {time}, {session}, and {uuid}
  
  Example: --format "{time} - [{duration}] - {directory}$\t{command}"

## `atuin history last`

Get the last command that was run

```sh
atuin history last [OPTIONS]
```

### Options

- `--human`
- `--cmd-only`: Show only the text of the command
- `--timezone <TIMEZONE>`: Display the command time in another timezone other than the configured default.
  
  This option takes one of the following kinds of values:
  
  - the special value "local" (or "l") which refers to the system time zone
  - a time zone name (e.g. "Europe/Berlin")
  - an offset from UTC (e.g. "+9", "-2:30")
- `-f <FORMAT>`, `--format <FORMAT>`: Available variables: {command}, {directory}, {duration}, {user}, {host}, {author}, {intent}, {time}, {session}, {uuid} and {relativetime}.
  
  Example: --format "{time} - [{duration}] - {directory}$\t{command}"

## `atuin history init-store`

```sh
atuin history init-store
```

## `atuin history prune`

Delete history entries matching the configured exclusion filters

```sh
atuin history prune [OPTIONS]
```

### Options

- `-n`, `--dry-run`: List matching history lines without performing the actual deletion

## `atuin history dedup`

Delete duplicate history entries (that have the same command, cwd and hostname)

```sh
atuin history dedup [OPTIONS] --before <BEFORE> --dupkeep <DUPKEEP>
```

### Options

- `-n`, `--dry-run`: List matching history lines without performing the actual deletion
- `-b <BEFORE>`, `--before <BEFORE>`: Only delete results added before this date, read in the configured timezone unless it carries an explicit offset. Required.
- `--dupkeep <DUPKEEP>`: How many recent duplicates to keep. Required.