Getting Started - Hook

Hook Docs / Getting Started

Getting Started

What is Hook

Hook is a graphical HTTP/HTTPS API client written in C99. It runs as a native desktop application on Linux and Windows. Collections are stored as JSON files on disk. There is no cloud component and no account is needed.

Hook has two modes:

Dependencies

Linux (Debian / Ubuntu)

Install the build toolchain and libraries:

sudo apt-get install build-essential
sudo apt-get install liballegro5-dev
sudo apt-get install libssl-dev libpcre2-dev libgit2-dev zlib1g-dev libyaml-dev
sudo apt-get install doxygen graphviz cppcheck

The Nilorea C Library must be present at ../../nilorea-library/ relative to the Hook source directory. Nilorea is compiled from source by the Hook Makefile; it is not linked as a shared library.

QuickJS (the JavaScript engine for scripting) is bundled in the quickjs/ subdirectory and compiled from source automatically. No separate installation is needed.

Windows (MSYS2 MinGW-w64)

Open an MSYS2 MinGW64 shell and install:

pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
pacman -S mingw-w64-x86_64-allegro
pacman -S mingw-w64-x86_64-openssl mingw-w64-x86_64-pcre2
pacman -S mingw-w64-x86_64-libgit2 mingw-w64-x86_64-zlib mingw-w64-x86_64-libyaml
pacman -S mingw-w64-x86_64-doxygen mingw-w64-x86_64-graphviz

Building

Linux

make              # build the hook binary
make test         # compile and run all tests
make doc          # generate Doxygen HTML documentation
make check        # run cppcheck static analysis
make clean        # remove build artifacts

The binary is produced at ./hook in the project root.

Windows

From an MSYS2 MinGW64 shell:

make              # Makefile auto-detects OS=Windows_NT
make test
make doc

The Makefile includes Makefile.windows on Windows, which adds the Windows-specific link flags (-lws2_32, -lwinmm, -lgdi32, -lcrypt32).

Running for the first time

GUI mode

./hook

On Linux you can also run ./hook.sh which sets sanitizer suppression options for third-party library leaks.

The main window opens with:

To send your first request:

  1. Select a method (GET, POST, etc.) from the method dropdown.
  2. Type a URL in the URL field (focused by default at startup), for example https://httpbin.org/get.
  3. Click the Send button or press Enter while the URL field has focus.
  4. The response appears in the response panel with status code, elapsed time, headers, and body.

CLI mode

./hook run -f collection.json
./hook export -f collection.json

CLI mode requires a collection JSON file. See the CLI Reference for all available subcommands.

Keyboard shortcuts

Opening a popup (mock server, SSE, WebSocket, Git, collection/environment editor, import, etc.) brings it to the front and gives it keyboard focus, so you can start typing right away, and Escape closes that popup first.

Test CA certificate

Some tests use a self-signed CA. Generate it with:

make fixtures

This creates tests/fixtures/test-ca.pem.

Next steps