|
1 | 1 | #!/usr/bin/env node
|
2 | 2 | import { program, Option } from 'commander';
|
3 | 3 | import { opt } from './cmd/opt.js';
|
4 |
| -import { transpile, types } from './cmd/transpile.js'; |
| 4 | +import { transpile, types, guestTypes } from './cmd/transpile.js'; |
5 | 5 | import { run as runCmd, serve as serveCmd } from './cmd/run.js';
|
6 | 6 | import { parse, print, componentNew, componentEmbed, metadataAdd, metadataShow, componentWit } from './cmd/wasm-tools.js';
|
7 | 7 | import { componentize } from './cmd/componentize.js';
|
@@ -81,6 +81,18 @@ program.command('types')
|
81 | 81 | .option('--all-features', 'enable all features')
|
82 | 82 | .action(asyncAction(types));
|
83 | 83 |
|
| 84 | +program.command('guest-types') |
| 85 | + .description('(experimental) Generate guest types for the given WIT') |
| 86 | + .usage('<wit-path> -o <out-dir>') |
| 87 | + .argument('<wit-path>', 'path to a WIT file or directory') |
| 88 | + .option('--name <name>', 'custom output name') |
| 89 | + .option('-n, --world-name <world>', 'WIT world to generate types for') |
| 90 | + .requiredOption('-o, --out-dir <out-dir>', 'output directory') |
| 91 | + .option('-q, --quiet', 'disable output summary') |
| 92 | + .option('--feature <feature>', 'enable one specific WIT feature (repeatable)', collectOptions, []) |
| 93 | + .option('--all-features', 'enable all features') |
| 94 | + .action(asyncAction(guestTypes)); |
| 95 | + |
84 | 96 | program.command('run')
|
85 | 97 | .description('Run a WASI Command component')
|
86 | 98 | .usage('<command.wasm> <args...>')
|
|
0 commit comments