Smithy command-line application
moonx moonrockz/smithy-cli@latest --help
moonx moonrockz/smithy-cli@latest versionmise use -g github:moonrockz/smithy
smithy versionmoon build apps/smithy --target native --release
_build/native/release/build/moonrockz/smithy-cli/smithy-cli.exe versionsmithy ast model.smithy extra.json
smithy validate model.smithy extra.json
smithy build --config smithy-build.json
smithy clean --config smithy-build.json
smithy select --selector 'structure > member > string' model.smithy
smithy convert --to json model.smithy -o model.json
smithy convert --to idl model.json -o model.smithy
smithy convert --to idl one.json two.json --output-dir generated
smithy format model.smithy
smithy format --check model.smithy model.json
smithy format --write model.smithy model.jsonmise exec -- moon run apps/smithy --target js -- build --config examples/local-resources/smithy-build.jsoncat model.smithy | smithy convert --from idl --to json -{"path":"module.zip","root":"models","paths":["service.smithy"],"globs":["shared/**/*.json"]}{"path":"downloaded-package.tgz","root":"package/models","globs":["**/*.smithy","**/*.json"]}mise exec -- moon run apps/smithy --target js -- build --config examples/npm-archive/smithy-build.json{"url":"https://example.org/models.zip","format":"zip","root":"models","globs":["**/*.smithy"]}mise exec -- moon run apps/smithy --target js -- build --config examples/public-archive/smithy-build.json{
"version": "2.0",
"sources": [{
"github": {
"repository": "owner/models",
"tag": "v1.2.3",
"asset": "models.zip"
},
"format": "zip",
"root": "models",
"globs": ["**/*.smithy"]
}]
}{
"version": "2.0",
"sources": [{
"npm": { "package": "@scope/models", "version": "1.2.3" },
"root": "package/models",
"globs": ["**/*.smithy"]
}],
"imports": [{
"maven": {
"group": "org.example",
"artifact": "model-traits",
"version": "1.2.3"
}
}]
}mise exec -- moon run apps/smithy --target js -- build --config examples/npm-registry/smithy-build.json
mise exec -- moon run apps/smithy --target js -- build --config examples/maven-repository/smithy-build.json{
"version": "2.0",
"credentials": [
{ "origin": "https://api.github.com", "bearerTokenEnv": "GITHUB_TOKEN" },
{ "origin": "https://registry.npmjs.org", "bearerTokenEnv": "NPM_TOKEN" },
{ "origin": "https://maven.example.com", "usernameEnv": "MAVEN_USER", "passwordEnv": "MAVEN_PASSWORD" }
]
}