We use cookies to ensure you get the best experience on our website. Some of these cookies are provided by third parties. You are free to decide which categories you would like to permit and can withdraw this consent at any time (via cookie preferences link on the footer).
By accepting the necessary cookies, you agree to our privacy policy and terms of service, both located in the footer of the website.
Learn more on our terms of service and privacy policy.
Use AskNews directly from your terminal, scripts, CI jobs, and coding agents. The asknews
executable provides polished commands for common research workflows and generated coverage for
every customer-facing operation in the AskNews API.
curl -fsSL https://docs.asknews.app/cli/install | bashThe curl installer runs npm install -g under ~/.local by default — no token or registry
configuration required. Run it with --help for version, prefix, checksum, PATH, and agent-skill
options. After installing, verify with asknews --help.
Interactive OAuth is recommended:
asknews auth loginFor a terminal without a browser:
asknews auth login --no-browserAPI keys are supported for CI, automation, and agents:
export ASKNEWS_API_KEY="your-api-key"
asknews auth status --output jsonRun a human-readable query:
asknews news search "latest semiconductor export policy" --limit 5For scripts and agents:
asknews news search "latest semiconductor export policy" \
--limit 5 \
--output jsonThe CLI supports OAuth device login and AskNews API keys. It never requires a client secret.
asknews auth login
asknews auth status
asknews auth logoutOAuth tokens refresh automatically when a refresh token is available. Stored credentials live in the platform user-config directory with restricted permissions.
For noninteractive use:
export ASKNEWS_API_KEY="your-api-key"For a persistent local login:
asknews auth login --api-keyThe prompt does not echo the key. In CI, use the environment instead of local storage.
--api-keyASKNEWS_API_KEY| Setting | Flag | Environment variable | Default |
|---|---|---|---|
| API URL | --api-url | ASKNEWS_API_URL | https://api.asknews.app/v1 |
| Auth issuer | --auth-url | ASKNEWS_AUTH_URL | https://auth.asknews.app |
| OAuth client | --oauth-client-id | ASKNEWS_OAUTH_CLIENT_ID | asknews-cli |
| Output | --output | ASKNEWS_OUTPUT | human on a TTY, JSON otherwise |
| Timeout | --timeout | ASKNEWS_TIMEOUT_MS | 60 seconds |
Never commit API keys or OAuth tokens.
The CLI has curated workflows, generated API commands, and a generic request escape hatch. Run
asknews --help at any level for the installed version's exact reference.
The complete command reference documents every curated command and generated API group with usage signatures, arguments, options, defaults, enums, safety metadata, and examples.
asknews news search "energy markets" --limit 10
asknews stories list --query "European elections"
asknews stories get STORY_ID
asknews research "How could export controls affect chip supply?"
asknews web "recent central bank statements"
asknews reddit "consumer reactions to product launch"
asknews wiki "history of semiconductor lithography"
asknews alerts listEvery customer-facing OpenAPI operation appears under asknews api, grouped by API tag:
asknews api --help
asknews api news --help
asknews api news search-news --helpEvery schema parameter is exposed as a kebab-case option:
asknews api news search-news \
--query "energy markets" \
--n-articles 5 \
--historical false \
--output jsonOpenAPI names are converted predictably: start_timestamp becomes --start-timestamp.
Repeatable --param name=value remains available as an escape hatch.
Pass bodies as inline JSON or from a file:
asknews api alerts create-alert --body @alert.jsonasknews request GET /profiles/me --output jsonPrefer curated or generated commands for normal use.
| Format | Option | Best for |
|---|---|---|
| Human | --output human | Curated interactive tables |
| Table | --output table | Force tabular list output |
| JSON | --output json or --json | Scripts, CI, and agents |
| JSON Lines | --output jsonl | Record pipelines |
| YAML | --output yaml | Readable structured inspection |
Result data goes to stdout. Diagnostics and errors go to stderr.
Human and table output wraps complete summaries without truncating them. A horizontal divider separates each result so long, multi-line summaries remain visually distinct.
Curated and generated commands derive their options from the current public OpenAPI schema. Help includes types, required fields, defaults, enum values, formats, numeric ranges, safety, and the underlying operation:
asknews news search --help
asknews stories list --help
asknews research --help
asknews alerts create --help
asknews api chat deep-news --helpList models available to the authenticated account:
asknews research models
asknews research models --output jsonStream research incrementally:
asknews research "Compare current AI regulation proposals" \
--model claude-sonnet-4-6 \
--sources asknews \
--sources reddit \
--engine v2.0 \
--streamFor event-level automation, combine streaming with --output jsonl.
The package includes an asknews-cli skill that teaches coding agents how to select the right
retrieval or research workflow, preserve source provenance, control context and cost, recover from
common errors, and execute authorized mutations safely. Its core instructions stay concise; an
optional task-recipes reference is loaded only for advanced work.
The packaged CLI installs its skill into detected global agent directories by default. To install or refresh it manually:
asknews cli setup --scope globalFor a repository-local skill:
asknews cli setup --scope project --directory .Use ASKNEWS_NO_AGENT_SKILLS=1 to opt out during package installation.
See Agentic usage for automatic and manual skill installation, capability mapping, context-window guidance, and exact command references.
--output json for complete results and --output jsonl for streaming events.--output table only for human inspection.asknews auth status --output json first.asknews news search "latest policy change" --limit 5 --output json
asknews research "Summarize the policy implications" --stream --output jsonl