Pauhu

Pauhu command line help

Short answers for the pauhu command. Each section matches a help link the command prints.

Get your developer key

Get a developer key (free, sign in with GitHub). Copy it once. It is shown once, so paste it into a safe place before you leave the page.

Install

You need Node 20 or newer.

npm i -g github:pauhu/cli

Check it works:

pauhu

Set your key

Run this, then paste the key and press Enter. The text you type is hidden. The key is stored in your home folder in .pauhu/key and is never printed.

pauhu key set

Or set the PAUHU_KEY environment variable. It replaces the stored key, which suits a build server.

# Linux or macOS
export PAUHU_KEY=your-key

# Windows PowerShell
$env:PAUHU_KEY = "your-key"

Ask a question

pauhu ask "your question"

It prints the answer, the source ids it cites and a fingerprint line. The first ask downloads a model folder once; it needs a graphics card on this computer. To use a model folder you already have, run pauhu pack <folder> first.

To answer from your own sources, with no key and no service call, give a JSON file that holds a list of objects with id and text:

pauhu ask --sources sources.json "your question"

Translate a file

pauhu translate report.txt --to fi
pauhu translate report.txt --from sv --to fi --out report.fi.txt

--to is the target language and is required. --from is the language of your file and defaults to English (en). Use a language name or its short code. --out writes to a file instead of the screen. Add --celex to use official text; see origin.

If it stops, the message says why:

say an EU target language
You left out --to, or the language is not one it knows. Write it like --to Finnish or --to fi.
say the document's EU language
The --from language is not one it knows. Write it like --from English or --from en.
--celex takes an EU document number
The number has the wrong shape. Use a number such as 32016R0679.
could not read the file
The path is wrong or the file is not readable. It must be plain text.
document over 2 MB; split it
Cut the file into parts under 2 MB and translate each part.
could not write the output file
The file named by --out may already exist. It never overwrites; pick a new name.

Official text for a document number

With --celex, the command asks the EU Publications Office for the official text of that document in both of your languages. Paragraphs that match the official text are used as they are. Other paragraphs are machine translated and start with [machine translation]. At the end it prints how many parts came from the official text and where.

pauhu translate regulation.txt --from en --to fi --celex 32016R0679

If it stops with no official text for a number, that document has no text in one of your two languages at the office, or the number is wrong. Try this:

Problem log

When a translation goes wrong, the command writes a short note in a log on your computer. The log holds no text from your files or questions. Nothing is sent unless you send it.

pauhu misses

That shows the log. To send it, run the next line. It shows what will go out and asks first. Add --yes to skip the question.

pauhu misses send
pauhu misses send --yes

Sending works on Windows and Linux for now. Only one send can run at a time; if you see another send is running, wait until it ends. If the log file is not private to you, it is not sent.

To delete the log from your computer:

pauhu misses clear

Lost key

A key is shown once, so it cannot be shown again. Sign in with GitHub on pauhu.dev and choose Get a new key. Then run pauhu key set with the new key.