H2I command line reference

Run tools from a terminal or a script with the h2i command.
Reference
Intermediate
3 min read
Updated Dec 5, 2026

The command line h2i comes in the npm package @davixlabs/h2i-mcp. It runs Davix H2I tools on files and folders on your computer, and the same program is also the helper that lets AI apps work on your local files (MCP). It needs Node.js 18 or newer.

Sign in

npx -y @davixlabs/h2i-mcp login
npx -y @davixlabs/h2i-mcp login --no-browser   # on a server: shows a code and an address

A browser window opens on the Davix H2I website; check the name “Davix H2I helper” and press Allow access. Your sign-in is stored on your computer, readable only by you, and stays valid for 90 days without use by default. logout ends it on the computer and on the server. For scripts and servers you can set DAVIX_H2I_TOKEN instead.

Commands

The examples write h2i. If you have not installed the package (npm install -g @davixlabs/h2i-mcp), write npx -y @davixlabs/h2i-mcp in its place; h2i-mcp is the same command.

h2i ops resize                                      # find an operation
h2i run images.resize photo.png --param width=1600  # run it on a file
h2i run pdfs.merge a.pdf b.pdf --out merged.pdf     # several files in, one result
h2i folder images.optimize ./photos --out-dir ./small --recursive
  • ops searches the operations, which are read live from the server so the list is never out of date.
  • run sends one or more files to an operation and saves the result next to the original (named like photo.davix.png) or where you say with --out. An existing file is never replaced unless you add --overwrite.
  • folder runs an operation on every matching file of a folder, with --out-dir into another folder, with --recursive into sub-folders and with --ext jpg,png only for those file types.
  • setup adds Davix H2I to the AI apps on your computer (--client picks one app, --all and --yes skip the question, --print only shows what it would write); doctor checks Node, the connection, your sign-in and each app’s settings; whoami shows where your sign-in comes from and when it expires; logout ends it.

Files are sent untouched, and the helper checks that the copy on the server is identical before it works on it.

Requirements

The command line uses your Davix H2I account, so the tools and limits of your plan apply. Using it as the helper for AI apps needs a plan that includes MCP.

Prefer code? Use the Node SDK.

Checked against the helper README and the npm registry.

Was this article helpful?
Thanks for your feedback.
Still stuck?

Talk to a human

Send us a message and we will get back to you quickly.