MAIASS supports flexible version management across multiple file formats and project types. It can handle standard files like package.json and VERSION, as well as custom version file configurations for specialized projects.
{
"name": "my-project",
"version": "1.2.3"
}1.2.3
If no version files exist, MAIASS uses git tags exclusively.
MAIASS supports a configurable version file system for projects with non-standard version management needs.
| Variable | Description | Example |
|---|---|---|
MAIASS_VERSION_PRIMARY_FILE |
Primary version file path | myscript.sh |
MAIASS_VERSION_PRIMARY_TYPE |
File type: json, txt, or pattern |
txt |
MAIASS_VERSION_PRIMARY_LINE_START |
Line prefix for txt files | # Version: |
MAIASS_VERSION_SECONDARY_FILES |
Secondary files (pipe-separated) | style.css:txt:Version: |functions.php:pattern:define('VERSION','{version}'); |
Automatically updates the "version" property:
{
"name": "my-app",
"version": "1.2.3" // <- Updated automatically
}Updates lines starting with the specified prefix:
# Version: 1.2.3 // <- Line updated
echo "My Script v1.2.3"Uses intelligent pattern replacement with {version} placeholder:
<?php
define('MYTHEME_VERSION', '1.2.3'); // <- Pattern matched and updated# .env configuration
MAIASS_VERSION_PRIMARY_FILE="style.css"
MAIASS_VERSION_PRIMARY_TYPE="txt"
MAIASS_VERSION_PRIMARY_LINE_START="Version: "
MAIASS_VERSION_SECONDARY_FILES="functions.php:pattern:define('MYTHEME_VERSION','{version}');"style.css:
/*
Theme Name: My Theme
Version: 1.2.3
*/functions.php:
<?php
define('MYTHEME_VERSION', '1.2.3');# .env configuration
MAIASS_VERSION_PRIMARY_FILE="myscript.sh"
MAIASS_VERSION_PRIMARY_TYPE="txt"
MAIASS_VERSION_PRIMARY_LINE_START="# Version: "myscript.sh:
#!/bin/bash
# Version: 1.2.3
echo "Script version 1.2.3"# .env configuration
MAIASS_VERSION_PRIMARY_FILE="package.json"
MAIASS_VERSION_PRIMARY_TYPE="json"
MAIASS_VERSION_SECONDARY_FILES="README.md:txt:Version |config.yml:txt:version: |app.py:txt:__version__ = '"| Format | Example Line | Configuration |
|---|---|---|
| Shell comment | # Version: 1.2.3 |
# Version: |
| YAML/Config | version: 1.2.3 |
version: |
| Python | __version__ = '1.2.3' |
__version__ = ' |
| CSS comment | /* Version: 1.2.3 */ |
/* Version: |
| WordPress style | Version: 1.2.3 |
Version: |
For complex version patterns, use the pattern type with {version} placeholder:
# Configuration
MAIASS_VERSION_SECONDARY_FILES="functions.php:pattern:define('VERSION','{version}');"
# File content (before)
define('VERSION', '1.2.2');
# File content (after maiass minor)
define('VERSION', '1.3.0');# Configuration
MAIASS_VERSION_SECONDARY_FILES="config.js:pattern:const VERSION = '{version}';"
# File content
const VERSION = '1.2.3';# Multiple files with pipe separator
MAIASS_VERSION_SECONDARY_FILES="functions.php:pattern:define('VERSION','{version}');|config.js:pattern:const VERSION = '{version}';"MAIASS follows Semantic Versioning (SemVer):
- MAJOR version: Incompatible API changes
- MINOR version: Backwards-compatible functionality additions
- PATCH version: Backwards-compatible bug fixes
# Bump patch version (1.2.3 → 1.2.4)
maiass
maiass patch
# Bump minor version (1.2.3 → 1.3.0)
maiass minor
# Bump major version (1.2.3 → 2.0.0)
maiass major
# Set specific version
maiass 2.1.0MAIASS validates version numbers:
- Must follow semantic versioning format (X.Y.Z)
- New version must be greater than current version
- Prevents duplicate git tags
- Handles missing or malformed version files gracefully
- Creates git tags for all version changes
- Format:
v1.2.3or1.2.3(adapts to existing pattern) - Prevents duplicate tags
- Handles tag conflicts gracefully
# MAIASS checks for existing tags
git tag -l "v1.2.3"
# If tag exists, prompts for action:
# - Skip tagging
# - Force update tag
# - Cancel operationMAIASS adapts to different repository structures:
| Repository Type | Version Behavior |
|---|---|
| Full Git Flow | Updates version files → creates tags → merges through branches |
| Simple Workflow | Updates version files → creates tags → offers merge to main |
| Local Only | Updates version files → creates local tags only |
| No Version Files | Creates git tags only, skips file updates |
| First Version | Creates initial version files and tags |
"Version file not found"
- Check file path in
MAIASS_VERSION_PRIMARY_FILE - Ensure file exists and is readable
- Verify working directory
"Invalid version format"
- Ensure version follows X.Y.Z format
- Check for extra characters or spaces
- Validate current version in files
"Version not updated"
- Check file permissions (write access)
- Verify line prefix for txt files
- Test pattern matching for pattern files
"Git tag already exists"
- Choose different version number
- Delete existing tag:
git tag -d v1.2.3 - Use force update option when prompted
export MAIASS_DEBUG="true"
export MAIASS_VERBOSITY="debug"
maiass patch
# Shows detailed version file processing
# Displays git tag operations
# Reveals pattern matching results- Consistent versioning: Use same format across all files
- Test configurations: Verify version updates in non-production branches
- Backup important files: Version file updates are irreversible
- Use semantic versioning: Follow SemVer principles for version increments
- Document custom patterns: Comment complex pattern configurations