publiccode-api-client

July 5, 2025 ยท View on GitHub

Command-line client for the Developers Italia API.

Prerequisites

  • Rust stable toolchain
  • Environment variable API_BEARER_TOKEN set with your API token

Installation

Clone the repo and install:

git clone https://github.com/your-org/publiccode-api-client.git
cd publiccode-api-client
cargo install --path .

Or build locally:

cargo build --release

The built binary will be located at target/release/publiccode_api_client.

Usage

publiccode_api_client <SUBCOMMAND> [OPTIONS]

Available subcommands:

SubcommandDescription
create-publisher <JSON>Create a new publisher
create-software <JSON>Create a new software entity
update-software <ID> <JSON>Update a software entity
list-publishers [--code-hostings]List all publishers
list-softwareList all software entities
show-publisher <ID>Show details of a publisher
show-software <ID>Show details of a software entity
logsShow current day's logs

Examples

Create a publisher:

API_BEARER_TOKEN=xxx api_cli create-publisher '{"description":"Ministry of Truth","email":"techpub@example.com"}'

List publishers with code hostings:

api_cli list-publishers --code-hostings

Show a software by ID:

api_cli show-software af6056fc-b2b2-4d31-9961-c9bd94e32bd4

License

GPL-3.0