| Crates.io | localdoc |
| lib.rs | localdoc |
| version | 8.1.0 |
| created_at | 2025-11-11 07:16:43.164115+00 |
| updated_at | 2025-11-27 00:55:40.258889+00 |
| description | A command line utility to facilitate interaction with .docpacks. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1926815 |
| size | 64,960 |
A command-line tool for creating, managing, and running AI-powered documentation on .docpack archives.
cd cli
cargo build --release
The binary will be available at target/release/localdoc.
cargo install --path .
ingest - Create a docpack from sourceCreate a new .docpack from a source directory, zip file, or git repository.
localdoc ingest <SOURCE> [OPTIONS]
Arguments:
<SOURCE> - Path to source directory, zip file, or git URLOptions:
-o, --out <OUT> - Output .docpack directory path (default: out.docpack)-n, --name <NAME> - Docpack name (defaults to source directory name)-d, --description <DESCRIPTION> - Description for the docpack-l, --language <LANGUAGE> - Primary language of the source code--all-tools - Enable all available tools (default: basic subset)--build-index - Build search index during ingestion--build-graph - Build semantic graph during ingestionExamples:
# Create a docpack from a local directory
localdoc ingest ./my-project -o my-project.docpack
# Create with all tools and indexing enabled
localdoc ingest ./my-project --all-tools --build-index --build-graph
# Create with custom metadata
localdoc ingest ./my-project \
-n "My Awesome Project" \
-d "Documentation for my awesome project" \
-l "python"
run - Execute documenter on a docpackRun the AI documenter agent on a .docpack using Docker.
localdoc run <DOCPACK> [OPTIONS]
Arguments:
<DOCPACK> - Path to .docpack directoryOptions:
-i, --image <IMAGE> - Docker image to use (default: doctown:latest)-f, --follow - Follow logs in real-timeExamples:
# Run documenter on a docpack
localdoc run my-project.docpack
# Run with custom Docker image
localdoc run my-project.docpack -i doctown:v2
# Run and follow logs
localdoc run my-project.docpack -f
Prerequisites:
.env file with OPENAI_API_KEY must exist in current directorydocker build -t doctown:latest ../documenter/inspect - View docpack metadataInspect a .docpack's structure, metadata, and contents.
localdoc inspect <DOCPACK> [OPTIONS]
Arguments:
<DOCPACK> - Path to .docpack directoryOptions:
-v, --verbose - Show detailed information including file tree and task listExamples:
# Basic inspection
localdoc inspect my-project.docpack
# Detailed inspection with file tree
localdoc inspect my-project.docpack -v
Output:
validate - Validate docpack structureValidate a .docpack against the DOCPACK_SPEC to ensure it's well-formed.
localdoc validate <DOCPACK>
Arguments:
<DOCPACK> - Path to .docpack directoryExamples:
localdoc validate my-project.docpack
Checks:
files/, index/, output/)docpack.json exists and is valid JSONdocpack.json has required fields (version, environment)tasks.json is valid JSON (if present)init - Initialize empty docpackCreate a new empty .docpack structure with template files.
localdoc init <PATH> [OPTIONS]
Arguments:
<PATH> - Path for new .docpack directoryOptions:
-n, --name <NAME> - Docpack name--with-tasks - Create a minimal example tasks.jsonExamples:
# Create minimal docpack
localdoc init my-project.docpack
# Create with name and tasks template
localdoc init my-project.docpack -n "My Project" --with-tasks
localdoc ingest ./my-codebase \
-o my-codebase.docpack \
--all-tools \
--build-index
Edit my-codebase.docpack/tasks.json to define your documentation goals:
{
"mission": "Create comprehensive API documentation",
"tasks": [
{
"id": "task_1",
"name": "Document REST API",
"description": "Create OpenAPI-style documentation for all endpoints",
"output": {
"type": "markdown",
"path": "output/api-docs.md"
}
}
]
}
localdoc validate my-codebase.docpack
localdoc run my-codebase.docpack -f
localdoc inspect my-codebase.docpack -v
cat my-codebase.docpack/output/*.md
The run command expects an .env file in the current directory with:
OPENAI_API_KEY=your_api_key_here
This CLI is designed to work with the Doctown documenter pipeline:
localdoc) - Creates and manages .docpack archives.docpack format specificationcargo build --release
strip target/release/localdoc # Optional: reduce binary size
# Run with cargo
cargo run -- inspect ../example.docpack
# Run tests
cargo test
# Check code
cargo clippy
MIT