finna-cli

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT

README

finna

Go CLI for the finna-app FinOps backend.

Status: v0.1.0 — auth, configs, projects, extractors, runs, costs, dashboard, alerts, wastage, and diagnostics are all implemented.

Install

Homebrew (macOS / Linux)
brew tap acarmisc/finna
brew install finna-cli
Direct download

Download the latest release archive and checksum from GitHub Releases, then verify and extract:

# example for macOS arm64
curl -LO https://github.com/acarmisc/finna-cli/releases/latest/download/finna_<VERSION>_darwin_arm64.tar.gz
curl -LO https://github.com/acarmisc/finna-cli/releases/latest/download/checksums.txt
sha256sum --check --ignore-missing checksums.txt
tar -xzf finna_<VERSION>_darwin_arm64.tar.gz
sudo mv finna /usr/local/bin/
From source
go install github.com/acarmisc/finna-cli/cmd/finna@latest

Quickstart

finna context add prod --server https://finna.example.com
finna context use prod
finna version

Run finna with no args to see the command tree.

Configuration

Config file lives at $XDG_CONFIG_HOME/finna/config.toml (fallback ~/.config/finna/config.toml). Tokens are stored in the OS keyring, never on disk.

Settings can be overridden in this order: CLI flag → environment variable → config file → default.

Env vars: FINNA_SERVER, FINNA_CONTEXT, FINNA_OUTPUT, FINNA_TOKEN, FINNA_DEBUG, NO_COLOR.

Development

Requirements: Go 1.24+ (oapi-codegen needs it), golangci-lint v2.

make build        # produces ./finna (injects version/commit/date)
make test         # unit tests with race detector
make lint         # golangci-lint
make generate     # regenerate API client from api/openapi.yaml
make tidy         # go mod tidy
make snapshot     # goreleaser snapshot (all platforms, no publish)
make release-dry  # alias for snapshot

Install golangci-lint:

brew install golangci-lint
# or: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
Regenerating the API client

The OpenAPI spec is vendored at api/openapi.yaml. To refresh:

cp ../finna-app/docs/openapi.yaml api/openapi.yaml
make generate

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
finna command
Command finna is the Finna FinOps CLI.
Command finna is the Finna FinOps CLI.
internal
api
Package api wraps the generated OpenAPI client for the finna backend.
Package api wraps the generated OpenAPI client for the finna backend.
api/openapi
Package openapi provides primitives to interact with the openapi HTTP API.
Package openapi provides primitives to interact with the openapi HTTP API.
auth
Package auth manages token storage in the OS keyring and JWT utilities.
Package auth manages token storage in the OS keyring and JWT utilities.
cli
Package cli wires the cobra command tree for the finna CLI.
Package cli wires the cobra command tree for the finna CLI.
config
Package config provides TOML-backed configuration storage for the finna CLI.
Package config provides TOML-backed configuration storage for the finna CLI.
ui
Package ui hosts terminal output helpers — tables, spinners, colors, and formatted error rendering for API responses.
Package ui hosts terminal output helpers — tables, spinners, colors, and formatted error rendering for API responses.
version
Package version exposes the CLI version.
Package version exposes the CLI version.

Jump to

Keyboard shortcuts

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