Skip to content

Built-in CLI Commands

Sayer comes with built-in CLI commands that support:

  • ๐Ÿ“ฆ Project scaffolding (new)
  • ๐Ÿ“š Automatic documentation generation (docs generate)

These are registered automatically and available immediately after installation.


๐Ÿš€ sayer new โ€“ Project Generator

The sayer new command scaffolds a complete new Sayer CLI application in seconds.

It sets up:

  • main.py bootstrap
  • commands/ folder with a working command
  • pyproject.toml with sayer dependency
  • .gitignore and README

โœ… Usage

sayer new my-cli

Creates a structure like:

my-cli/
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ commands/
    โ”œโ”€โ”€ __init__.py
    โ””โ”€โ”€ hello.py

๐Ÿ” Command Reference

sayer new --help
Usage: sayer new <name>

Create a new Sayer CLI project in <name> directory.

You can immediately test it:

cd my-cli
python main.py hello --name Sayer

๐Ÿ“š sayer docs generate โ€“ Docs Generator

Generates Markdown documentation for all commands and subcommands in your CLI app.

โœ… Usage

sayer docs generate

Or set a custom output directory:

sayer docs generate --output ./my-docs/

๐Ÿงพ What It Does

  • Builds a README.md with command list
  • Generates one .md file per command and subcommand
  • Outputs to docs/ by default (compatible with MkDocs!)

๐Ÿงช Example

docs/
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ commands/
    โ”œโ”€โ”€ hello.md
    โ”œโ”€โ”€ users-create.md
    โ””โ”€โ”€ users-delete.md

๐Ÿงฐ Recap

Command Description
sayer new Scaffold a new CLI project
sayer docs generate Generate Markdown docs for all commands

Sayer's built-in commands are here to help you bootstrap and document faster.

๐Ÿ‘‰ See also: Testing, Encoders

```