normatik-cli

module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT

README

Normatik CLI

Normatik CLI is a command-line client for the Normatik Public API. It supports interactive browser login, API-key based automation, JSON output, shell completion, and discoverable error recovery hints.

This repository is the public source mirror for released CLI versions. The release process validates the source before every export; development happens upstream and this mirror is not a bidirectional contribution workflow.

Install

With Homebrew:

brew install 42bv/tap/normatik

Or install a released version directly with Go:

go install github.com/42BV/normatik-cli/cmd/normatik@latest

Get started

normatik login --url https://wiki.example/ --browser
normatik whoami
normatik pages list

For automation, provide both values explicitly:

export NORMATIK_BASE_URL=https://wiki.example/api
export NORMATIK_API_KEY=wiki_...
normatik pages list --output json

The CLI stores an interactively entered key in the operating-system keychain; it never writes API keys to config.toml. HTTPS is required except for an explicit localhost-only development opt-in.

Build from source

Requirements: Go 1.26.5 or newer.

make verify
make build
./normatik --version

The public source includes the generated API client and runtime catalogues needed to build and test the CLI. Their generation and integration testing are performed before source is exported.

Shell completion

normatik completion bash
normatik completion zsh
normatik completion fish

License

Copyright (c) 2026 42 B.V. Licensed under the MIT License.

Directories

Path Synopsis
cmd
normatik command
internal
api
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
auth
Package auth resolves the active environment (base-URL + API key) and stores API keys in the OS keychain.
Package auth resolves the active environment (base-URL + API key) and stores API keys in the OS keychain.
catalog
Package catalog is the offline, embedded error-code knowledge base that powers `normatik explain` and the exit-code policy.
Package catalog is the offline, embedded error-code knowledge base that powers `normatik explain` and the exit-code policy.
cli
Package cli wires the cobra command tree.
Package cli wires the cobra command tree.
client
Package client is the hand-written wrapper around the generated transport.
Package client is the hand-written wrapper around the generated transport.
command
Package command is the shared CLI layer: dependency bootstrap (client + printer), the single error-render path, exit-code-carrying handled errors, and a resource registry + verb-builders so adding a resource is a few lines.
Package command is the shared CLI layer: dependency bootstrap (client + printer), the single error-render path, exit-code-carrying handled errors, and a resource registry + verb-builders so adding a resource is a few lines.
config
Package config persists non-secret CLI preferences: the active profile, the default output mode, and per-profile base-URLs.
Package config persists non-secret CLI preferences: the active profile, the default output mode, and per-profile base-URLs.
httpx
Package httpx centralizes the CLI's outbound HTTP security policy.
Package httpx centralizes the CLI's outbound HTTP security policy.
localfile
Package localfile centralises safe reads of caller-selected local files for the CLI (NORMATIK-21).
Package localfile centralises safe reads of caller-selected local files for the CLI (NORMATIK-21).
problem
Package problem decodes the Normatik public API's RFC-7807 ProblemDetail responses and maps them to actionable CLI output + exit codes.
Package problem decodes the Normatik public API's RFC-7807 ProblemDetail responses and maps them to actionable CLI output + exit codes.
render
Package render implements dual-mode output: a human table/text default and a stable machine-readable JSON mode (--output json).
Package render implements dual-mode output: a human table/text default and a stable machine-readable JSON mode (--output json).
weburl
Package weburl builds normatik-ui frontend routes for the CLI's --url flag.
Package weburl builds normatik-ui frontend routes for the CLI's --url flag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL