CLI Reference

Complete reference for all Dockerizer commands, flags, and options.

Commands

dockerizer

The default command. Analyzes the current directory and generates Docker configurations.

dockerizer [path] [flags]
Argument Description Default
path Path to the project directory Current directory (.)

dockerizer init

Interactive setup wizard. Guides you through configuration with prompts.

dockerizer init [path]

The wizard will ask about:

dockerizer plan

Preview the generated configuration without writing files.

dockerizer plan [path]

Useful for reviewing what will be generated before committing.

dockerizer detect

Only run detection without generating files. Shows detected framework and confidence.

dockerizer detect [path]

dockerizer version

Display version information.

dockerizer version [--json]

Global Flags

Flag Short Description
--help -h Show help for any command
--verbose -v Enable verbose output
--quiet -q Suppress non-essential output
--force -f Overwrite existing files without prompting
--no-compose Skip docker-compose.yml generation
--no-ignore Skip .dockerignore generation

AI Flags

Flag Description
--ai Force AI generation regardless of detection confidence
--ai-provider AI provider to use: openai, anthropic, ollama
--ai-model Specific model to use (e.g., gpt-4, claude-3-sonnet)

Output Flags

Flag Description
--output, -o Output directory for generated files
--stdout Print Dockerfile to stdout instead of writing to file
--json Output results in JSON format

Environment Variables

Configure Dockerizer using environment variables:

Variable Description
OPENAI_API_KEY OpenAI API key for AI generation
ANTHROPIC_API_KEY Anthropic API key for Claude models
OLLAMA_HOST Ollama server URL (default: http://localhost:11434)
DOCKERIZER_AI_PROVIDER Default AI provider
DOCKERIZER_AI_MODEL Default AI model
DOCKERIZER_VERBOSE Enable verbose mode (true/false)

Exit Codes

Code Description
0 Success
1 General error
2 Detection failed (no framework detected)
3 AI generation failed
4 File write error

Examples

Basic Usage

# Generate for current directory
dockerizer

# Generate for specific path
dockerizer /path/to/project

# Preview without writing
dockerizer plan

With Flags

# Force overwrite existing files
dockerizer --force

# Only generate Dockerfile
dockerizer --no-compose --no-ignore

# Force AI generation
dockerizer --ai --ai-provider openai

# Output to stdout
dockerizer --stdout

Using Environment Variables

# Set API key and generate
export OPENAI_API_KEY="sk-..."
dockerizer --ai

# Or inline
OPENAI_API_KEY="sk-..." dockerizer --ai
Need more examples? Check out the Examples page for real-world usage scenarios.