Skip to main content
Glama
CheckSyntaxCommand.kt1.15 kB
package maestro.cli.command import maestro.cli.CliError import maestro.orchestra.error.SyntaxError import maestro.orchestra.yaml.YamlCommandReader import picocli.CommandLine import java.io.File import java.util.concurrent.Callable @CommandLine.Command( name = "check-syntax", description = [ "Check syntax of Maestro code" ], hidden = true ) class CheckSyntaxCommand : Callable<Int> { @CommandLine.Parameters( index = "0", description = ["Check syntax of Maestro flow file or \"-\" for stdin"], ) private lateinit var file: File override fun call(): Int { val maestroCode = if (file.path == "-") { System.`in`.readBytes().toString(Charsets.UTF_8) } else { if (!file.exists()) throw CliError("File does not exist: ${file.absolutePath}") file.readText() } if (maestroCode.isBlank()) throw CliError("Maestro code is empty.") try { YamlCommandReader.checkSyntax(maestroCode) println("OK") } catch (e: SyntaxError) { throw CliError(e.message) } return 0 } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mobile-dev-inc/Maestro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server