diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78f55a9..0185e44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,7 +129,7 @@ jobs: - name: Create ZIP archive (Windows) if: matrix.os == 'windows-latest' run: | - Compress-Archive -Path bin\msgraphtool${{ matrix.ext }},bin\smtptool${{ matrix.ext }},bin\imaptool${{ matrix.ext }},bin\pop3tool${{ matrix.ext }},bin\jmaptool${{ matrix.ext }},README.md,SMTP_TOOL_README.md,BUILD.md,EXAMPLES.md,LICENSE -DestinationPath ${{ matrix.zip_name }} + Compress-Archive -Path bin\msgraphtool${{ matrix.ext }},bin\smtptool${{ matrix.ext }},bin\imaptool${{ matrix.ext }},bin\pop3tool${{ matrix.ext }},bin\jmaptool${{ matrix.ext }},README.md,*_TOOL_README.md,EXAMPLES.md,LICENSE -DestinationPath ${{ matrix.zip_name }} Write-Host "Created ZIP archive: ${{ matrix.zip_name }}" Get-Item ${{ matrix.zip_name }} | Select-Object Name, Length @@ -137,7 +137,7 @@ jobs: if: matrix.os != 'windows-latest' run: | cd bin && zip ../${{ matrix.zip_name }} msgraphtool${{ matrix.ext }} smtptool${{ matrix.ext }} imaptool${{ matrix.ext }} pop3tool${{ matrix.ext }} jmaptool${{ matrix.ext }} && cd .. - zip -u ${{ matrix.zip_name }} README.md SMTP_TOOL_README.md BUILD.md EXAMPLES.md LICENSE + zip -u ${{ matrix.zip_name }} README.md *_TOOL_README.md EXAMPLES.md LICENSE echo "Created ZIP archive: ${{ matrix.zip_name }}" ls -lh ${{ matrix.zip_name }} @@ -167,8 +167,7 @@ jobs: Plus documentation: - **README.md** - Main documentation - - **SMTP_TOOL_README.md** - Complete SMTP tool guide - - **BUILD.md** - Build instructions + - ** *_TOOL_README.md** - specific protocols tool guide - **EXAMPLES.md** - Usage examples - **LICENSE** - MIT License diff --git a/GEMINI.md b/GEMINI.md deleted file mode 100644 index 0fc934a..0000000 --- a/GEMINI.md +++ /dev/null @@ -1,110 +0,0 @@ -# Gemini Context: msgraphtool - -This document provides context for Gemini to effectively assist with the `msgraphtool` project. - -## Project Overview - -**Name:** `msgraphtool` -**Type:** Go CLI Tool (Single Binary) -**Purpose:** Interact with Microsoft Graph API (Exchange Online) for testing and automation. -**Key Functionality:** -- Sending emails (Text body). -- Listing calendar events. -- Creating calendar invites. -- Listing inbox messages. -- **Authentication:** Client Secret, PFX Certificate, Windows Certificate Store (Thumbprint). -- **Logging:** Automatic CSV logging of all operations to `%TEMP%`. -**Platform:** Cross-platform (Windows, Linux, macOS), but optimized for Windows (Certificate Store support). - -## Directory Structure - -* `src/`: Go source code and module definition (`go.mod`). -* `src/msgraphtool.go`: Main entry point and application logic. -* `src/cert_windows.go`: Windows-specific certificate store implementation. -* `src/cert_stub.go`: Stub for non-Windows builds. -* `src/VERSION`: Current version string (e.g., `1.12.6`). -* `.github/workflows/`: GitHub Actions for CI/CD. -* `tests/`: Integration tests. -* `Changelog/`: Directory containing changelog files (e.g., `1.12.6.md`). - -## Development Workflow - -### 1. Build - -The Go code is located in `src/`. You must run build commands from the root pointing to `src` or inside `src`. - -**Command:** -```powershell -go build -C src -o msgraphtool.exe -``` - -**Optimized Build (Smaller Binary):** -```powershell -go build -C src -ldflags="-s -w" -o msgraphtool.exe -``` - -### 2. Versioning - -* **Major Version Locked:** Always `1.x.y`. -* **Single Source of Truth:** `src/VERSION`. -* **Mechanism:** Go code uses `//go:embed VERSION` to compile the version string. **Do not** edit Go source for version updates. -* **Process:** Update `src/VERSION` and create `Changelog/{version}.md`. - -### 3. Release Process - -Releases are automated via GitHub Actions when a tag is pushed. - -1. **Recommended:** Use `.\run-integration-tests.ps1` for interactive release. -2. **Manual:** - * Update `src/VERSION`. - * Create `Changelog/{version}.md`. - * Commit and Tag (`git tag v1.x.y`). - * Push tag (`git push origin v1.x.y`). - -This triggers `.github/workflows/build.yml` which builds the binary and attaches it to a GitHub Release. - -## Usage & Testing - -### Common Commands - -* **Get Events:** - ```powershell - .\msgraphtool.exe -tenantid "..." -clientid "..." -secret "..." -mailbox "user@example.com" -action getevents - ``` -* **Send Mail:** - ```powershell - .\msgraphtool.exe -tenantid "..." -clientid "..." -secret "..." -mailbox "user@example.com" -action sendmail -to "recipient@example.com" - ``` - -### Authentication Methods - -1. **Client Secret:** `-secret "VALUE"` -2. **PFX File:** `-pfx "file.pfx" -pfxpass "PASSWORD"` -3. **Windows Store:** `-thumbprint "HEX_HASH"` (Windows only) - -### Environment Variables - -All flags can be set via `MSGRAPH` prefix (e.g., `MSGRAPHTENANTID`, `MSGRAPHCLIENTID`). Flags take precedence over environment variables. - -### Logging - -CSV logs are written to `%TEMP%\_msgraphtool_{action}_{date}.csv`. - -## Key Conventions - -* **Code Style:** Standard Go fmt. -* **Dependencies:** Minimal. `msgraph-sdk-go`, `azidentity`, `pkcs12`. -* **Safety:** Never commit secrets. The tool masks secrets in verbose output. -* **Architecture:** `main` function dispatches to specific action functions (`performAction...`). - -## Reference Files - -* `AGENTS.md`: Detailed architecture and AI context (primary reference). -* `BUILD.md`: Detailed build instructions. -* `RELEASE.md`: Release process and versioning policy. -* `README.md`: User-facing documentation. -* `SECURITY.md`: Security policy and best practices. - - ..ooOO END OOoo.. - -