This page covers how to install the gobl.cii CLI binary and how to add the cii Go library as a module dependency. For information on how to use the CLI after installing, see CLI Usage. For programmatic API usage, see Go API Usage.
| Requirement | Value |
|---|---|
| Go version | 1.24.4 or later |
| Module path | github.com/invopop/gobl.cii |
| CLI binary name | gobl.cii |
The Go version requirement is declared in go.mod3 The module path is specified in go.mod1
Sources: go.mod1-3
The gobl.cii command-line tool can be installed from source using the Go toolchain. The CLI entry point is located at cmd/gobl.cii.
To install the CLI binary, you need Go 1.24.4 or later installed on your system. From the repository root directory, run:
This will compile and install the gobl.cii binary to your $GOPATH/bin directory (typically ~/go/bin).
Alternatively, install directly from the remote repository:
After installation, verify that the CLI is available:
This should display the command usage information, confirming successful installation.
Sources: README.md109-113 cmd/gobl.cii/convert.go1-11
To use the cii package in your own Go project, add it with go get:
Then import the package in your Go code:
The module is declared in go.mod1-3 with the module path github.com/invopop/gobl.cii and requires Go 1.24.4.
When you add github.com/invopop/gobl.cii, the following direct dependencies are pulled in automatically. These are declared in go.mod5-15
| Package | Version | Role |
|---|---|---|
github.com/invopop/gobl | v0.308.0 | Core GOBL envelope and bill.Invoice types |
github.com/invopop/xmlctx | v0.13.0 | XML marshaling/unmarshaling with namespace context |
github.com/invopop/validation | v0.8.0 | Field-level validation support |
github.com/invopop/phive | v0.6.0 | Schema validation against external Phive service (gRPC) |
github.com/spf13/cobra | v1.9.1 | CLI framework (CLI binary only) |
github.com/joho/godotenv | v1.5.1 | Environment variable loading (tests and CLI) |
github.com/stretchr/testify | v1.10.0 | Testing assertions and require functions |
gitlab.com/flimzy/testy | v0.14.0 | Additional testing utilities |
google.golang.org/grpc | v1.77.0 | gRPC transport for Phive validation client |
The stretchr/testify and flimzy/testy packages are used exclusively for testing. For a full description of each dependency and whether it is runtime, CLI-only, or test-only, see Module Dependencies.
Sources: go.mod5-15 examples_test.go13-22
For development purposes, you can clone the repository and build the CLI locally:
To run the test suite:
The test infrastructure uses fixture-based testing with test data organized in test/data/convert and test/data/parse directories. Tests support two flags:
-update: Regenerate test fixture outputs-validate: Run external Phive validation (requires Phive service on localhost:9091)For more details on testing, see Testing Framework.
Sources: README.md129-148 examples_test.go34-38
The following diagram shows the relationship between the Go module path, the CLI entry point, and the library import path.
Module Structure: import paths and binary entry point
Sources: go.mod1-3 .goreleaser.yml5-12