🟢 | Command line for docmachine
Find a file
Glenn Y. Rolland af347bb17c
Some checks failed
continuous-integration/drone/push Build is failing
feat(build): Add --no-cache option to build command
This change introduces a mechanism to explicitly disable the container
image cache, preventing unnecessary re-downloads of the DocMachine
container image. Without this, users would be forced to manually clear
the cache directory to ensure a fresh image download, which is
cumbersome and prone to errors.

- Introduce a new CLI option --no-cache for the build command to disable
  image caching.
- Add a corresponding --cache option, which explicitly enables caching
  (the default behavior).
- Update the build configuration to set enable_cache to true by default,
  ensuring caching is active unless explicitly disabled.
- Document the new --no-cache option and the default caching behavior in
  the README.
- Add a new spec to verify that the --cache and --no-cache options are
  surfaced in the build --help output.

Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
2026-01-20 19:15:14 +01:00
.adr feat(cleanup): implement unified strategy for process and container coordination 2025-11-20 01:02:03 +01:00
.method docs(audit): enhance audit methodology documentation 2025-11-19 17:38:10 +01:00
.tasks feat(container-manager): Implement registry and recovery mechanisms 2025-11-20 02:07:19 +01:00
data feat(write): Add basic support for prompts management 2023-04-27 20:49:32 +02:00
docs data: Prepare better samples 2023-04-18 10:49:43 +02:00
old feat: initial import 2023-01-18 16:29:34 +01:00
spec feat(build): Add --no-cache option to build command 2026-01-20 19:15:14 +01:00
src feat(build): Add --no-cache option to build command 2026-01-20 19:15:14 +01:00
templates refactor(build): update dependencies and refactor CLI structure 2025-11-19 12:32:22 +01:00
.drone.yml Update .drone.yml 2025-03-27 15:37:04 +01:00
.gitignore chore: Update .gitignore to include .aider* and .env files 2025-03-27 15:37:04 +01:00
AUDIT-REPORT.md docs(audit): enhance audit methodology documentation 2025-11-19 17:38:10 +01:00
CRUSH.md refactor(adr): update ADR filenames to chronological format 2025-11-19 16:23:45 +01:00
LICENSE chore: add LICENSE file 2024-05-31 16:53:11 +02:00
Makefile feat: add more targets to makefile (ex: install) 2024-02-15 18:56:31 +01:00
README.md feat(build): Add --no-cache option to build command 2026-01-20 19:15:14 +01:00
shard.lock refactor(build): update dependencies and refactor CLI structure 2025-11-19 12:32:22 +01:00
shard.yml refactor(build): update dependencies and refactor CLI structure 2025-11-19 12:32:22 +01:00
TASKS.md feat(container-manager): Implement registry and recovery mechanisms 2025-11-20 02:07:19 +01:00

DocMachine Cli

DocMachine Cli is a tool designed to simplify the process of creating technical documentation and presentations.

Motivation

This project aims to address the following challenges:

  • Automation: Automate the generation of high-quality technical content, including documentation and presentation slides.
  • Consistency: Ensure a consistent and polished look and feel across all content pieces.
  • Efficiency: Reduce the time and effort required to produce content by leveraging AI tools.

Features

DocMachine offers a range of features to streamline the content creation process:

  • Scaffolding: Generate a well-structured project directory with all the necessary files.
  • Building: Compile and publish your content as HTML and PDF documents using Dockerized build processes.

We are actively developing the following features for future releases:

  • Planning: Leverage LLMs (Large Language Models) to generate content outlines tailored to your specific needs and requirements.
  • Writing: Utilize LLMs to draft content for each section and subsection, saving you valuable time and effort.

Prerequisites

You'll need a recent version of Crystal (>= 1.11.0) to use this project.

You'll also need to install a few dependencies:

  • libreadline-dev
  • libncurses-dev

Getting Started

Follow these steps to start using DocMachine Cli:

Installation

git clone https://code.apps.glenux.net/glenux/docmachine-cli.git docmachine-cli
cd docmachine-cli
make build
make install

Create a New Project

docmachine scaffold my-documentation-project

This command will create a new directory named my-documentation-project with the following structure:

my-documentation-project
├── _build
├── docs
│   └── images  # link to ../images
├── slides
│   └── images  # link to ../images
└── images

Start Writing Content

  • Documentation: Place your Markdown files inside the docs directory.
  • Presentations: Place your Markdown files (using Marp syntax) inside the slides directory.
  • Images: Store your images in the respective images directories.

Live-reload during writing

docmachine build -a watch

By default DocMachine caches the container image archive under $XDG_CACHE_HOME/docmachine (or ~/.cache/docmachine). If you need to force a fresh download, run:

docmachine build --no-cache -a watch

This command will start a Docker container and build your documentation and presentations:

  • Documentation: Built using MkDocs and served on http://localhost:5100.
  • Presentations: Built using Marp and served on http://localhost:5200.

Building content for publishing or presentation

docmachine build -a build-slides-pdf
docmachine build -a build-docs-pdf
docmachine build -a build-docs-html

This command will generate the HTML and PDF versions of your content.

Testing and Specs

All automated tests live in the spec/ tree and are executed with crystal spec --error-trace (see CRUSH.md). Each top-level command (build, container, etc.) has its own folder so new specs sit next to the code they verify. For example, spec/build/run_spec.cr documents and tests cache behavior using a fake container engine, making it easy to understand how image caching should work. Add new specs beside the relevant command so the structure remains discoverable.

Contributing

We welcome contributions to DocMachine! To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Submit a pull request.

License

DocMachine Cli is licensed under the GPL-3.0-or-later license. See the LICENSE file for details.