Skip to content
Documentation
View as Markdown

Command line (librario CLI)

The librario CLI brings your library to the terminal. You search publications, create records, upload PDFs and make a complete backup of your account without opening the browser. Every command prints text or JSON, so the CLI also suits scripts and AI agents that work in a terminal.

The CLI works through the REST API on behalf of the person who signed in: it sees and changes exactly what that person may see and change in the web app.

Install

The CLI is a single executable for Windows (64-bit), macOS (Apple Silicon) and Linux (64-bit, x86 and ARM). The install script downloads the latest version, checks its checksum and puts it in your user directory. You don’t need administrator rights.

Windows

Open PowerShell and run:

irm https://www.librario.de/install.ps1 | iex

The script installs the CLI to %LOCALAPPDATA%\Programs\librario and adds that directory to your user PATH. The librario command works right away in this window and in every new one.

macOS and Linux

Open a terminal and run:

curl -fsSL https://www.librario.de/install.sh | bash

The script installs the CLI to ~/.local/bin, together with shell completion for bash, zsh and fish and the manual pages (man librario). If your terminal doesn’t find librario afterwards, add ~/.local/bin to your PATH; the script’s last message shows the line to add.

There is no separate version for Intel Macs.

Download manually

If you’d rather not run an install script, download the archive for your system directly:

System Download
Windows (64-bit) librario_windows_amd64.zip
macOS (Apple Silicon) librario_darwin_arm64.tar.gz
Linux (64-bit, x86) librario_linux_amd64.tar.gz
Linux (64-bit, ARM) librario_linux_arm64.tar.gz

Extract the archive and put librario (on Windows librario.exe) in a directory on your PATH.

Verify the download

Each version comes with checksums.txt, which lists the SHA-256 checksums of all archives. Save it in the same directory as the archive and compare:

# Linux
sha256sum --ignore-missing -c checksums.txt
# macOS
shasum -a 256 --ignore-missing -c checksums.txt

On Windows, PowerShell shows the archive’s checksum; it must match the line for librario_windows_amd64.zip in checksums.txt:

Get-FileHash .\librario_windows_amd64.zip -Algorithm SHA256

The install scripts run this check themselves and stop if the checksum doesn’t match.

Notes for Windows and macOS

The CLI isn’t signed with a code-signing certificate. Depending on how it reaches your computer, the operating system may warn you.

  • Windows SmartScreen: if you downloaded the archive in a browser, the first start shows Windows protected your PC. Click More info, then Run anyway. The PowerShell install script doesn’t trigger this warning.
  • Windows Smart App Control: on some freshly set-up Windows 11 computers, Smart App Control blocks unsigned programs without offering an exception. It is usually switched off on managed company computers. Contact us if it affects you.
  • Company policies: if your IT approves programs through AppLocker, App Control for Business or a similar policy, it has to allow the CLI first, for example by the file’s checksum or the install path.
  • macOS Gatekeeper: if you downloaded the archive in a browser, macOS refuses to run it the first time. Remove the quarantine flag with xattr -d com.apple.quarantine ./librario. The install script isn’t affected.

First steps

  1. Sign in. Give the address at which you open Librario in the browser:

    librario login --host <your-company>.mylibrar.io
    

    The CLI opens your browser. Sign in as usual and approve the connection. The access is then kept in your operating system’s keychain (on Windows in Credential Manager), not in a file.

  2. List publications, here with a search term:

    librario publications list -q "fire protection"
    
  3. Show all commands. Every command explains its options with --help:

    librario --help
    librario publications list --help
    

The CLI’s connection appears on your Integrations page under Connected applications. You can revoke it there at any time, as described in Manage and revoke connections.

Telemetry

The CLI sends usage data to AppSignal (data centre in the EU) so we notice errors and slow commands early. The first start shows a one-time notice.

  • Sent: the command (such as publications list), the CLI version, operating system and processor architecture, the duration, the kind of result (success or error class), the HTTP method, the request path without IDs and the status code of each request to Librario, a random request ID that lets our support find a failed call in the server logs, and your library’s address (such as <your-company>.mylibrar.io).
  • Never sent: arguments and options, search terms, record IDs, request and response contents, credentials, your computer’s name, your user name and file paths.

To switch telemetry off, any one of these is enough:

  • librario telemetry off saves the setting permanently. librario telemetry status shows the current state, librario telemetry on switches it back on.
  • The environment variable LIBRARIO_TELEMETRY_DISABLED=1
  • The environment variable DO_NOT_TRACK=1

The CLI works fully without a connection to the telemetry service. A failed upload never changes a command’s result.

Update

Run the install script again. It replaces the installed version with the latest one.