A CLI tool for executing source files in the Codize Sandbox.
$ npm install -g @codize/cli
# without global installation
$ npx @codize/cli --helpGenerate your API key at codize.dev/settings/api-keys, then configure it using one of the following methods (listed in priority order):
- CLI flag:
--api-key - Environment variable:
CODIZE_API_KEY - Config file:
codize config set api-key <key>
# Save API key to config file (recommended)
$ codize config set api-key cdz_YourApiKeyHere
# Or use an environment variable
$ export CODIZE_API_KEY="cdz_YourApiKeyHere"The config file is stored at $XDG_CONFIG_HOME/codize/config.json (defaults to ~/.config/codize/config.json).
$ codize run main.tsYou can pass multiple files:
$ codize run main.ts utils.tsUse --json to get structured output for programmatic use:
$ codize run main.ts --json
{
"compile": {
"stdout": "",
"stderr": "",
"output": "",
"exitCode": 0
},
"run": {
"stdout": "Hello\n",
"stderr": "",
"output": "Hello\n",
"exitCode": 0
}
}