CLI tools for Splunk 9.2.2 TA development and maintenance.
Currently Implementing:
- P1: Basic CLI Structure
- Command-line interface framework
- Help text and documentation
- Output formatting templates
- Error message formatting
- Verbosity controls
Coming Soon:
-
P2: Basic Validation
- Core validation rules
- Validation command structure
- Validation reporting
- Error handling
-
P3: File Detection
- TA directory validation
- Change detection and reporting
- Local/default file comparison
- Status display system
-
P4: Configuration Sorting
- Stanza sorting by type and priority
- Setting organization within stanzas
- Structure and comment preservation
- Format maintenance
-
P5: Configuration Merging
- Local to default file merging
- Conflict detection and resolution
- Format and structure preservation
- Backup mechanisms
-
Project Links
-
Documentation
byDefault provides a suite of command-line tools to assist Splunk developers in creating and maintaining Technology Add-ons (TAs) for Splunk 9.2.2. The tools are designed with security and maintainability in mind.
- UV package manager
- ~/.local/bin in PATH (or appropriate UV tools directory)
Note: Python is not required to be pre-installed. UV will automatically manage Python versions as needed.
UV is a fast, reliable, and feature-rich Python package installer and resolver.
Choose one of the following installation methods:
-
Install UV:
macOS (Recommended)
brew install uv
Linux/macOS (Alternative)
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
-
The installation scripts automatically add UV to your PATH. Verify the installation:
uv --version
-
Install from GitHub Release (Recommended):
# Install from wheel file uv tool install https://github.com/BernCarney/bydefault/releases/download/v0.1.0/bydefault-0.1.0-py3-none-any.whl # Or latest release uv tool install git+https://github.com/BernCarney/bydefault.git@v0.1.0 # Or latest from main branch uv tool install git+https://github.com/BernCarney/bydefault.git # Or build from source uv tool install https://github.com/BernCarney/bydefault/releases/download/v0.1.0/bydefault-0.1.0.tar.gz
-
If you receive an error when installing byDefault saying you don't have the required python version, you can install the correct version of python using the following command:
uv python install 3.11
-
Make sure UV's tool directory is added to your path:
uv tool update-shell
-
Verify installation:
# After restarting your shell bydefault --version bydefault, version 0.1.0
Detect configuration changes:
$ bydefault scan
Changes detected in: my_custom_ta
Modified files:
local/props.conf
local/transforms.conf
Sort configuration files:
$ bydefault sort default/props.conf
Sorting: default/props.conf
✓ Stanzas reordered: 5
✓ Settings sorted: 23
Merge local changes to default:
$ bydefault merge
Merging changes in: my_custom_ta
✓ props.conf: 2 stanzas merged
✓ transforms.conf: 1 stanza merged
Update TA versions:
$ bydefault bumpver --minor
Updating versions:
my_custom_ta: 1.2.0 -> 1.3.0
-
Clone the repository:
git clone <repository-url> cd bydefault
-
Create and activate a virtual environment:
uv venv source .venv/bin/activate # On Unix/macOS
-
Install development dependencies:
uv sync --all-extras
-
Run tests:
pytest
-
Run linting:
ruff check .
-
Run formatting:
ruff format .
bydefault/
├── src/
│ └── bydefault/
│ ├── __init__.py
│ ├── cli.py # Main CLI entry point
│ ├── commands/ # Command implementations
│ ├── core/ # Core business logic
│ ├── models/ # Data models
│ └── utils/ # Shared utilities
├── tests/
│ ├── conftest.py
│ ├── test_commands/
│ ├── test_core/
│ ├── test_models/
│ └── test_utils/
└── [core config files]
- Keep your Python environment up to date
- Review all dependencies before installation
- Use appropriate access controls for any generated files
- Back up configurations before performing merges
GNU General Public License v3.0 or later
Currently implementing Phase 1: Basic CLI Structure
Visit the Project Board for detailed task tracking.