Skip to main content

govinbox CLI

Federal set-aside contract opportunities from your terminal. Or your AI agent's terminal.

The CLI is a thin wrapper over the versioned GovInbox REST API. All the logic lives on the server behind /v1/. This tool only builds requests and prints answers. It has zero dependencies beyond Python itself.

Install

Coming soon: pip install govinbox. Until the first release, install straight from the repo:

pip install git+https://github.com/AUsernameForYou/setaside-radar.git#subdirectory=cli

Requires Python 3.10 or newer. That is the whole install. No API keys to configure by hand, no virtualenv dance.

Quickstart

govinbox login
# paste your API token (from your trial confirmation email or account page)

govinbox search --set-aside sdvosb --naics 5415 --limit 10

govinbox opportunity <notice-id>

govinbox digest

Commands

Every command takes --json for machine-readable output (agents, pipes, scripts). Without it you get readable tables.

Command What it does
govinbox login Save your API token on this machine (stored at ~/.config/govinbox/credentials, readable only by you). The token is verified against the server; if it fails, nothing is kept.
govinbox logout Remove the saved token.
govinbox whoami Check the saved token is valid and show how many watchlists you have.
govinbox search Search opportunities. Filters: --set-aside (sdvosb, 8a, hubzone, wosb, veteran, indian, smallbiz), --naics (prefix like 5415), --keyword, --agency (e.g. "veterans affairs"), --days (default 7), --limit (default 25).
govinbox opportunity <id> Full details for one opportunity, including the SAM.gov link and early signals.
govinbox watchlists List your saved searches.
govinbox watchlist <id> Show one saved search.
govinbox digest [--watchlist <id>] [--days N] New matches for your watchlists, plain-English lines, newest first.
govinbox version CLI version, API endpoint, and server version.

Add --debug to any command to see full error details.

Examples

# SDVOSB IT opportunities posted in the last 3 days
govinbox search --set-aside sdvosb --naics 5415 --days 3

# Pipe titles into another tool (this is the agent pattern)
govinbox search --keyword cybersecurity --json | jq -r '.items[].title'

# Everything due within the week, as JSON
govinbox search --limit 100 --json | jq '[.items[] | select(.days_left <= 7)]'

# This morning's digest for one watchlist
govinbox digest --watchlist abc123 --days 1

# Full detail plus raw data for scripting
govinbox opportunity abc123 --json > opp.json

Auth

govinbox login prompts for your API token and saves it to ~/.config/govinbox/credentials with owner-only permissions (0600). Nothing is ever printed back.

Two overrides, for CI and agents:

  • GOVINBOX_API_TOKEN environment variable: used instead of the saved token.
  • GOVINBOX_API_URL environment variable: point at a staging server instead of https://api.getgovinbox.com.

If your token is rejected you will see:

Your API token was rejected. Run govinbox login to refresh your token.

That is always the fix. If it keeps failing, check that you pasted the full token.

How versioning works

The CLI never contains business logic, so it rarely needs to change. The API is versioned (/v1/), and every request sends an X-GovInbox-CLI-Version header identifying the client. The server does not act on the header today; it exists so the server can warn outdated clients in the future. govinbox version compares your CLI against the server's reported version.

Exit codes

Scripts can rely on these:

Code Meaning
0 Success
1 General error (bad arguments from the server, network failure, unexpected error)
2 Not logged in, or the token was rejected (govinbox login is the fix)
3 Subscription lapsed (HTTP 402)
4 Rate limited (HTTP 429; the message tells you when to retry)
5 Not found (HTTP 404)
6 Bad request (HTTP 400)
130 Cancelled with Ctrl-C

Errors print one plain-English line to stderr and never a traceback, unless you pass --debug.

Metadata

Release files for govinbox 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for govinbox 0.1.0
File Size Uploaded Provenance Actions
govinbox-0.1.0.tar.gz 19.1 kB Without provenance Details for govinbox-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for govinbox 0.1.0
File Interpreter ABI Platform Actions
govinbox-0.1.0-py3-none-any.whl Python 3 none any Details for govinbox-0.1.0-py3-none-any.whl

Total release size: 32.5 kB

Release files / govinbox-0.1.0.tar.gz

Download URL govinbox-0.1.0.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0ff929ba5ecb265c99922ba3d98caf3d39159fda95843a1b42a47b3530f15745
BLAKE2b-256 checksum
How to use checksums
3b7f743c4b838edc83374060a56cde6cfa8fcffdb9c423f2934b101014aaa471
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / govinbox-0.1.0-py3-none-any.whl

Download URL govinbox-0.1.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ecd7cb0cac8baea209c0a64ee83b15eac6476267a80daee0c80109df6782a78
BLAKE2b-256 checksum
How to use checksums
e019f49cc6d285065b389f6d359bebdbd0c05ab65097c917f06fdc6f21821d83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for govinbox 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page