No description
Find a file
Felipe Martin 353cc9efc7
Add version tracking and validation to prevent downgrade issues
Store the last pluginctl version used in plugin.json props and validate
before running commands. Prevents issues when using older pluginctl
versions on plugins modified by newer versions.

- Add Version field to PluginCtlConfig struct
- Implement version validation before command execution
- Add WritePluginManifest and SavePluginCtlConfig helper functions
- Add comprehensive tests for version comparison logic
- Skip validation for 'version' command and when no plugin.json exists

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 11:54:46 +02:00
assets Integrate manifest apply into build system 2025-07-31 11:21:34 +02:00
cmd/pluginctl Add version tracking and validation to prevent downgrade issues 2025-07-31 11:54:46 +02:00
testdata moved test json files to folders 2025-07-14 17:24:32 +02:00
.gitignore Add GoModule support to template context and update gitignore 2025-07-14 22:16:41 +02:00
.golangci.yml Initial implementation of pluginctl CLI tool 2025-07-08 14:30:09 +02:00
.goreleaser.yml Add version tracking and validation to prevent downgrade issues 2025-07-31 11:54:46 +02:00
CLAUDE.md Compacted README.md 2025-07-09 17:04:27 +02:00
client.go Refactor codebase with improved structure and logging 2025-07-14 17:14:12 +02:00
create-plugin.go Refactor help system to consolidate error messages and command-specific help 2025-07-28 19:20:36 +02:00
deploy.go Refactor help system to consolidate error messages and command-specific help 2025-07-28 19:20:36 +02:00
disable.go Refactor help system to consolidate error messages and command-specific help 2025-07-28 19:20:36 +02:00
enable.go Refactor help system to consolidate error messages and command-specific help 2025-07-28 19:20:36 +02:00
go.mod Add non-interactive flag support to create-plugin command 2025-07-28 16:50:42 +02:00
go.sum Replace logging system with slog and tint for structured colored output 2025-07-09 16:51:40 +02:00
info.go Refactor help system to consolidate error messages and command-specific help 2025-07-28 19:20:36 +02:00
info_test.go Add custom parser for props["pluginctl"] with ignore assets support 2025-07-14 17:38:38 +02:00
LICENSE Initial implementation of pluginctl CLI tool 2025-07-08 14:30:09 +02:00
logger.go Refactor codebase with improved structure and logging 2025-07-14 17:14:12 +02:00
logs.go Refactor help system to consolidate error messages and command-specific help 2025-07-28 19:20:36 +02:00
Makefile Add custom parser for props["pluginctl"] with ignore assets support 2025-07-14 17:38:38 +02:00
manifest.go Add version tracking and validation to prevent downgrade issues 2025-07-31 11:54:46 +02:00
pluginctl.go Add version tracking and validation to prevent downgrade issues 2025-07-31 11:54:46 +02:00
pluginctl_test.go Add version tracking and validation to prevent downgrade issues 2025-07-31 11:54:46 +02:00
README.md Refactor codebase with improved structure and logging 2025-07-14 17:14:12 +02:00
reset.go Refactor help system to consolidate error messages and command-specific help 2025-07-28 19:20:36 +02:00
updateassets.go Refactor help system to consolidate error messages and command-specific help 2025-07-28 19:20:36 +02:00
version.go Replace logging system with slog and tint for structured colored output 2025-07-09 16:51:40 +02:00

pluginctl

A command-line interface tool for Mattermost plugin development. pluginctl provides utilities to manage, inspect, and work with Mattermost plugins from the command line.

Installation

From Source

git clone https://github.com/mattermost/pluginctl.git
cd pluginctl
make build

Binary Installation

Download the latest binary from the releases page.

Package Managers

# Using go install
go install github.com/mattermost/pluginctl/cmd/pluginctl

Usage

Basic Commands

# Display plugin information
pluginctl info

# Show help and available commands
pluginctl --help

# Show version
pluginctl version

Plugin Path Configuration

pluginctl supports multiple ways to specify the plugin directory:

  1. Command-line flag (highest priority):

    pluginctl --plugin-path /path/to/plugin info
    
  2. Environment variable:

    export PLUGINCTL_PLUGIN_PATH=/path/to/plugin
    pluginctl info
    
  3. Current directory (default):

    cd /path/to/plugin
    pluginctl info
    

Available Commands

Run pluginctl --help to see all available commands and options.

Development

Quick Start

# Set up development environment
make dev-setup

# Install dependencies
make deps

# Quick development build (format, lint, build)
make dev

# Run tests and checks before committing
make check-changes

See make help for the complete list of available targets.

Adding New Commands

  1. Create a new command file (e.g., build.go) in the root directory
  2. Implement the command following existing patterns
  3. Register the command in cmd/pluginctl/main.go
  4. Update the help text

See CLAUDE.md for detailed architecture guidelines.

Contributing

We welcome contributions to pluginctl! Please see the CLAUDE.md file for architecture guidelines and development patterns.

Code Style

  • Follow Go best practices and conventions
  • Use the official Mattermost model types from github.com/mattermost/mattermost/server/public/model
  • Maintain separation between CLI framework and command implementation
  • Include comprehensive error handling with descriptive messages

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Support

For questions, issues, or feature requests, please:

  • Check the issues or create a new issue if your problem isn't already reported
  • Join the Mattermost Community for general discussion