Skip to content

Commit b68762d

Browse files
DevRohit06claude
andcommitted
docs: add complete Lito documentation site with landing page
- 27 MDX pages: getting started, guides, use cases, architecture, comparisons, troubleshooting, and reference sections - Custom landing page with dark dev-tool aesthetic (blurple theme) - Animated terminal demo, feature grid, JSONL protocol explainer - GitHub Pages deploy workflow (triggers on docs/ changes) - Logo (chat bubble + terminal prompt), favicon - CLAUDE.md with project guidance - Sharp border design system throughout Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4a0e308 commit b68762d

44 files changed

Lines changed: 12465 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "docs/**"
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: pages
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
29+
- name: Build docs with Lito
30+
run: npx @litodocs/cli build -i ./docs -o ./docs/dist
31+
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: ./docs/dist
36+
37+
deploy:
38+
needs: build
39+
runs-on: ubuntu-latest
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ __pycache__/
44
dist/
55
build/
66
*.egg
7+
8+
# Docs build output
9+
docs/dist/
10+
docs/.astro/
11+
docs/node_modules/

CLAUDE.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
discli is a Discord CLI for AI agents and humans — a Python command-line tool for managing Discord servers, messages, reactions, threads, DMs, and events from the terminal. Published on PyPI as `discord-cli-agent`.
8+
9+
## Commands
10+
11+
```bash
12+
# Install (editable, with dev deps)
13+
pip install -e ".[dev]"
14+
15+
# Run tests
16+
pytest tests/ -v
17+
18+
# Run a single test
19+
pytest tests/test_utils.py -v
20+
21+
# Build package
22+
python -m build
23+
```
24+
25+
No linter is configured. Commit style: conventional commits (`feat:`, `fix:`, `docs:`, `chore:`).
26+
27+
## Architecture
28+
29+
**Entry point:** `src/discli/cli.py` → Click root group → registers all command groups.
30+
31+
**Core flow:** Click CLI → permission/audit check (security.py) → `run_discord()` (client.py) → async discord.py action → `output()` (utils.py).
32+
33+
**Key modules:**
34+
- `client.py` — Token resolution (flag → env var → config file), `run_discord()` sync wrapper around async Discord actions
35+
- `security.py` — Permission profiles (full/chat/readonly/moderation), audit logging to `~/.discli/audit.log` (JSONL), token-bucket rate limiter
36+
- `utils.py` — Output formatting (text/JSON via `--json` flag), channel/guild resolvers
37+
- `config.py` — Token storage at `~/.discli/config.json`
38+
39+
**Command pattern:** Each module in `commands/` defines Click commands, takes an async action function, and calls `run_discord(ctx, action)`. Follow existing modules when adding new commands.
40+
41+
**`serve` command (commands/serve.py):** The largest module (~1100 lines). Runs a persistent bot with bidirectional JSONL over stdin/stdout. Features: event forwarding, action dispatch (send/reply/edit/delete/stream/typing/reactions/threads/polls/channels/members/roles/DMs), slash command registration, streaming message edits with periodic flush, Windows-compatible stdin reading via threading.
42+
43+
## Adding a New Command
44+
45+
1. Create file in `src/discli/commands/`
46+
2. Define Click group/command following existing patterns
47+
3. Register in `src/discli/cli.py`
48+
4. Add tests in `tests/`
49+
5. Update `agents/discord-agent.md` with command reference
50+
51+
## Docs Development
52+
53+
```bash
54+
# Start docs dev server (Lito, Astro-based)
55+
npx @litodocs/cli dev -i ./docs
56+
57+
# Build docs for production
58+
npx @litodocs/cli build -i ./docs -o ./docs/dist
59+
```
60+
61+
Docs live in `docs/` — Lito framework with `docs-config.json` for sidebar/theme. Custom landing page in `docs/_landing/`.
62+
63+
## Release Process
64+
65+
Bump version in `pyproject.toml` → commit → `git tag vX.Y.Z && git push origin vX.Y.Z` → CI runs tests (Python 3.10–3.13), builds, creates GitHub Release, publishes to PyPI.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<p align="center">
2-
<h1 align="center">discli</h1>
3-
<p align="center">Discord CLI for AI agents and humans</p>
2+
<img src="docs/public/logo.svg" width="80" height="80" alt="discli logo" />
43
</p>
4+
<h1 align="center">discli</h1>
5+
<p align="center">Discord CLI for AI agents and humans</p>
56

67
<p align="center">
78
<a href="https://pypi.org/project/discord-cli-agent/"><img src="https://img.shields.io/pypi/v/discord-cli-agent?color=blue&label=PyPI" alt="PyPI"></a>

docs/_css/custom.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* discli docs — Sharp borders override */
2+
:root {
3+
--radius: 0;
4+
--radius-xs: 0;
5+
--radius-sm: 0;
6+
--radius-md: 0;
7+
--radius-lg: 0;
8+
--radius-xl: 0;
9+
--radius-2xl: 0;
10+
}

0 commit comments

Comments
 (0)