npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@julesbonnard/apicore-cli

v1.1.0

Published

A modern CLI to get fresh news from apicore

Readme

apicore CLI

A modern command-line interface for AFP apicore — search news, retrieve documents, manage notifications, and handle authentication.

oclif GitHub license

Quick start

npm install -g @julesbonnard/apicore-cli

# Authenticate (interactive prompts for credentials)
apicore login --apiKey YOUR_API_KEY

# Search for recent news
apicore search "climate change" --size 5

# Get a specific document
apicore get TS4XRII6FF

Installation

npm install -g @julesbonnard/apicore-cli

Requires Node.js >= 20.

Authentication

All commands except login require a valid token. Tokens are stored locally in ~/.config/apicore/config.json (or ~/.config/apicore/<profile>/config.json when using --profile) and refreshed automatically.

# First-time setup: provide your API key, then enter username/password
apicore login --apiKey YOUR_API_KEY

# Check authentication status
apicore login --info

# Use a separate profile (e.g. for staging)
apicore login --profile staging

# Remove stored credentials
apicore logout

You can also pass --username and --password flags for non-interactive use.

If you run any command without having authenticated yet, the CLI will interactively ask for an API key and base url (leave the API key empty to use anonymous access) and save your answers for next time. This onboarding prompt is skipped in non-interactive environments (CI, piped input) and when using --json.

Commands

apicore search [QUERY]

Search documents with filters and multiple output formats.

# Basic search
apicore search "france"

# Filter by language and class
apicore search "elections" -l fr,es -c text

# Date range
apicore search --from 2024-01-01 --to 2024-06-01

# Output as JSON (one object per line, streamable)
apicore search --json

# Output as table, CSV or JSON
apicore search --table
apicore search --output csv
apicore search --csv

# Show all columns
apicore search --table --extended

| Flag | Short | Description | Default | |------|-------|-------------|---------| | --fields | -f | Fields to return | afpshortid, created, country, countryname, city, headline, lang, class, published, revision, slug, uno, news | | --langs | -l | Filter by languages (comma-separated) | | | --class | -c | Filter by document class (comma-separated) | | | --from | | Start date | 1980-01-01 | | --to | | End date | now | | --size | | Max documents to return | 10 | | --sortField | | Field to sort by | published | | --sortOrder | | asc or desc | desc | | --table | | Display as formatted table | | | --output | | csv or json | | | --csv | | Shortcut for --output csv | | | --columns | | Show specific columns (comma-separated) | | | --extended | | Show all columns including hidden ones | |

apicore get ID

Retrieve a single document by UNO or shortId (7 characters).

apicore get TS4XRII6FF
apicore get abc1234       # shortId lookup
apicore get TS4XRII6FF --json

apicore notifications services

List and manage notification services.

# List all services
apicore notifications services

# Register a new mail service
apicore notifications services create my-service --type mail --datas '{"address":"[email protected]"}'

# Register a new rest (webhook) service
apicore notifications services create my-service --type rest --datas '{"href":"https://example.com/hook","user":"u","password":"p"}'

# Delete a service
apicore notifications services delete my-service

--type accepts mail, rest, sqs or jms; --datas is a JSON object whose shape depends on the type:

| Type | --datas shape | |------|------------------| | mail | { "address": string } | | rest | { "href": string, "user"?: string, "password"?: string } | | sqs | { "accessKey": string, "secretKey": string, "region": string, "queue": string, "ownerId": string } | | jms | { "url": string, "type": string, "queueName": string, "username": string, "password": string, "ttlInSeconds": string, "qosEnabled": string, "deliveryMode": string } |

apicore notifications subscriptions [SERVICENAME]

List and manage notification subscriptions.

# List all subscriptions
apicore notifications subscriptions

# List subscriptions for a specific service
apicore notifications subscriptions my-service

# Add a subscription to a service
apicore notifications subscriptions create my-service my-subscription "france" -l fr,es

# Delete a subscription
apicore notifications subscriptions delete my-service sub-123

Global flags

| Flag | Description | |------|-------------| | --json | Output as JSON (available on login, get, search) | | --profile | Use a named profile for separate auth configs | | --help | Show help for any command | | --version | Show CLI version |

Development

git clone https://github.com/julesbonnard/apicore-cli.git
cd apicore-cli
pnpm install
pnpm build

# Run in development mode (no build needed)
./bin/dev.js search "test"

License

MIT