NAME

DarkPAN::Indexer::CLI - command-line driver for DarkPAN::Indexer

SYNOPSIS

# build the whole index from the repository
darkpan-indexer --config darkpan.json index-darkpan

# (re)index a single distribution
darkpan-indexer --config darkpan.json update-darkpan authors/id/A/AB/AUTHOR/Foo-1.0.tar.gz

# remove a distribution from the index-darkpan
darkpan-indexer --config darkpan.json delete-distribution authors/id/A/AB/AUTHOR/Foo-1.0.tar.gz

Note: all commands can be abbreviated - index, update, delete

DESCRIPTION

DarkPAN::Indexer::CLI is a thin command-line front end over DarkPAN::Indexer. It exists so a DarkPAN can be built and maintained without an external pipeline (e.g. a Lambda handler): point it at a config file and run a command. Each command parses its arguments and delegates to the orchestrator, which does the real work (locking, fetching, indexing, publishing).

This is a CLI::Simple modulino; it is normally invoked through the darkpan-indexer wrapper script.

OPTIONS

--config, -c FILE

Path to the DarkPAN config file (JSON). See "CONFIGURATION" in DarkPAN::Indexer.

--help, -h

Show usage.

COMMANDS

index-darkpan

darkpan-indexer --config darkpan.json index

Full rebuild: index every distribution in the repository and publish the index. Delegates to DarkPAN::Indexer->create_index. This is the default command.

update-darkpan DISTRIBUTION-KEY

darkpan-indexer --config darkpan.json update authors/id/A/AB/AUTHOR/Foo-1.0.tar.gz

Incrementally (re)index a single distribution, given its storage key. Delegates to DarkPAN::Indexer->update_index( distribution => $key ).

delete-distribution DISTRIBUTION-KEY

darkpan-indexer --config darkpan.json delete authors/id/A/AB/AUTHOR/Foo-1.0.tar.gz

Remove a single distribution's packages from the index, given its storage key. Delegates to DarkPAN::Indexer->delete_from_index( distribution => $key ).

EXIT STATUS

Returns $SUCCESS (0) on success. Errors from the orchestrator (missing config, storage failures, lock contention) propagate as exceptions.

SEE ALSO

DarkPAN::Indexer

AUTHOR

Rob Lauer - <rlauer@treasurersbriefcase.com>