CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-moonrepo--core-macos-x64

macOS x64 binary distribution package for the moon repository management tool

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

query.mddocs/

Query & Analysis

Commands for querying information about projects, tasks, and the build pipeline to analyze workspace structure and understand changes.

Capabilities

Inspect Hash Contents

Examine the contents and inputs that contributed to a generated hash for debugging cache behavior.

moon query hash <hash> [--json]

Arguments:

  • hash (required) - The hash identifier to inspect

Options:

  • --json - Output the hash manifest in JSON format

Usage Examples:

# Inspect a specific hash
moon query hash abc123def456

# Get hash details as JSON
moon query hash abc123def456 --json

Sample Output:

Hash: abc123def456
Target: my-app:build
Inputs:
  - src/index.ts (hash: def789)
  - package.json (hash: ghi012)
  - tsconfig.json (hash: jkl345)
Environment:
  NODE_ENV: production
  BUILD_MODE: release
Created: 2024-01-15 14:30:25 UTC

Compare Hash Differences

Compare two hashes to understand what changed between builds or cache entries.

moon query hash-diff <left> <right> [--json]

Arguments:

  • left (required) - Base hash to compare against
  • right (required) - Target hash to compare with

Options:

  • --json - Output the difference information in JSON format

Usage Examples:

# Compare two hashes
moon query hash-diff abc123 def456

# Get diff as JSON
moon query hash-diff abc123 def456 --json

Sample Output:

Hash Diff: abc123 -> def456

Changed Files:
  + src/utils.ts (new file)
  ~ src/index.ts (modified)
  - src/legacy.ts (deleted)

Environment Changes:
  NODE_ENV: development -> production
  + BUILD_TARGET: es2022

Dependencies:
  ~ shared-utils:build (hash changed)

Query Projects

Search and filter projects within the workspace based on various criteria.

moon query projects [query] [--alias <ALIAS>] [--affected] [--downstream <SCOPE>] [--id <ID>] [--json] [--language <LANG>] [--layer <LAYER>] [--source <SOURCE>] [--stack <STACK>] [--tags <TAGS>] [--tasks <TASKS>] [--upstream <SCOPE>]

Arguments:

  • query (optional) - Filter projects using a query expression

Options:

  • --alias <ALIAS> - Filter projects matching this alias pattern
  • --affected - Filter projects affected by touched files
  • --downstream <SCOPE> - Include downstream dependents (direct|all)
  • --id <ID> - Filter projects matching this ID pattern
  • --json - Output project list in JSON format
  • --language <LANG> - Filter projects by programming language
  • --layer <LAYER> - Filter projects by architectural layer
  • --source <SOURCE> - Filter projects by source path pattern
  • --stack <STACK> - Filter projects by technology stack
  • --tags <TAGS> - Filter projects with specific tags (comma-separated)
  • --tasks <TASKS> - Filter projects that have specific tasks
  • --upstream <SCOPE> - Include upstream dependencies (direct|all)

Usage Examples:

# List all projects
moon query projects

# Find projects by language
moon query projects --language typescript

# Find affected projects
moon query projects --affected

# Find projects with specific tags
moon query projects --tags "frontend,react"

# Find projects with specific tasks
moon query projects --tasks "build,test"

# Complex query with multiple filters
moon query projects --language typescript --stack node --affected

# Include downstream dependents
moon query projects --id my-app --downstream all

# Get results as JSON
moon query projects --json

Query Tasks

List and filter tasks across the workspace based on various criteria.

moon query tasks [query] [--affected] [--command <COMMAND>] [--downstream <SCOPE>] [--id <ID>] [--json] [--project <PROJECT>] [--script <SCRIPT>] [--toolchain <TOOLCHAIN>] [--type <TYPE>] [--upstream <SCOPE>]

Arguments:

  • query (optional) - Filter tasks using a query expression

Options:

  • --affected - Filter tasks affected by touched files
  • --command <COMMAND> - Filter tasks with specific command pattern
  • --downstream <SCOPE> - Include downstream dependents (direct|all)
  • --id <ID> - Filter tasks matching this ID pattern
  • --json - Output task list in JSON format
  • --project <PROJECT> - Filter tasks belonging to specific project
  • --script <SCRIPT> - Filter tasks with specific script pattern
  • --toolchain <TOOLCHAIN> - Filter tasks by toolchain (node, rust, etc.)
  • --type <TYPE> - Filter tasks by type (build, test, lint, etc.)
  • --upstream <SCOPE> - Include upstream dependencies (direct|all)

Usage Examples:

# List all tasks
moon query tasks

# Find build tasks
moon query tasks --type build

# Find tasks in specific project
moon query tasks --project my-app

# Find affected tasks
moon query tasks --affected

# Find tasks by command pattern
moon query tasks --command "*webpack*"

# Find Node.js tasks
moon query tasks --toolchain node

# Include task dependencies
moon query tasks --id build --upstream all

# Complex filtering
moon query tasks --type test --affected --json

Query Touched Files

Identify files that have changed between Git revisions for affected project detection.

moon query touched-files [--base <REF>] [--default-branch] [--head <REF>] [--json] [--local] [--remote] [--status <STATUS>]

Options:

  • --base <REF> - Base branch, commit, or revision to compare against
  • --default-branch - When on default branch, compare against previous revision
  • --head <REF> - Current branch, commit, or revision to compare with
  • --json - Output file list in JSON format
  • --local - Use local Git state instead of remote
  • --remote - Use remote Git state instead of local
  • --status <STATUS> - Filter files by status (added, modified, deleted, renamed)

Usage Examples:

# Show touched files since main branch
moon query touched-files --base main

# Compare specific commits
moon query touched-files --base abc123 --head def456

# Show only modified files
moon query touched-files --status modified

# Use local changes only
moon query touched-files --local

# Get output as JSON
moon query touched-files --json

# Compare against previous commit on default branch
moon query touched-files --default-branch

Query Expressions

Moon supports advanced query expressions for filtering:

# Language-based queries
moon query projects --language="typescript || javascript"

# Tag-based queries  
moon query projects --tags="frontend && !legacy"

# Path-based queries
moon query projects --source="apps/** || packages/ui-*"

# Complex task queries
moon query tasks "type=build && project~apps/*"

Output Formats

JSON Output

All query commands support --json for programmatic use:

moon query projects --json | jq '.[] | select(.language == "typescript")'

Formatted Output

Default output is human-readable:

Projects (3 found):
  my-app              apps/my-app              typescript  application
  shared-utils        packages/shared-utils    typescript  library  
  ui-components       packages/ui-components   typescript  library

Integration with Other Commands

Query results can be used with other moon commands:

# Run tasks for affected projects
AFFECTED=$(moon query projects --affected --json | jq -r '.[].id')
moon run $AFFECTED:build

# Check specific language projects
moon query projects --language rust | xargs moon check

# Run tests for touched projects
moon query projects --affected | xargs -I {} moon run {}:test

Performance Analysis

Use queries to analyze workspace performance:

# Find slow tasks
moon query tasks --json | jq 'sort_by(.avgDuration) | reverse | .[0:10]'

# Analyze cache hit rates
moon query hash --json | jq '.cacheStats'

# Find dependency bottlenecks
moon query projects --downstream all --json | jq 'group_by(.dependents | length)'

docs

environment.md

execution.md

extensions.md

generation.md

graphs.md

index.md

maintenance.md

project-task.md

query.md

toolchain.md

tile.json