7 Commits

Author SHA1 Message Date
fa704832d5 reword 2026-02-05 21:44:39 +00:00
69925021af spell fix 2026-02-05 15:43:19 +00:00
e092ed3c4e add Configuration section to README 2026-02-05 15:42:39 +00:00
d87bc2678c add short Config flags 2026-02-05 15:42:07 +00:00
c3221f3df5 reduce default timeout to 100ms
add env var for raw timeout
2026-02-05 15:13:33 +00:00
dc733ba500 add macos target to Taskfile 2026-02-05 14:20:03 +00:00
2a5e0e022f upd README 2026-02-05 13:42:57 +00:00
4 changed files with 38 additions and 8 deletions

View File

@@ -6,6 +6,28 @@
go install github.com/onyx-and-iris/xair-cli@latest
```
### Configuration
#### Flags
- --host/-H: Host of the mixer.
- --port/-P: Port of the mixer.
- --kind/-k: The kind of mixer. May one of (*xair*, *x32*).
- Use this flag to connect to an x32 mixer.
#### Environment Variables
Example .envrc:
```bash
#!/usr/bin/env bash
XAIR_CLI_HOST=mixer.local
XAIR_CLI_PORT=10024
XAIR_CLI_KIND=xair
XAIR_CLI_RAW_TIMEOUT=50ms
```
### Use
```console
@@ -29,8 +51,8 @@ Raw
Main
main mute Get or set the mute state of the Main L/R output.
main fader Get or set the fader level of the Main L/R output.
main fadein Get or set the fade-in time of the Main L/R output.
main fadeout Get or set the fade-out time of the Main L/R output.
main fadein Fade in the Main L/R output over a specified duration.
main fadeout Fade out the Main L/R output over a specified duration.
Strip
strip <index> mute Get or set the mute state of the strip.

View File

@@ -9,6 +9,7 @@ vars:
WINDOWS: '{{.BIN_DIR}}/{{.PROGRAM}}_windows_amd64.exe'
LINUX: '{{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64'
MACOS: '{{.BIN_DIR}}/{{.PROGRAM}}_darwin_amd64'
tasks:
default:
@@ -22,6 +23,7 @@ tasks:
cmds:
- task: build-windows
- task: build-linux
- task: build-macos
vet:
desc: Vet the code
@@ -46,6 +48,12 @@ tasks:
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.version={{.VERSION}}"
internal: true
build-macos:
desc: Build the xair-cli project for macOS
cmds:
- GOOS=darwin GOARCH=amd64 go build -o {{.MACOS}} -ldflags="-X main.version={{.VERSION}}"
internal: true
test:
desc: Run tests
cmds:

View File

@@ -32,9 +32,9 @@ type context struct {
}
type Config struct {
Host string `default:"mixer.local" help:"The host of the X-Air device." env:"XAIR_CLI_HOST"`
Port int `default:"10024" help:"The port of the X-Air device." env:"XAIR_CLI_PORT"`
Kind string `default:"xr18" help:"The kind of the X-Air device." env:"XAIR_CLI_KIND"`
Host string `default:"mixer.local" help:"The host of the X-Air device." env:"XAIR_CLI_HOST" short:"H"`
Port int `default:"10024" help:"The port of the X-Air device." env:"XAIR_CLI_PORT" short:"P"`
Kind string `default:"xr18" help:"The kind of the X-Air device." env:"XAIR_CLI_KIND" short:"K"`
}
// CLI is the main struct for the command-line interface.

6
raw.go
View File

@@ -7,9 +7,9 @@ import (
// RawCmd represents the command to send raw OSC messages to the mixer.
type RawCmd struct {
Timeout time.Duration `help:"Timeout for the OSC message send operation." default:"200ms" short:"t"`
Address string `help:"The OSC address to send the message to." arg:""`
Args []string `help:"The arguments to include in the OSC message." arg:"" optional:""`
Timeout time.Duration `help:"Timeout for the OSC message send operation." default:"100ms" short:"t" env:"XAIR_CLI_RAW_TIMEOUT"`
Address string `help:"The OSC address to send the message to." arg:""`
Args []string `help:"The arguments to include in the OSC message." arg:"" optional:""`
}
// Run executes the RawCmd by sending the specified OSC message to the mixer and optionally waiting for a response.