Compacted README.md
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
4f0b94354c
commit
3cbe5e4a9f
2 changed files with 30 additions and 166 deletions
|
@ -50,3 +50,9 @@
|
||||||
- Use structured logging with key-value pairs
|
- Use structured logging with key-value pairs
|
||||||
- Follow existing naming conventions
|
- Follow existing naming conventions
|
||||||
- Keep command files self-contained and testable
|
- Keep command files self-contained and testable
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- **CRITICAL**: Keep README.md updated when adding new commands or changing functionality
|
||||||
|
- README.md should be user-facing - focus on usage, not implementation details
|
||||||
|
- Use `pluginctl --help` for command documentation, not hardcoded lists in README
|
||||||
|
|
190
README.md
190
README.md
|
@ -38,7 +38,7 @@ scoop install pluginctl
|
||||||
# Display plugin information
|
# Display plugin information
|
||||||
pluginctl info
|
pluginctl info
|
||||||
|
|
||||||
# Show help
|
# Show help and available commands
|
||||||
pluginctl --help
|
pluginctl --help
|
||||||
|
|
||||||
# Show version
|
# Show version
|
||||||
|
@ -50,13 +50,11 @@ pluginctl --version
|
||||||
`pluginctl` supports multiple ways to specify the plugin directory:
|
`pluginctl` supports multiple ways to specify the plugin directory:
|
||||||
|
|
||||||
1. **Command-line flag** (highest priority):
|
1. **Command-line flag** (highest priority):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pluginctl --plugin-path /path/to/plugin info
|
pluginctl --plugin-path /path/to/plugin info
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Environment variable**:
|
2. **Environment variable**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export PLUGINCTL_PLUGIN_PATH=/path/to/plugin
|
export PLUGINCTL_PLUGIN_PATH=/path/to/plugin
|
||||||
pluginctl info
|
pluginctl info
|
||||||
|
@ -68,170 +66,55 @@ pluginctl --version
|
||||||
pluginctl info
|
pluginctl info
|
||||||
```
|
```
|
||||||
|
|
||||||
### Commands
|
### Available Commands
|
||||||
|
|
||||||
#### `info`
|
Run `pluginctl --help` to see all available commands and options.
|
||||||
|
|
||||||
Display comprehensive information about a Mattermost plugin:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pluginctl info
|
|
||||||
```
|
|
||||||
|
|
||||||
**Output includes:**
|
|
||||||
|
|
||||||
- Plugin ID, name, and version
|
|
||||||
- Minimum Mattermost server version required
|
|
||||||
- Description (if available)
|
|
||||||
- Server code presence and supported platforms
|
|
||||||
- Webapp code presence and bundle path
|
|
||||||
- Settings schema availability
|
|
||||||
|
|
||||||
**Example output:**
|
|
||||||
|
|
||||||
```
|
|
||||||
Plugin Information:
|
|
||||||
==================
|
|
||||||
|
|
||||||
ID: com.example.testplugin
|
|
||||||
Name: Test Plugin
|
|
||||||
Version: 1.0.0
|
|
||||||
Min MM Version: 7.0.0
|
|
||||||
Description: A test plugin for demonstrating pluginctl functionality
|
|
||||||
|
|
||||||
Code Components:
|
|
||||||
================
|
|
||||||
Server Code: Yes
|
|
||||||
Executables: linux-amd64, darwin-amd64, windows-amd64
|
|
||||||
Webapp Code: Yes
|
|
||||||
Bundle Path: webapp/dist/main.js
|
|
||||||
Settings Schema: Yes
|
|
||||||
```
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Go 1.24.3 or later
|
- Go 1.24.3 or later (for building from source)
|
||||||
- Valid Mattermost plugin directory with `plugin.json` manifest file
|
- Valid Mattermost plugin directory with `plugin.json` manifest file
|
||||||
|
|
||||||
## Development Tools
|
## Development
|
||||||
|
|
||||||
The project uses the following tools for development and release automation:
|
### Quick Start
|
||||||
|
|
||||||
- **golangci-lint** v1.62.2 - Code linting and quality checks
|
|
||||||
- **goreleaser** v2.6.2 - Automated releases and cross-platform builds
|
|
||||||
- **gosec** v2.22.0 - Security vulnerability scanning
|
|
||||||
|
|
||||||
## Plugin Directory Structure
|
|
||||||
|
|
||||||
`pluginctl` expects to work with standard Mattermost plugin directories containing a `plugin.json` file. For more information about Mattermost plugin structure, visit the [official documentation](https://developers.mattermost.com/integrate/plugins/).
|
|
||||||
|
|
||||||
## Environment Variables
|
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
| ----------------------- | ----------------------------- |
|
|
||||||
| `PLUGINCTL_PLUGIN_PATH` | Default plugin directory path |
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
We welcome contributions to `pluginctl`! Please see the [CLAUDE.md](CLAUDE.md) file for architecture guidelines and development instructions.
|
|
||||||
|
|
||||||
### Development Setup
|
|
||||||
|
|
||||||
1. Clone the repository:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/mattermost/pluginctl.git
|
|
||||||
cd pluginctl
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Set up development environment (installs pinned tool versions):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make dev-setup
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Install dependencies:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make deps
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Build the project:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make build
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Test with a sample plugin:
|
|
||||||
```bash
|
|
||||||
./pluginctl info
|
|
||||||
```
|
|
||||||
|
|
||||||
### Development Workflow
|
|
||||||
|
|
||||||
Use these Make targets for efficient development:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Set up development environment
|
||||||
|
make dev-setup
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
make deps
|
||||||
|
|
||||||
# Quick development build (format, lint, build)
|
# Quick development build (format, lint, build)
|
||||||
make dev
|
make dev
|
||||||
|
|
||||||
# Check all changes before committing (lint, security, test)
|
# Run tests and checks before committing
|
||||||
make check-changes
|
make check-changes
|
||||||
|
|
||||||
# Full verification (clean, lint, test, build)
|
|
||||||
make verify
|
|
||||||
|
|
||||||
# Run tests with coverage
|
|
||||||
make test-coverage
|
|
||||||
|
|
||||||
# Build for all platforms
|
|
||||||
make build-all
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Available Make Targets
|
### Key Make Targets
|
||||||
|
|
||||||
**Development:**
|
|
||||||
|
|
||||||
- `make dev` - Quick development build
|
- `make dev` - Quick development build
|
||||||
- `make check-changes` - Validate changes (lint, security, test)
|
- `make check-changes` - Validate changes (lint, security, test)
|
||||||
- `make verify` - Full build verification
|
|
||||||
- `make fmt` - Format code
|
|
||||||
- `make clean` - Clean build artifacts
|
|
||||||
|
|
||||||
**Testing:**
|
|
||||||
|
|
||||||
- `make test` - Run tests
|
- `make test` - Run tests
|
||||||
- `make test-coverage` - Run tests with coverage report
|
|
||||||
- `make lint` - Run linter
|
|
||||||
- `make lint-fix` - Fix linting issues automatically
|
|
||||||
- `make security` - Run security scan
|
|
||||||
|
|
||||||
**Building:**
|
|
||||||
|
|
||||||
- `make build` - Build for current platform
|
|
||||||
- `make build-all` - Build for all platforms
|
|
||||||
- `make install` - Install to GOPATH/bin
|
|
||||||
|
|
||||||
**Release:**
|
|
||||||
|
|
||||||
- `make release` - Create production release
|
|
||||||
- `make snapshot` - Create snapshot release
|
|
||||||
|
|
||||||
**Utilities:**
|
|
||||||
|
|
||||||
- `make help` - Show all available targets
|
- `make help` - Show all available targets
|
||||||
- `make version` - Show version information
|
|
||||||
- `make dev-setup` - Install development tools
|
See `make help` for the complete list of available targets.
|
||||||
|
|
||||||
### Adding New Commands
|
### Adding New Commands
|
||||||
|
|
||||||
1. Create a new command file (e.g., `build.go`)
|
1. Create a new command file (e.g., `build.go`) in the root directory
|
||||||
2. Implement the command following the patterns in `info.go`
|
2. Implement the command following existing patterns
|
||||||
3. Register the command in `cmd/pluginctl/main.go`
|
3. Register the command in `cmd/pluginctl/main.go`
|
||||||
4. Update the help text and documentation
|
4. Update the help text
|
||||||
|
|
||||||
See [CLAUDE.md](CLAUDE.md) for detailed architecture guidelines.
|
See [CLAUDE.md](CLAUDE.md) for detailed architecture guidelines.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We welcome contributions to `pluginctl`! Please see the [CLAUDE.md](CLAUDE.md) file for architecture guidelines and development patterns.
|
||||||
|
|
||||||
### Code Style
|
### Code Style
|
||||||
|
|
||||||
- Follow Go best practices and conventions
|
- Follow Go best practices and conventions
|
||||||
|
@ -239,31 +122,6 @@ See [CLAUDE.md](CLAUDE.md) for detailed architecture guidelines.
|
||||||
- Maintain separation between CLI framework and command implementation
|
- Maintain separation between CLI framework and command implementation
|
||||||
- Include comprehensive error handling with descriptive messages
|
- Include comprehensive error handling with descriptive messages
|
||||||
|
|
||||||
### Testing
|
|
||||||
|
|
||||||
Test your changes with various plugin configurations:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run all tests
|
|
||||||
make test
|
|
||||||
|
|
||||||
# Run tests with coverage
|
|
||||||
make test-coverage
|
|
||||||
|
|
||||||
# Test CLI functionality
|
|
||||||
./pluginctl info
|
|
||||||
|
|
||||||
# Test with command-line flag
|
|
||||||
./pluginctl --plugin-path /path/to/plugin info
|
|
||||||
|
|
||||||
# Test with environment variable
|
|
||||||
export PLUGINCTL_PLUGIN_PATH=/path/to/plugin
|
|
||||||
./pluginctl info
|
|
||||||
|
|
||||||
# Validate all changes before committing
|
|
||||||
make check-changes
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
|
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
|
||||||
|
@ -280,4 +138,4 @@ For questions, issues, or feature requests, please:
|
||||||
|
|
||||||
1. Check the [issues](https://github.com/mattermost/pluginctl/issues) page
|
1. Check the [issues](https://github.com/mattermost/pluginctl/issues) page
|
||||||
2. Create a new issue if your problem isn't already reported
|
2. Create a new issue if your problem isn't already reported
|
||||||
3. Join the [Mattermost Community](https://community.mattermost.com/) for general discussion
|
3. Join the [Mattermost Community](https://community.mattermost.com/) for general discussion
|
Loading…
Add table
Add a link
Reference in a new issue