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.

For AI agents

pip install govinbox
govinbox login            # paste your API token (or set GOVINBOX_TOKEN)
govinbox search --set-aside sdvosb --limit 10 --json
govinbox --help

Prefer the hosted MCP server over the CLI when your client supports it: https://mcp.getgovinbox.com/mcp (OAuth 2.1 + PKCE). Machine-readable docs: https://getgovinbox.com/for-ai.md

Install

pip install govinbox

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.1

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.1
File Size Uploaded Provenance Actions
govinbox-0.1.1.tar.gz 19.1 kB Without provenance Details for govinbox-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 32.6 kB

Release files / govinbox-0.1.1.tar.gz

Download URL govinbox-0.1.1.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f018cf070f476f31435d24a79a0b9ffcb372b4dc0b1b89f96f009212c81eb5fb
BLAKE2b-256 checksum
How to use checksums
f5b133141739ca282fafb0e5679fd319633963c59d977d5a0efe1cc3c7b5e5e0
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.1-py3-none-any.whl

Download URL govinbox-0.1.1-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82a91d538b4b86d018674b1334f5e7ecffc8a6dbb3e8d63658113b75ec736880
BLAKE2b-256 checksum
How to use checksums
58ccb4f99bdcc0eef9623d030d40bf7f31de2f65b92cceb3a8869c150a390bea
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.1

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