> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/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
```

![List project documentation example](https://mintcdn.com/praisonai/pFBcVNzCyPC2mUmz/cli/docs-list-project-documentation.gif?s=faa81cfce5fa7c5b5df7cd26013878c3)

```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

> **Keep Docs Focused**
>
> Each doc should cover one topic. Split large docs into smaller, focused ones.

> **Use Priority**
>
> Set higher priority for frequently needed docs so they're included first.

> **Use Tags**
>
> Tag docs for easy filtering and organization.

> **Update Regularly**
>
> Keep docs in sync with your codebase changes.

## Related

* [Rules](https://praison.ai/docs/cli/rules.md) - Project rules for AI agents
* [Memory](https://praison.ai/docs/cli/memory.md) - Agent memory management
* [Mentions](https://praison.ai/docs/cli/mentions.md) - @mention syntax for context


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.