Imperal Docs

Components showcase

Every UI component used across these docs — see them all in action on one page

This is a single-page demo of every Fumadocs UI component used across these docs. If you're authoring or porting docs, copy-paste from here.

Cards

<Cards>
  <Card icon="🚀" title="Title" href="/en/..." description="..." />
</Cards>

Steps

<Steps>
  <Step>### Title — content</Step>
</Steps>

Install the SDK

pip install imperal-sdk

Define a Pydantic model

class GreetParams(BaseModel):
    name: str = Field(description="Person to greet")

Register a handler

@chat.function(description="...")
async def greet(ctx, params): ...

Publish

imperal build .
imperal validate .
# Then upload at panel.imperal.io/developer

Tabs

<Tabs items={['Python', 'Bash', 'JSON']}>
  <Tab value="Python">...</Tab>
</Tabs>
async def greet(ctx, params):
    return {"text": f"Hello, {params.name}! 🐝"}
imperal test --tool greet --args '{"name": "Alex"}'
{ "text": "Hello, Alex! 🐝" }

Callouts

<Callout type="info|warn|error">...</Callout>

Info callout

Neutral information. Use this for caveats, references, or expansion of a point made in main text.

Warning

Something the reader should be careful about. Common federal-discipline pitfalls live here.

Critical / banned pattern

Do not do this. Federal blocker, security risk, or a known-bad pattern that breaks invariants.

Files (project structure)

<Files>
  <Folder name="my-ext" defaultOpen>
    <File name="app.py" icon="🐍" />
  </Folder>
</Files>
🐍app.py
📋imperal.json
🐍schemas.py
🌍i18n.json
📖README.md

Accordions

<Accordions>
  <Accordion title="Question?">Answer body.</Accordion>
</Accordions>

TypeTable

<TypeTable
  type={{
    fieldName: { type: "...", default: "...", description: "..." },
  }}
/>

Prop

Type

Tables (Markdown)

| Header | Header |
|--------|--------|
| cell   | cell   |
ClassSeverityAfter v4.0+
Silent write failures🔴 critical✅ closed — typed dispatch
Hallucinated IDs🔴 critical✅ closed — I-AH-1 + V17
Confirmation bypass🔴 critical✅ closed — typed-iterate
Lifecycle TypeError🟠 high✅ closed for new publishes — V22

Code blocks with title

```python title="app.py"
print("hi")
```
app.py
from imperal_sdk import Extension, ChatExtension, ActionResult
from pydantic import BaseModel, Field

class GreetParams(BaseModel):
    name: str = Field(description="Person to greet")

ext = Extension(
    "hello-world",
    version="1.0.0",
    display_name="Hello World",
    description="Demo extension that greets people by name with a friendly message.",
    icon="icon.svg",
    actions_explicit=True,
)

chat = ChatExtension(ext, tool_name="hello_world", description="Hello World — friendly greetings.")

@chat.function("greet", action_type="read", description="Greet someone by name with a friendly message.")
async def greet(ctx, params: GreetParams) -> ActionResult:
    return {"text": f"Hello, {params.name}! 🐝"}

Code blocks with language

pip install imperal-sdk
imperal build
imperal test --tool greet --args '{"name": "Alex"}'
{
  "schema_version": 3,
  "name": "hello-world",
  "actions_explicit": true,
  "tools": [
    { "name": "greet", "action_type": "read" }
  ]
}
- old_action = "destructive"
+ new_action = "destructive"
+ id_projection = "folder_id"   ← v4.1.2 federal-clean

Inline code and emphasis

Use inline code for identifiers, bold for emphasis, italics for terms or quotes.

Block quotes for user-facing text or citations.

ASCII diagrams in fenced blocks

USER (browser)


AUTH GATEWAY  (auth.imperal.io)


WEBBEE WEB-KERNEL


YOUR EXTENSION

Mixing it together

A real example combining components:

Define a typed handler

class CreateNoteParams(BaseModel):
    title: str = Field(description="Short title.")
    content_text: str = Field(description="Full note content — write the actual content.")
@chat.function(description="Create a note.", action_type="write")
async def create_note(ctx, params):
    note = await ctx.http.post("/notes", json=params.model_dump())
    return {"text": f"Created: {note['title']}", "note_id": note["id"]}

Validate

imperal validate

9 ERROR-severity validators run

V14-V22 + V24 + V31 — see the validators reference.

Publish

imperal build .
imperal validate .
# Then upload at panel.imperal.io/developer

Where to next

On this page