Getting Started
Installation
There are several ways to install and use mono:
Install mono globally as a tool:
Then use it anywhere:
If you want to create your own CLI tool, use mono as a template:
# Clone the template
git clone https://github.com/guenp/mono.git my-cli-tool
cd my-cli-tool
rm -rf .git && git init
See Customizing below.
Verify Installation
You should see the help text showing available commands and options.
Your First Command
The template comes with a simple hello command:
# Default greeting
mono
# Output: Hello, World!
# Greet someone specific
mono Alice
# Output: Hello, Alice!
# Use quotes for multi-word names
mono "Python Developer"
# Output: Hello, Python Developer!
Customizing the Template
If you cloned mono to create your own CLI tool, follow these steps:
1. Rename the Package
Replace all occurrences of mono with your package name:
# macOS
find . -type f -not -path './.git/*' -exec sed -i '' 's/mono/mycli/g' {} +
# Linux
find . -type f -not -path './.git/*' -exec sed -i 's/mono/mycli/g' {} +
Rename directories:
2. Update Metadata
Edit pyproject.toml to update:
- Package name
- description
- authors
- Repository URLs
- Any other metadata
3. Set Up Development Environment
# Install uv if needed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync --group dev --group docs
# Install pre-commit hooks
uv run pre-commit install
4. Test Your Setup
5. Add Your Commands
Edit src/mycli/cli.py and replace the example hello command with your own:
@app.command()
def process(
file: Path = typer.Argument(..., help="File to process"),
verbose: bool = typer.Option(False, "--verbose", "-v"),
) -> None:
"""Process a file."""
if verbose:
typer.echo(f"Processing {file}")
# Your implementation here
Next Steps
- Learn about all commands and options
- Read about the development workflow
- Check out customization examples
- Set up CI/CD and automatic releases