{"id":36985149,"url":"https://github.com/avinava/mule-build","last_synced_at":"2026-01-23T00:07:01.951Z","repository":{"id":329067192,"uuid":"1117800271","full_name":"Avinava/mule-build","owner":"Avinava","description":"A type-safe CLI and library for MuleSoft application build automation.","archived":false,"fork":false,"pushed_at":"2026-01-10T08:41:39.000Z","size":348,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-13T19:44:39.253Z","etag":null,"topics":["build","cli","mule","mulesoft"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@sfdxy/mule-build","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Avinava.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-16T20:45:14.000Z","updated_at":"2026-01-10T08:41:43.000Z","dependencies_parsed_at":"2026-01-13T23:00:57.449Z","dependency_job_id":null,"html_url":"https://github.com/Avinava/mule-build","commit_stats":null,"previous_names":["avinava/mule-build"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Avinava/mule-build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avinava%2Fmule-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avinava%2Fmule-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avinava%2Fmule-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avinava%2Fmule-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Avinava","download_url":"https://codeload.github.com/Avinava/mule-build/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avinava%2Fmule-build/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","cli","mule","mulesoft"],"created_at":"2026-01-13T23:00:46.842Z","updated_at":"2026-01-13T23:01:02.330Z","avatar_url":"https://github.com/Avinava.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mule-Build\n\nA type-safe CLI and library for MuleSoft application build automation.\n\n[![npm version](https://img.shields.io/npm/v/@sfdxy/mule-build.svg)](https://www.npmjs.com/package/@sfdxy/mule-build)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Features\n\n- 🔒 **Safe by Default** - Properties are never modified unless explicitly requested\n- 📦 **Flexible Builds** - Support for normal, local dev, and production builds\n- 🚀 **Local Development** - One command to build and deploy locally\n- 🏷️ **Release Automation** - Semantic versioning and git tagging\n- 🔌 **Dual Interface** - Both CLI and programmatic API (MCP-ready)\n- 📝 **TypeScript** - Full type safety and exported types\n\n## Installation\n\n```bash\n# Global installation\nnpm install -g @sfdxy/mule-build\n\n# Local installation\nnpm install @sfdxy/mule-build\n\n# Or use npx directly\nnpx @sfdxy/mule-build --help\n```\n\n## Quick Start\n\n```bash\n# Normal build (properties untouched)\nmule-build package\n\n# Build with stripped secure:: prefixes for local development\nmule-build package --strip-secure\n\n# Build for production (enforces secure:: prefixes)\nmule-build package -e production\n\n# Check for unsecured sensitive properties\nmule-build enforce\n```\n\n## CLI Commands\n\n### `package`\n\nBuild the MuleSoft application package.\n\n```bash\nmule-build package [options]\n\nOptions:\n  --strip-secure           Strip secure:: prefixes for local development (explicit opt-in)\n  -e, --env \u003cenvironment\u003e  Target environment: production (enforces secure::)\n  -s, --with-source        Include source code in package (Studio importable)\n  -S, --skip-tests         Skip MUnit tests\n  --version \u003cversion\u003e      Override version from pom.xml\n  -o, --output \u003cpath\u003e      Output directory for built JAR (defaults to target/)\n```\n\n**Examples:**\n\n```bash\n# Normal build - properties are NOT modified (safe default)\nmule-build package\n\n# Build with secure:: prefixes stripped for local Anypoint Studio\nmule-build package --strip-secure --skip-tests\n\n# Production build - validates all sensitive properties have secure::\nmule-build package -e production\n\n# Build and output to a custom directory\nmule-build package --strip-secure --skip-tests -o /tmp/builds\n```\n\n### Build Modes\n\n| Command | Behavior | Use Case |\n|---------|----------|----------|\n| `mule-build package` | Normal build, no modifications | General purpose |\n| `mule-build package --strip-secure` | Strips `secure::` prefixes | Local dev / Studio |\n| `mule-build package -e production` | Enforces `secure::` present | CloudHub / RTF |\n\n\u003e **Important:** The `--strip-secure` flag is mutually exclusive with `-e production`.\n\n### `run`\n\nBuild and deploy to local Mule runtime.\n\n```bash\nmule-build run [options]\n\nOptions:\n  -d, --debug          Enable remote debugging on port 5005\n  -c, --clean          Run mvn clean before building\n  --strip-secure       Strip secure:: prefixes for local development\n  -S, --skip-tests     Skip MUnit tests\n```\n\n\u003e **Note:** Requires `MULE_HOME` environment variable to be set.\n\n### `release`\n\nBump version and create a release.\n\n```bash\nmule-build release -b \u003ctype\u003e [options]\n\nOptions:\n  -b, --bump \u003ctype\u003e  Version bump type: major | minor | patch (required)\n  --no-tag           Skip git tag creation\n  --no-push          Skip git push\n```\n\n**Examples:**\n\n```bash\n# Minor version bump with tag and push\nmule-build release -b minor\n\n# Patch release without pushing\nmule-build release -b patch --no-push\n```\n\n### `strip`\n\nStrip `secure::` prefixes from XML files. Use this for manual stripping.\n\n```bash\nmule-build strip [options]\n\nOptions:\n  -f, --file \u003cpath\u003e   Process single file\n  -d, --dir \u003cpath\u003e    Process all XML files in directory (default: src/main/mule)\n  --dry-run           Show changes without modifying files\n```\n\nThis transforms:\n- `${secure::db.password}` → `${db.password}`\n- `Mule::p('secure::api.key')` → `Mule::p('api.key')`\n\n### `enforce`\n\nCheck for unsecured sensitive properties.\n\n```bash\nmule-build enforce [options]\n\nOptions:\n  -f, --file \u003cpath\u003e   Check single file\n  -d, --dir \u003cpath\u003e    Check all XML files in directory (default: src/main/mule)\n```\n\n## Programmatic API\n\nAll commands are available as typed async functions:\n\n```typescript\nimport { packageProject, stripSecure, enforceSecure, releaseVersion } from 'mule-build';\n\n// Normal build (no property modifications)\nconst result = await packageProject({\n  skipTests: true,\n});\n\n// Build with stripped secure:: prefixes\nconst localResult = await packageProject({\n  stripSecure: true,\n  withSource: true,\n});\n\n// Production build with enforcement\nconst prodResult = await packageProject({\n  environment: 'production',\n});\n\n// Build to a custom output directory\nconst customOutputResult = await packageProject({\n  stripSecure: true,\n  skipTests: true,\n  outputDir: '/tmp/builds',\n});\n\nif (result.success) {\n  console.log(`Built: ${result.data.jarPath}`);\n}\n\n// Strip secure prefixes manually\nconst stripResult = await stripSecure({\n  directory: 'src/main/mule',\n  dryRun: true,\n});\n\n// Enforce security\nconst enforceResult = await enforceSecure({\n  directory: 'src/main/mule',\n});\n\nif (!enforceResult.data.valid) {\n  console.error('Violations:', enforceResult.data.violations);\n}\n```\n\n## Configuration\n\nCreate an optional `mule-build.yaml` in your project root:\n\n```yaml\nproject:\n  name: \"my-api\"  # Optional, defaults to pom.xml name\n\nprofiles:\n  production:\n    description: \"CI/CD Artifacts\"\n    mavenProfile: \"prod\"\n    secureProperties: \"enforce\"\n    includeSource: false\n    enforceGitClean: true\n```\n\n### Default Behavior\n\nWithout a config file, sensible defaults are used:\n\n| Command | Maven Profile | Secure Props | Include Source |\n|---------|---------------|--------------|----------------|\n| `package` | none | unchanged | false |\n| `package --strip-secure` | none | stripped | false |\n| `package -e production` | prod | enforced | false |\n\n## TypeScript Support\n\nAll types are exported:\n\n```typescript\nimport type {\n  PackageOptions,\n  PackageResult,\n  StripOptions,\n  StripResult,\n  EnforceOptions,\n  EnforceResult,\n  ReleaseOptions,\n  ReleaseResult,\n  Result,\n  BuildEnvironment,\n  BumpType,\n} from 'mule-build';\n```\n\n## AI Agent Integration (MCP)\n\nThis tool exposes a **Model Context Protocol (MCP)** server, allowing AI agents (like Claude Desktop, IDE assistants) to directly interact with your build system to inspect projects, run builds, and manage releases.\n\n### Features\n\n**Tools** (all support optional `cwd` parameter for remote project directories):\n\n| Tool | Description |\n|------|-------------|\n| `run_build` | Build Mule application package |\n| `run_app` | Deploy to local Mule runtime |\n| `stop_app` | Stop local Mule runtime |\n| `check_app_status` | Check runtime status and port 8081 |\n| `release_version` | Bump version and create git tag |\n| `enforce_security` | Scan for unsecured properties |\n| `strip_secure` | Strip `secure::` prefixes for local dev |\n| `system_check` | Pre-flight environment validation |\n\n**Resources**:\n- `mule-build://config` - Project configuration\n- `mule-build://docs/design` - Design documentation\n- `mule-build://docs/best-practices` - Best practices guide\n- `mule-build://docs/folder-structure` - Project structure conventions\n\n### Setup for VS Code (Recommended)\n\nCreate `.vscode/mcp.json` in your workspace:\n\n```json\n{\n  \"servers\": {\n    \"mule-build\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@sfdxy/mule-build\", \"mcp\"]\n    }\n  }\n}\n```\n\nThe agent will now be able to \"see\" your MuleSoft project structure and offer build/release actions autonomously.\n\n### Setup for Claude Desktop\n\nAdd the following to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"mule-build\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@sfdxy/mule-build\", \"mcp\"]\n    }\n  }\n}\n```\n\n\n## Requirements\n\n- Node.js \u003e= 18\n- Maven (for build operations)\n- Git (for release operations)\n- MULE_HOME environment variable (for run command)\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Run tests\nnpm test\n\n# Lint\nnpm run lint\n\n# Format\nnpm run format\n```\n\n## Architecture\n\n```\nmule-build/\n├── src/\n│   ├── index.ts          # Package exports\n│   ├── cli.ts            # CLI implementation\n│   ├── api/              # Public API functions\n│   ├── engine/           # Core logic\n│   ├── config/           # Configuration\n│   ├── types/            # TypeScript types\n│   └── utils/            # Utilities\n├── test/                 # Tests and fixtures\n└── docs/                 # Documentation\n```\n\nSee [docs/design.md](docs/design.md) for detailed technical documentation.\n\n## Migration from Bash Script\n\n| Bash Script | CLI Equivalent |\n|------------|----------------|\n| `./build.sh sandbox` | `mule-build package --strip-secure` |\n| `./build.sh production` | `mule-build package -e production` |\n\n## License\n\nMIT\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eBuilt with 🚀 \u003ca href=\"https://github.com/google-deepmind/antigravity\"\u003eAntigravity\u003c/a\u003e\u003c/sub\u003e\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinava%2Fmule-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favinava%2Fmule-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinava%2Fmule-build/lists"}