> This page is for Postman Docs, version Latest (v12) (default).
> For other versions, use one of these documentation indexes:
> - Latest (v12) (default): https://learning.postman.com/latest-v-12/llms.txt
> - v11: https://learning.postman.com/v11/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Query Context Graph with the Postman CLI

> Ask your team's Postman Context Graph natural-language questions from your terminal or a coding agent with the Postman CLI.

You can query [Postman Context Graph](/docs/use/context-graph/get-started/) from your terminal with the Postman CLI's [`postman context-graph ask`](/docs/postman-cli/postman-cli-context-graph/#postman-context-graph-ask) command. Ask natural-language questions, such as what depends on a given API, and get answers grounded in your team's graph. Coding agents such as Claude Code, Codex, and Cursor can run the same commands from your repository.

## Prerequisites

* Context Graph enabled for your team. Check with your Postman admin.
* The [Postman CLI](/docs/postman-cli/postman-cli-installation/), signed in with [`postman login`](/docs/postman-cli/postman-cli-auth/#postman-login). The team a query runs against comes from your credentials.

## Set up your repository with `postman init`

To use Context Graph from a coding agent, run [`postman init`](/docs/postman-cli/postman-cli-init/) in your repository first. It sets up a Postman project and installs Postman's agent skills, which give your coding agent the information it needs to work with the Postman CLI.

```bash
postman init
```

## Query the graph

To query Context Graph with the Postman CLI, do the following:

1. Ask a question and wait for the answer:

   ```bash
   postman context-graph ask "What depends on billing-api?" --wait
   ```

2. (Optional) If you submit a question without `--wait`, the command returns an ask ID. To get the answer later, check the ask with [`postman context-graph status`](/docs/postman-cli/postman-cli-context-graph/#postman-context-graph-status):

   ```bash
   postman context-graph status <ask-id>
   ```

For all the options, see [Postman CLI context-graph commands](/docs/postman-cli/postman-cli-context-graph/).