### Start Project Sessions from Configuration Source: https://context7.com/mutagen-io/mutagen/llms.txt Start all synchronization and forwarding sessions defined in a `mutagen.yml` project configuration file. This command uses a lock file to prevent duplicate starts and tags sessions with a project identifier for coordinated management. ```yaml mutagen project start ``` -------------------------------- ### mutagen project start Source: https://context7.com/mutagen-io/mutagen/llms.txt Starts all synchronization and forwarding sessions defined in a `mutagen.yml` project configuration file. ```APIDOC ## `mutagen project start` — Start all sessions defined in `mutagen.yml` Reads a `mutagen.yml` project configuration file (default: `./mutagen.yml`) and creates all defined synchronization and forwarding sessions, optionally running lifecycle hooks. A lock file (`mutagen.yml.lock`) prevents duplicate project starts. Sessions are tagged with a project identifier label for coordinated management. ### Method ```bash mutagen project start [--file FILE] [--no-hooks] ``` ### Parameters * `--file FILE`: Specify an alternative path to the `mutagen.yml` project file. * `--no-hooks`: Disable the execution of lifecycle hooks. ### Example ```yaml # Example mutagen.yml content: sync: - sources: - ./:app targets: - docker://my-container:/app forward: - name: db-forward labels: service: database source: tcp:127.0.0.1:5432 destination: docker://my-container:tcp:localhost:5432 ``` ``` -------------------------------- ### Start Mutagen Project Source: https://context7.com/mutagen-io/mutagen/llms.txt Initiates a Mutagen project, creating all defined sessions and running configured hooks. Can use a custom project file or start paused. ```bash # Start the project (creates all sessions and runs hooks) mutagen project start ``` ```bash # Start with a custom project file, pre-paused mutagen project start --project-file /path/to/my-mutagen.yml --paused ``` -------------------------------- ### Get Help for Mutagen Build Script Source: https://github.com/mutagen-io/mutagen/blob/master/BUILDING.md Run this command to view information and options available for the Mutagen build script. ```bash go run scripts/build.go --help ``` -------------------------------- ### Start, Stop, and Run Mutagen Daemon Source: https://context7.com/mutagen-io/mutagen/llms.txt Commands to manage the Mutagen background daemon. The daemon must be running for session commands. Log verbosity can be controlled with MUTAGEN_LOG_LEVEL. ```bash mutagen daemon start ``` ```bash mutagen daemon stop ``` ```bash MUTAGEN_LOG_LEVEL=debug mutagen daemon run ``` -------------------------------- ### Create Mutagen Synchronization Session Source: https://context7.com/mutagen-io/mutagen/llms.txt Creates and starts synchronization sessions between two endpoints (local, SSH, or Docker). Supports various modes like two-way-safe and one-way-replica, along with ignore patterns, labels, and compression. ```bash mutagen sync create \ --name my-project \ --mode two-way-safe \ --ignore ".git" \ --ignore "node_modules" \ --ignore-vcs \ /home/user/project \ user@devserver.example.com:/workspace/project ``` ```bash mutagen sync create \ --name app-code \ --label env=dev \ --mode one-way-replica \ --compression zstd \ --permissions-mode portable \ --default-file-mode 0644 \ --default-directory-mode 0755 \ ./src \ docker://my-container/app/src ``` ```bash mutagen sync create \ --paused \ --watch-mode-alpha portable \ --watch-mode-beta force-poll \ --watch-polling-interval-beta 10 \ /local/data \ user@host:/remote/data ``` -------------------------------- ### Create and Format FAT32 Partition on Windows Source: https://github.com/mutagen-io/mutagen/blob/master/scripts/ci/setup_partitions_windows_template.txt Use these commands to create a fixed-size virtual disk, attach it, create a primary partition, format it as FAT32 with a label, assign it a drive letter, and exit. ```bash create vdisk file=REPONAME\fat32image.vhdx maximum=50 type=fixed attach vdisk create partition primary format quick fs=fat32 label=FAT32ROOT assign letter=v exit ``` -------------------------------- ### Test Local Mutagen Build Source: https://github.com/mutagen-io/mutagen/blob/master/BUILDING.md After building Mutagen for the local system, use this command to access the help information for the generated binary. ```bash build/mutagen --help ``` -------------------------------- ### Build Mutagen for Local System Source: https://github.com/mutagen-io/mutagen/blob/master/BUILDING.md Execute the build script without arguments to create artifacts for the current platform. These are placed in the `build` directory and also at the root for easy testing. ```bash go run scripts/build.go ``` -------------------------------- ### Manage Project Sessions (Pause, Resume, Flush, List) Source: https://context7.com/mutagen-io/mutagen/llms.txt Applies session management operations to all sessions associated with the active project. Use `--long` for detailed listing. ```bash # Pause all sessions in the project mutagen project pause ``` ```bash # Resume all sessions mutagen project resume ``` ```bash # Force a sync cycle on all project sync sessions mutagen project flush ``` ```bash # List all project sessions mutagen project list --long ``` -------------------------------- ### Create Mutagen Session with Global Defaults Source: https://context7.com/mutagen-io/mutagen/llms.txt Creates a session that automatically uses global defaults. Global configuration can be bypassed or merged with additional configuration files. ```bash # Create a session that uses global defaults (automatically loaded) mutagen sync create ./local user@host:/remote ``` ```bash # Bypass global configuration for this session only mutagen sync create --no-global-configuration ./local user@host:/remote ``` ```bash # Supply an additional configuration file to merge on top of global defaults mutagen sync create --configuration-file ./project-defaults.yml ./local user@host:/remote ``` -------------------------------- ### Regenerate Protocol Buffers Go Code Source: https://github.com/mutagen-io/mutagen/blob/master/BUILDING.md Run this command in the root of the Mutagen source tree to regenerate Go code from `.proto` files. This requires Go module support and the `protoc` compiler. ```bash go generate ./pkg/... ``` -------------------------------- ### Run Named Project Command Source: https://context7.com/mutagen-io/mutagen/llms.txt Executes a command defined within the project's `commands` section while the project is active. ```bash mutagen project run logs ``` ```bash mutagen project run shell ``` -------------------------------- ### List Mutagen Synchronization Sessions Source: https://context7.com/mutagen-io/mutagen/llms.txt Lists existing synchronization sessions, with options to filter by name, identifier, or label selector. Supports custom output formatting using Go templates. ```bash mutagen sync list ``` ```bash mutagen sync list --long my-project ``` ```bash mutagen sync list --label-selector env=dev ``` ```bash mutagen sync list --template '{{range .}}{{.Identifier}} {{.Status}}{{"\n"}}{{end}}' ``` -------------------------------- ### Global Mutagen Configuration (mutagen.yml) Source: https://context7.com/mutagen-io/mutagen/llms.txt Sets system-wide default session configurations loaded from `~/.mutagen/mutagen.yml`. These defaults are merged with per-session configurations, with per-session values taking precedence. ```yaml # ~/.mutagen/mutagen.yml sync: defaults: mode: two-way-safe hash: xxh128 ignore: syntax: mutagen paths: - ".DS_Store" - "*.swp" - "__pycache__" vcs: ignore watch: mode: portable pollingInterval: 30 permissions: mode: portable defaultFileMode: "0644" defaultDirectoryMode: "0755" compression: algorithm: zstd forward: defaults: socket: overwriteMode: overwrite permissionMode: "0600" ``` -------------------------------- ### Manage Forwarding Session Lifecycle Source: https://context7.com/mutagen-io/mutagen/llms.txt Manage the lifecycle of forwarding sessions using pause, resume, and terminate commands. These operations are analogous to those for synchronization sessions and can target specific sessions or all sessions matching a label selector. ```bash mutagen forward pause web-forward ``` ```bash mutagen forward resume --all ``` ```bash mutagen forward terminate web-forward ``` ```bash mutagen forward terminate --label-selector env=dev ``` -------------------------------- ### Flush Synchronization Sessions Source: https://context7.com/mutagen-io/mutagen/llms.txt Use these commands to flush synchronization sessions. You can flush a specific session, all sessions, or sessions matching a label selector. The `--skip-wait` flag prevents waiting for the flush operation to complete. ```bash mutagen sync flush my-project ``` ```bash mutagen sync flush --all --skip-wait ``` ```bash mutagen sync flush --label-selector env=dev ``` -------------------------------- ### Mutagen Session Selection Modes Source: https://context7.com/mutagen-io/mutagen/llms.txt Specifies how to select sessions for bulk operations using modes: all sessions, by identifier/name, or by label selector. Labels are set during session creation. ```bash # Select all sessions mutagen sync pause --all ``` ```bash # Select by name or identifier (positional arguments) mutagen sync resume my-project sync_aBcDeFgHiJkLmNoP ``` ```bash # Select by label selector (key=value, supports comma-separated AND logic) mutagen sync terminate --label-selector "env=dev,service=api" ``` ```bash # Labels are set at creation time mutagen sync create \ --label env=prod \ --label service=backend \ ./src user@prod-server:/app/src ``` -------------------------------- ### List Forwarding Sessions Source: https://context7.com/mutagen-io/mutagen/llms.txt List existing network forwarding sessions. Supports filtering by name or label, long format output, and custom templating for specific information. ```bash mutagen forward list ``` ```bash mutagen forward list --long web-forward ``` ```bash mutagen forward list --template '{{range .}}{{.Identifier}}: {{.Source}} -> {{.Destination}}{"\n"}}{{end}}' ``` -------------------------------- ### Client Version Handshake in Go Source: https://context7.com/mutagen-io/mutagen/llms.txt The client side of the version handshake. It first receives the server's version and then sends its own. The connection is rejected if the versions do not match. ```go // pkg/mutagen/version.go // Version constants — currently 0.19.0-dev const ( VersionMajor = 0 VersionMinor = 19 VersionPatch = 0 VersionTag = "dev" ) // Client side: receive server version first, then send client version func ClientVersionHandshake(stream io.ReadWriteCloser) error { serverMajor, serverMinor, serverPatch, err := receiveVersion(stream) if err != nil { return fmt.Errorf("unable to receive server version: %w", err) } if err := sendVersion(stream); err != nil { return fmt.Errorf("unable to send client version: %w", err) } if serverMajor != VersionMajor || serverMinor != VersionMinor || serverPatch != VersionPatch { return errors.New("version mismatch") } return nil } ``` -------------------------------- ### Mutagen Project Configuration (mutagen.yml) Source: https://context7.com/mutagen-io/mutagen/llms.txt Defines pre- and post-creation/termination hooks, commands, and synchronization/forwarding defaults for a Mutagen project. ```yaml beforeCreate: - echo "Starting dev environment..." - docker-compose up -d afterCreate: - echo "Sessions created." afterTerminate: - docker-compose down commands: logs: docker-compose logs -f shell: docker exec -it my-container bash sync: defaults: ignore: paths: - ".git" - "node_modules" - "vendor" vcs: ignore watch: mode: portable app-code: alpha: "./src" beta: "docker://my-container:/app/src" mode: two-way-safe flushOnCreate: true configurationBeta: permissions: defaultFileMode: "0644" defaultDirectoryMode: "0755" forward: defaults: socket: overwriteMode: overwrite web: source: "tcp:localhost:8080" destination: "docker://my-container:tcp:localhost:80" db: source: "tcp:localhost:5432" destination: "docker://my-container:tcp:localhost:5432" ``` -------------------------------- ### Server Version Handshake in Go Source: https://context7.com/mutagen-io/mutagen/llms.txt The server side of the version handshake. It first sends its own version and then receives and validates the client's version. The connection is rejected if the versions do not match. ```go // Server side: send server version first, then receive and validate client version func ServerVersionHandshake(stream io.ReadWriteCloser) error { if err := sendVersion(stream); err != nil { return fmt.Errorf("unable to send server version: %w", err) } clientMajor, clientMinor, clientPatch, err := receiveVersion(stream) if err != nil { return fmt.Errorf("unable to receive client version: %w", err) } if clientMajor != VersionMajor || clientMinor != VersionMinor || clientPatch != VersionPatch { return errors.New("version mismatch") } return nil } ``` -------------------------------- ### mutagen sync resume Source: https://context7.com/mutagen-io/mutagen/llms.txt Resumes paused or disconnected synchronization sessions, re-establishing connections and reusing previous configuration. ```APIDOC ## `mutagen sync resume` — Resume paused or disconnected sessions Re-establishes connections and resumes synchronization for paused or disconnected sessions. Re-uses all previously configured session parameters. ### Method ```bash mutagen sync resume [SESSION_SELECTOR] [--all] [--label-selector LABEL_SELECTOR] ``` ### Parameters * `SESSION_SELECTOR`: Optional. A specific session name or identifier. * `--all`: Resume all sessions. * `--label-selector LABEL_SELECTOR`: Resume sessions matching the given label selector. ### Examples ```bash # Resume a specific session mutagen sync resume my-project # Resume all sessions mutagen sync resume --all # Resume using a label selector mutagen sync resume --label-selector env=dev ``` ``` -------------------------------- ### Resume Synchronization Sessions Source: https://context7.com/mutagen-io/mutagen/llms.txt Resume paused or disconnected synchronization sessions. This re-establishes connections and continues synchronization using previously configured parameters. ```bash mutagen sync resume my-project ``` ```bash mutagen sync resume --all ``` ```bash mutagen sync resume --label-selector env=dev ``` -------------------------------- ### Create Network Forwarding Session Source: https://context7.com/mutagen-io/mutagen/llms.txt Create a network forwarding session to tunnel traffic between endpoints. Supports various protocols and remote endpoints, including Docker containers and SSH. Sessions can be created pre-paused with specific socket ownership and permission settings. ```bash mutagen forward create \ --name web-forward \ --label service=web \ tcp:localhost:8080 \ docker://my-container:tcp:localhost:80 # Output: Created session forward_AbCdEfGhIjKlMnOp ``` ```bash mutagen forward create \ --name db-forward \ tcp:127.0.0.1:5432 \ user@devserver.example.com:tcp:localhost:5432 ``` ```bash mutagen forward create \ --paused \ --socket-owner www-data \ --socket-group www-data \ --socket-permission-mode 0660 \ unix:/tmp/app.sock \ docker://app-container:unix:/run/app.sock ``` -------------------------------- ### mutagen forward list Source: https://context7.com/mutagen-io/mutagen/llms.txt Lists all existing forwarding sessions, supporting filtering and custom output templating. ```APIDOC ## `mutagen forward list` — List forwarding sessions Lists all existing forwarding sessions. Supports the same filtering and templating options as `sync list`. ### Method ```bash mutagen forward list [--long] [--template TEMPLATE] [SESSION_SELECTOR] [--label-selector LABEL_SELECTOR] ``` ### Parameters * `--long`: Display sessions in long format. * `--template TEMPLATE`: Use a custom template for output formatting. * `SESSION_SELECTOR`: Optional. A specific session name or identifier. * `--label-selector LABEL_SELECTOR`: List sessions matching the given label selector. ### Examples ```bash # List all forwarding sessions mutagen forward list # Long format for a specific session mutagen forward list --long web-forward # Custom template output mutagen forward list --template '{{range .}}{{.Identifier}}: {{.Source}} -> {{.Destination}}{{"\n"}}{{end}}' ``` ``` -------------------------------- ### Terminate Mutagen Project Source: https://context7.com/mutagen-io/mutagen/llms.txt Stops and cleans up all sessions for the current project, executing `beforeTerminate` and `afterTerminate` hooks. Removes the lock file. ```bash # Terminate the current project mutagen project terminate ``` ```bash # Terminate a project defined by a specific file mutagen project terminate --project-file /path/to/my-mutagen.yml ``` -------------------------------- ### mutagen forward pause/resume/terminate Source: https://context7.com/mutagen-io/mutagen/llms.txt Manages the lifecycle of forwarding sessions, allowing them to be paused, resumed, or permanently terminated. ```APIDOC ## `mutagen forward pause` / `resume` / `terminate` — Manage forwarding session lifecycle Forwarding sessions support the same pause, resume, and terminate lifecycle operations as synchronization sessions. ### Methods * `mutagen forward pause [SESSION_SELECTOR] [--all] [--label-selector LABEL_SELECTOR]` * `mutagen forward resume [SESSION_SELECTOR] [--all] [--label-selector LABEL_SELECTOR]` * `mutagen forward terminate [SESSION_SELECTOR] [--all] [--label-selector LABEL_SELECTOR]` ### Parameters * `SESSION_SELECTOR`: Optional. A specific session name or identifier. * `--all`: Apply the operation to all sessions. * `--label-selector LABEL_SELECTOR`: Apply the operation to sessions matching the given label selector. ### Examples ```bash # Pause a forwarding session mutagen forward pause web-forward # Resume all forwarding sessions mutagen forward resume --all # Terminate a forwarding session permanently mutagen forward terminate web-forward # Terminate all forwarding sessions matching a label mutagen forward terminate --label-selector env=dev ``` ``` -------------------------------- ### Terminate Synchronization Sessions Source: https://context7.com/mutagen-io/mutagen/llms.txt Permanently delete synchronization sessions. Terminated sessions cannot be recovered and require a new `sync create` command to restart synchronization. ```bash mutagen sync terminate my-project ``` ```bash mutagen sync terminate --all ``` ```bash mutagen sync terminate --label-selector env=old ``` -------------------------------- ### mutagen forward create Source: https://context7.com/mutagen-io/mutagen/llms.txt Creates a network forwarding session to tunnel traffic between source and destination endpoints using a specified protocol format. ```APIDOC ## `mutagen forward create` — Create a network forwarding session Creates a forwarding session that tunnels traffic from a source endpoint to a destination endpoint. Endpoint URLs use a protocol prefix format: `tcp:localhost:8080`, `tcp:0.0.0.0:5432`, `unix:/run/app.sock`, or the remote variants `user@host:tcp:localhost:3000`, `docker://container:tcp:localhost:80`. ### Method ```bash mutagen forward create [--name NAME] [--label LABEL] [--paused] [--socket-owner OWNER] [--socket-group GROUP] [--socket-permission-mode MODE] SOURCE_ENDPOINT DESTINATION_ENDPOINT ``` ### Parameters * `--name NAME`: Assign a name to the forwarding session. * `--label LABEL`: Assign a label to the forwarding session. * `--paused`: Create the session in a paused state. * `--socket-owner OWNER`: Set the owner of the socket file (for Unix sockets). * `--socket-group GROUP`: Set the group of the socket file (for Unix sockets). * `--socket-permission-mode MODE`: Set the permission mode of the socket file (for Unix sockets). * `SOURCE_ENDPOINT`: The source endpoint URL. * `DESTINATION_ENDPOINT`: The destination endpoint URL. ### Examples ```bash # Forward local port 8080 to port 80 inside a Docker container mutagen forward create \ --name web-forward \ --label service=web \ tcp:localhost:8080 \ docker://my-container:tcp:localhost:80 # Output: Created session forward_AbCdEfGhIjKlMnOp # Forward a local Unix socket to a remote TCP port over SSH mutagen forward create \ --name db-forward \ tcp:127.0.0.1:5432 \ user@devserver.example.com:tcp:localhost:5432 # Create pre-paused forwarding session with socket ownership settings mutagen forward create \ --paused \ --socket-owner www-data \ --socket-group www-data \ --socket-permission-mode 0660 \ unix:/tmp/app.sock \ docker://app-container:unix:/run/app.sock ``` ``` -------------------------------- ### Monitor Mutagen Synchronization Session Status Source: https://context7.com/mutagen-io/mutagen/llms.txt Displays live, continuously-updated status for synchronization sessions. Shows staging progress, conflict indicators `[C]`, problem indicators `[!]`, and error indicators `[X]`. ```bash mutagen sync monitor ``` ```bash mutagen sync monitor --long my-project ``` ```bash mutagen sync monitor --label-selector env=dev ``` -------------------------------- ### Force Mutagen Synchronization Cycle Source: https://context7.com/mutagen-io/mutagen/llms.txt Triggers an immediate synchronization cycle for selected sessions. Can optionally block until the cycle completes. ```bash mutagen sync flush ``` -------------------------------- ### mutagen sync terminate Source: https://context7.com/mutagen-io/mutagen/llms.txt Permanently deletes synchronization sessions. Terminated sessions cannot be recovered and require a new creation command to restart. ```APIDOC ## `mutagen sync terminate` — Permanently delete a synchronization session Permanently removes a synchronization session from the daemon. The session cannot be recovered; a new `sync create` is required to restart synchronization. ### Method ```bash mutagen sync terminate [SESSION_SELECTOR] [--all] [--label-selector LABEL_SELECTOR] ``` ### Parameters * `SESSION_SELECTOR`: Optional. A specific session name or identifier. * `--all`: Terminate all sessions. * `--label-selector LABEL_SELECTOR`: Terminate sessions matching the given label selector. ### Examples ```bash # Terminate a specific session mutagen sync terminate my-project # Terminate all sessions mutagen sync terminate --all # Terminate by label mutagen sync terminate --label-selector env=old ``` ``` -------------------------------- ### Pause Synchronization Sessions Source: https://context7.com/mutagen-io/mutagen/llms.txt Pause active synchronization sessions. This retains the session definition, allowing it to be resumed later. Useful for temporarily stopping changes from propagating. ```bash mutagen sync pause my-project ``` ```bash mutagen sync pause --all ``` ```bash mutagen sync pause --label-selector env=staging ``` -------------------------------- ### mutagen sync flush Source: https://context7.com/mutagen-io/mutagen/llms.txt Flushes synchronization sessions, optionally waiting for completion or selecting sessions by label. ```APIDOC ## `mutagen sync flush` — Flush synchronization sessions Flushes synchronization sessions, optionally waiting for completion or selecting sessions by label. ### Method ```bash mutagen sync flush [SESSION_SELECTOR] [--all] [--skip-wait] [--label-selector LABEL_SELECTOR] ``` ### Parameters * `SESSION_SELECTOR`: Optional. A specific session name or identifier. * `--all`: Flush all sessions. * `--skip-wait`: Do not wait for the flush operation to complete. * `--label-selector LABEL_SELECTOR`: Flush sessions matching the given label selector. ### Examples ```bash # Flush a specific session and wait for completion mutagen sync flush my-project # Flush all sessions without waiting mutagen sync flush --all --skip-wait # Flush sessions by label selector mutagen sync flush --label-selector env=dev ``` ``` -------------------------------- ### mutagen sync pause Source: https://context7.com/mutagen-io/mutagen/llms.txt Pauses active synchronization on selected sessions, retaining the session definition for later resumption. ```APIDOC ## `mutagen sync pause` — Pause synchronization sessions Suspends active synchronization on the selected sessions. The session definition is retained and can be resumed later. Useful for temporarily preventing changes from propagating. ### Method ```bash mutagen sync pause [SESSION_SELECTOR] [--all] [--label-selector LABEL_SELECTOR] ``` ### Parameters * `SESSION_SELECTOR`: Optional. A specific session name or identifier. * `--all`: Pause all sessions. * `--label-selector LABEL_SELECTOR`: Pause sessions matching the given label selector. ### Examples ```bash # Pause a specific session by name mutagen sync pause my-project # Pause all sessions at once mutagen sync pause --all # Pause by label selector mutagen sync pause --label-selector env=staging ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.