Home Explore Blog CI



nushell

commands/docs/history_import.md
f3521e2905547d1aa39e2a1a6f84f2cd9f689ecf71082b4200000003000005b1
---
title: history import
categories: |
  history
version: 0.104.0
history: |
  Import command line history.
usage: |
  Import command line history.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `history import` for [history](/commands/categories/history.md)

<div class='command-title'>Import command line history.</div>

## Signature

```> history import {flags} ```


## Input/output types:

| input        | output  |
| ------------ | ------- |
| list\<string\> | nothing |
| nothing      | nothing |
| string       | nothing |
| table        | nothing |
## Examples

Append all items from history in the other format to the current history
```nu
> history import

```

Append `foo` to the current history
```nu
> echo foo | history import

```

Append `foo` ran from `/home` to the current history
```nu
> [[ command_line cwd ]; [ foo /home ]] | history import

```

## Notes
Can import history from input, either successive command lines or more detailed records. If providing records, available fields are:
    command_line, id, start_timestamp, hostname, cwd, duration, exit_status.

If no input is provided, will import all history items from existing history in the other format: if current history is stored in sqlite, it will store it in plain text and vice versa.

Note that history item IDs are ignored when importing from file.

Chunks
ac8c2f8b (1st chunk of `commands/docs/history_import.md`)
Title: history import
Summary
The `history import` command appends command line history items to the current history. It can import from various sources, including standard input (either successive command lines or detailed records with fields like command_line, id, start_timestamp, hostname, cwd, duration, exit_status), or from the existing history in the other format (e.g., from sqlite to plain text or vice-versa if no input is provided).