# Examples

> Ready-to-use Nodaro CLI recipes to run a workflow nightly with cron, gate CI steps on a run, script image generation, caption a video and improve a prompt.

Source: https://nodaro.ai/docs/developers/cli/examples

These **Nodaro CLI examples** are short recipes for common jobs: scheduled runs, CI gates, scripted generation, captions from a transcript and prompt improvement. Each one assumes you have [installed the CLI and signed in](https://nodaro.ai/docs/developers/cli), and most use `jq` to read JSON output.

## Run a workflow every night with cron

This cron entry runs a workflow every night at 03:00 and appends the JSON result to a log file:

```text
0 3 * * * /usr/local/bin/nodaro workflows run wf_abc123 --json >> /var/log/nodaro-nightly.log 2>&1
```

## Wait for a run, then continue

`--watch` makes the command wait for the run and exit with `0` only on success, so the next command runs only when the workflow succeeded:

```bash
nodaro workflows run wf_abc --watch && \
echo "shipped" | mail -s "nodaro run done" me@example.com
```

The other exit codes are listed on [Output and exit codes](https://nodaro.ai/docs/developers/cli/output).

## Generate an image in one command

```bash
nodaro nodes run generate-image \
  --param prompt="a snow leopard on a mountain ridge, cinematic" \
  --param provider=flux \
  --param resolution=2K \
  --watch --json | jq -r '.output_data.imageUrl'
```

The command prints only the URL of the image, ready for the next step of a script.

## Caption a video from its transcript

Transcribe a track with word timings, then burn the words in as kinetic captions.

```bash
# 1. Word-level transcription (elevenlabs-stt always returns word timings)
nodaro audio transcribe --audio https://example.com/talk.mp3 \
  --provider elevenlabs-stt --watch

# 2. Save the words. They are in milliseconds; the top-level segments are in seconds.
nodaro jobs get <jobId> --json | jq '.output_data.words' > words.json

# 3. Burn them in. With captions supplied, add-captions runs no transcription of its own.
nodaro media add-captions https://example.com/talk.mp4 \
  --captions-file words.json \
  --style word-highlight --no-auto-transcribe --watch
```

- Correct the `text` of a word in `words.json` between steps 2 and 3, and the correction is what appears in the video.
- Add `--max-words-per-line 2` to step 3 for a fast read, two words at a time.
- Step 1 needs a word-level engine: `elevenlabs-stt`, or `incredibly-fast-whisper` with `--word-timestamps`. The `whisper` engine returns phrases without words, so a kinetic style would have nothing to show.

See [Media and voice commands](https://nodaro.ai/docs/developers/cli/media-commands#captions) for every caption option.

## Wrap an app's prompt with hidden text

`--override` adds text before and after the user's prompt for one run, without changing the app:

```bash
nodaro apps run hair-styler-dd3erw --input prompt="curly red hair" \
  --override n1.promptPrefix="Studio portrait of" --override n1.promptSuffix=", 85mm, soft light"
```

See [Prompt pre and post text](https://nodaro.ai/docs/concepts/prompt-pre-post-text) for how the text is joined to the prompt.

## Turn a rough idea into an optimized prompt

`prompt enhance` rewrites a prompt in one step. Feed its result straight into a node run:

```bash
PROMPT=$(nodaro prompt enhance \
  --node-type generate-image \
  --prompt "snow leopard" \
  --json | jq -r '.prompt')

nodaro nodes run generate-image --param prompt="$PROMPT" --watch
```

To use the wizard's guided questions in a script, use the two-step path: `nodaro prompt analyze --json` returns the questions, and `nodaro prompt generate --selection category=value` builds the final prompt from your answers. The interactive `nodaro prompt wizard` needs a terminal.

## Export a month of usage

On an instance with organizations, write a usage report per member to a CSV file:

```bash
nodaro org usage org_abc --from 2026-09-01 --to 2026-09-30 --group-by member --csv > september.csv
```

See [Workspaces and organizations](https://nodaro.ai/docs/developers/cli/workspaces#usage-reports).

## Frequently asked questions

### How do I run a Nodaro workflow on a schedule?

Add a cron entry that calls nodaro workflows run with the workflow id and --json, and appends the output to a log file. The first example on this page runs a workflow every night at 03:00.

### How do I get the URL of a generated image in a shell script?

Run nodaro nodes run generate-image with --watch and --json, and pipe the output to jq -r '.output_data.imageUrl'.

### How do I add word-by-word captions to a video from the CLI?

Transcribe the audio with a word-level engine such as elevenlabs-stt, save the job's output_data.words to a file, and pass the file to nodaro media add-captions with --captions-file and --no-auto-transcribe.

### Can I improve a prompt before I run a node?

Yes. nodaro prompt enhance with --node-type and --prompt returns an optimized prompt, which you can pass straight to nodaro nodes run.
