Atuin Scripts: Shareable, Syncable Shell Snippets

Your shell history holds a record of your most useful, time-saving, and obscure one-liners. Atuin already makes them easier to search and recall, but they’re still hard to reuse or share cleanly. With Atuin Scripts, that changes.

You can now turn any shell command (or series of commands) into a reusable, synced, and shareable script.

We use Atuin's built-in sync system, so Scripts are end-to-end encrypted and available on all of your machines ⚡️


Quick start

Scripts are available as of Atuin 18.5.0

You can create a script from your last command like so:

atuin scripts new my-script --last

This will open your $EDITOR with the command preloaded. Save and quit, and it’s synced to your Atuin account.

Scripts can be created from stdin, a file, or interactively via your editor. You can tag them, add descriptions, and more:

atuin scripts new deploy --last 3 -t infra -d "Deploys the prod stack"

Once saved, just run

atuin scripts run deploy

Variables

Scripts support variables using Jinja-style templating:

echo "Deploying to {{env}}"

When you run the script, Atuin will prompt for any missing values.

Or pass them in directly:

atuin scripts run deploy -v env=production

We're using minijinja behind the scenes. Full syntax documented here

Listing

You can see a list of all of your scripts with

atuin scripts list

Custom shebang

By default, Atuin scripts use bash. If you would like to use a different language, you can specify a custom shebang.

For example, to create a Python script:

atuin scripts new hello-py --shebang '/usr/bin/env python3'

Create the script

$ atuin scripts get hello-py
---
name: hello-py
id: 61d5a0cf-de56-4508-9ff4-177913cd2860
description: ""
tags: []
shebang: /usr/bin/env python3
script: |
  print("hi hi hi")

Check it

$ atuin scripts run hello-py
hi hi hi

Run it

What's next?

This is just the start. We're planning to:

  • Add interactive script creation
  • Integrate scripts into the TUI search
  • Make it easier to share scripts
  • Maybe even explore a community scripts library

Drop by the forum, GitHub or Discord and let us know what you think ❤️