| 16 | } |
| 17 | |
| 18 | async function main() { |
| 19 | const argv = cli({ |
| 20 | name: 'deepnote-convert', |
| 21 | parameters: ['<path>'], |
| 22 | flags: { |
| 23 | projectName: { |
| 24 | description: 'The name of the Deepnote project.', |
| 25 | type: String, |
| 26 | }, |
| 27 | outputPath: { |
| 28 | alias: 'o', |
| 29 | description: 'The path where the .deepnote file will be saved.', |
| 30 | type: String, |
| 31 | }, |
| 32 | outputFormat: { |
| 33 | description: 'Output format when converting from .deepnote: jupyter (default), percent, quarto, or marimo.', |
| 34 | type: OutputFormat, |
| 35 | }, |
| 36 | cwd: { |
| 37 | description: 'The working directory to resolve paths relative to.', |
| 38 | type: String, |
| 39 | }, |
| 40 | singleFile: { |
| 41 | description: 'Output a single file with outputs included (disables snapshot mode).', |
| 42 | type: Boolean, |
| 43 | default: false, |
| 44 | }, |
| 45 | }, |
| 46 | }) |
| 47 | |
| 48 | await convert({ |
| 49 | inputPath: argv._.path, |
| 50 | projectName: argv.flags.projectName, |
| 51 | outputPath: argv.flags.outputPath, |
| 52 | outputFormat: argv.flags.outputFormat, |
| 53 | cwd: argv.flags.cwd ?? process.cwd(), |
| 54 | singleFile: argv.flags.singleFile, |
| 55 | }) |
| 56 | } |
| 57 | |
| 58 | if (process.env.NODE_ENV !== 'test' && process.env.VITEST !== 'true') { |
| 59 | main().catch(error => { |