> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Docs

> Manage project documentation for AI context

The `docs` command manages project documentation in `.praison/docs/` that provides context to AI agents.

## Quick Start

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# List all docs
praisonai docs list
```

<Frame>
  <img src="https://mintcdn.com/praisonai/SX0Y8_-DRBjzOTnt/docs/cli/docs-list-project-documentation.gif?s=55ec699585aefbe3351b5cee5a559f2c" alt="List project documentation example" width="1497" height="1104" data-path="docs/cli/docs-list-project-documentation.gif" />
</Frame>

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Create a new doc
praisonai docs create project-overview "This project is a Python web application..."

# Show a specific doc
praisonai docs show project-overview
```

## Commands

### List Docs

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai docs list
```

**Expected Output:**

```
                          Project Documentation                           
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Name             ┃ Description                   ┃ Priority ┃ Tags        ┃ Scope     ┃
┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ project-overview │ Project overview              │ 100      │ overview    │ workspace │
│ architecture     │ System architecture           │ 90       │ design      │ workspace │
│ api-reference    │ API documentation             │ 80       │ api         │ workspace │
└──────────────────┴───────────────────────────────┴──────────┴─────────────┴───────────┘
```

### Create Doc

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai docs create <name> <content>
```

**Example:**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai docs create coding-standards "Use type hints for all functions. Follow PEP 8."
```

**Expected Output:**

```
✅ Doc created: coding-standards
```

### Show Doc

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai docs show <name>
```

**Example:**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai docs show project-overview
```

**Expected Output:**

```
Doc: project-overview
Description: Doc created via CLI: project-overview
Priority: 100

Content:
This project is a Python web application using FastAPI...
```

### Delete Doc

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai docs delete <name>
```

**Example:**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai docs delete old-doc
```

**Expected Output:**

```
✅ Doc deleted: old-doc
```

## Doc File Format

Docs are stored as markdown files with YAML frontmatter:

```markdown theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
---
description: "Project architecture overview"
priority: 10
tags: ["architecture", "design"]
---

# Architecture Overview

This project uses a microservices architecture...
```

### Frontmatter Fields

| Field         | Type   | Description                                      |
| ------------- | ------ | ------------------------------------------------ |
| `description` | string | Short description of the doc                     |
| `priority`    | int    | Priority (higher = included first, default: 100) |
| `tags`        | list   | Tags for categorization                          |

## Storage Locations

| Location             | Scope     | Description                |
| -------------------- | --------- | -------------------------- |
| `.praison/docs/`     | Workspace | Project-specific docs      |
| `~/.praisonai/docs/` | Global    | Shared across all projects |

## Use Cases

### Project Context

Create docs that provide project context to agents:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Create project overview
praisonai docs create project-overview "
# Project: MyApp

A Python web application for task management.

## Tech Stack
- FastAPI backend
- PostgreSQL database
- React frontend

## Key Features
- User authentication
- Task CRUD operations
- Real-time notifications
"
```

### Coding Standards

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai docs create coding-standards "
# Coding Standards

- Use type hints for all function parameters
- Follow PEP 8 style guide
- Maximum function length: 50 lines
- Write docstrings for all public functions
- Use pytest for testing
"
```

### API Documentation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai docs create api-reference "
# API Reference

## Endpoints

### GET /api/tasks
Returns all tasks for the authenticated user.

### POST /api/tasks
Creates a new task.

### PUT /api/tasks/{id}
Updates an existing task.
"
```

## Using Docs with @mentions

Reference docs in prompts using the `@doc:` mention:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "@doc:coding-standards review this code"
praisonai "@doc:api-reference add a new endpoint for users"
```

## Python API

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import DocsManager

# Initialize
docs = DocsManager(workspace_path=".")

# List all docs
all_docs = docs.list_docs()

# Get a specific doc
doc = docs.get_doc("project-overview")
print(doc.content)

# Create a doc
docs.create_doc(
    name="new-doc",
    content="# New Documentation\n\nContent here...",
    description="New documentation",
    priority=100,
    tags=["example"]
)

# Delete a doc
docs.delete_doc("old-doc")

# Get docs for context
context = docs.format_docs_for_prompt(
    include_docs=["project-overview", "coding-standards"],
    max_chars=10000
)
```

## Best Practices

<CardGroup cols={2}>
  <Card title="Keep Docs Focused" icon="bullseye">
    Each doc should cover one topic. Split large docs into smaller, focused ones.
  </Card>

  <Card title="Use Priority" icon="arrow-up">
    Set higher priority for frequently needed docs so they're included first.
  </Card>

  <Card title="Use Tags" icon="tags">
    Tag docs for easy filtering and organization.
  </Card>

  <Card title="Update Regularly" icon="rotate">
    Keep docs in sync with your codebase changes.
  </Card>
</CardGroup>

## Related

* [Rules](/cli/rules) - Project rules for AI agents
* [Memory](/cli/memory) - Agent memory management
* [Mentions](/cli/mentions) - @mention syntax for context
