# graph

## Usage

`prism graph` is used to render your project's DAG as a website.

```
Usage: prism graph [OPTIONS]                                                                                                        
                                                                                                                                     
 Visualize your Prism project as a DAG in an interactive UI.                                                                         
                                                                                                                                     
 Examples:                                                                                                                           
                                                                                                                                     
  • prism graph                                                                                                                      
  • prism graph --no-browser --port 3000                                                                                             
                                                                                                                                     
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --port        -p  INTEGER                  Port to use for HTTP request; default is 8080                                          │
│ --no-browser                               Overwrite default behavior and do not open a tab in the default web browser with the   │
│                                            docs UI.                                                                               │
│ --log-level   -l  [info|warn|error|debug]  Set the log level                                                                      │
│ --full-tb                                  Show the full traceback when an error occurs                                           │
│ --help                                     Show this message and exit.                                                            │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

When you execute the `prism graph` command, Prism compiles the project, parses the `task.ref(...)` calls to create the DAG, and stores information about the compiled project in a JSON manifest. This manifest contains information on the DAG's topological sort and the source code for the different tasks, and it is used in the backend construction of the website.

## Example

Here's what the output looks like in Terminal:

```
$ prism graph
--------------------------------------------------------------------------------
<HH:MM:SS> | INFO  | Running with prism v0.2.7...
<HH:MM:SS> | INFO  | Found project directory at /Users/my_first_project
<HH:MM:SS> | INFO  | RUNNING EVENT 'task DAG'................................................................ [RUN]
<HH:MM:SS> | INFO  | FINISHED EVENT 'task DAG'............................................................... [DONE in 0.03s]
<HH:MM:SS> | INFO  | RUNNING EVENT 'populate docs build'..................................................... [RUN]
<HH:MM:SS> | INFO  | FINISHED EVENT 'populate docs build'.................................................... [DONE in 0.03s]
 
<HH:MM:SS> | INFO  | Serving docs at http://127.0.0.1:8080
<HH:MM:SS> | INFO  | Press Ctrl+C to exit
 
127.0.0.1 - - [dd/Mon/Year HH:MM:SS] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [dd/Mon/Year HH:MM:SS] "GET /54968a39190c43d592b9.svg HTTP/1.1" 200 -
127.0.0.1 - - [dd/Mon/Year HH:MM:SS] "GET /ce188596011a8fa32931.png HTTP/1.1" 200 -
127.0.0.1 - - [dd/Mon/Year HH:MM:SS] "GET /manifest.json HTTP/1.1" 200 -
127.0.0.1 - - [dd/Mon/Year HH:MM:SS] "GET /311ea03002abadcdcaba.png HTTP/1.1" 200 -
127.0.0.1 - - [dd/Mon/Year HH:MM:SS] "GET /737ad70b3f2d3a9b5f6e.ico HTTP/1.1" 200 -
```

Here's what an example project looks like:

<figure><img src="https://content.gitbook.com/content/0gziVZPBrCB9FGhcffNa/blobs/llYaPKesANjV2gQ8ryNI/new_docs.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.runprism.com/v0.2.7/cli/graph.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
