Hania Code

The terminal client

The hania command is a coding chat in your terminal. Run it in a project folder and it works with an agent on that folder: reading and editing files, searching, and running commands, with every change shown to you for approval first.

Install

curl -fsSL https://app.hania.ai/install.sh | bash

This puts the binary at ~/.hania/bin/hania and adds that folder to your PATH for future shells. The shell you installed from does not pick the PATH change up on its own - restart it, or run export PATH="$HOME/.hania/bin:$PATH" once. Set HANIA_NO_MODIFY_PATH=1 before running the installer to skip the PATH edit entirely.

You can also download the binary directly from https://app.hania.ai/install/hania-code/<os>/<arch>, where os is linux, darwin, or windows and arch is amd64 or arm64 (Windows is amd64 only).

The client keeps itself current: on launch it checks for a newer build in the background and downloads it. When that happens a small note appears at the bottom right saying the update is installed and a restart will apply it. hania selfupdate forces a check.

Sign in

On first run, hania asks two questions.

First, the API key. Use a management key - it starts with hania_sk_ and you create it under API keys in the console. It needs the chat:send ability; switching models from inside the client also needs bots:write and llm:read.

Second, a machine key, and this one is optional. It starts with hania_mk_ and you get it by creating a machine in the console - see Machines & pairing. Paste one and coding runs on that machine, in the folder you launched hania from. Leave it blank and chat still works; coding falls back to the machine configured on the bot's coding tool.

hania login runs the same two prompts again whenever you want to change either key. Inside a session, /machine connects or changes the machine by pasting a key. hania logout (or /logout in a session) clears the stored keys, so the next launch asks for them again.

Two kinds of key. The login key starts with hania_sk_. The machine key from pairing starts with hania_mk_ and connects a machine - it is not the login key. If sign-in fails with a valid-looking key, check the prefix; pasting one where the other belongs is the most common mix-up.

Commands

CommandWhat it does
haniaStarts an interactive coding chat in the current folder.
hania chat --bot <name or id>Starts chat with a specific agent.
hania -p [--bot X] [--yes] "message"Runs one turn and exits, non-interactive. --yes approves the agent's actions without asking.
hania loginSets or replaces the API key and the machine key.
hania logoutSigns out - clears the stored keys so the next launch asks for them again.
hania runner --url <wss> --token <token>Runs the machine daemon on a server. See Machines.
hania versionPrints the installed version.
hania selfupdateChecks for and installs the latest build.

Sessions and resume

Each launch is its own session with its own conversation, so closing the terminal never loses work on Hania's side - the transcript lives on the server. Type /resume to list your past sessions with the agent and continue one where it left off.

Rollback

Press Esc twice to open a list of this session's turns. Pick one and the files revert to how they were at that point, and the conversation is truncated to match, so the agent's memory and your working tree agree again. It is the fastest way out of a direction that didn't work.

File reverts use a private snapshot kept by the client. It never touches your real git history, and it respects .gitignore, so build output and dependencies are not snapshotted.

Slash commands

Type / and a menu of commands appears; arrow through it, or keep typing to filter, and Tab completes.

CommandWhat it does
/resumeList past sessions and continue one.
/contextShow what is in the model's context.
/costShow token and cost figures for this conversation.
/botSwitch agent.
/modelSwitch the agent's chat model.
/machineConnect a machine, or change it, by pasting a machine key.
/autoToggle do-not-ask mode for approvals.
/clearStart a fresh conversation.
/helpShow help.
/logoutSign out - clears the stored keys and returns to the login screen.
/exitLeave the session.

Menus in the client work with the up and down arrows and Enter, not by typing a number.

Approvals

When the agent wants to write a file, edit one, or run a command, the change appears in the chat - edits as a diff, commands as the command line - and a card offers four choices:

  • Approve - run it.
  • Approve and don't ask again this session - run it and stop asking for the rest of the session.
  • Deny - don't run it.
  • Deny and tell Hania what to do differently - don't run it, and give the agent a correction to work from.

Esc means deny. /auto toggles the do-not-ask mode on and off at any time. The same approvals appear in the console when you use the coding tool there; see approvals on the coding tool for the per-tool settings behind them.

While the agent works

A status line shows an animated mark, the word Generating, the elapsed time, a running estimate of output tokens, reasoning time when the model is thinking, and esc to interrupt. Pressing Esc stops the current turn and keeps the session, so you can redirect the agent without starting over.

Multi-line input

End a line with a backslash and press Enter to start a new line instead of sending. The buffered lines stack above the input box while you write. Esc discards them. The next Enter without a trailing backslash sends the whole message.

Diffs

Proposed edits render as a diff with a file header, line numbers, and a highlighted background on added and removed lines, so a change is readable at a glance before you approve it.