nut resource
Manage and generate resources (images, audio, video) using AI.
resource, resources
Overview
Thenut resource command enables you to manage and generate media assets. Upload files, manage metadata, and generate images, audio, and video using AI models directly from the command line.
nut resource list
List all resources in your Coconut instance.
list, ls
Options:
-s, --search <query>- Filter resources by name, description, or tags--type <type>- Filter by media type prefix (e.g. image, audio, video)--json- Output as JSON--api <url>- API server URL (default: “http://localhost”)
nut resource get
Get details for a specific resource.
get, show
Arguments:
id- Resource ID
--json- Output as JSON-o, --output <path>- Download resource file to local path--api <url>- API server URL (default: “http://localhost”)
nut resource add
Upload a file to resources.
add, upload
Arguments:
file- File path(s) to upload
-t, --tags <tags>- Comma-separated tags-d, --description <text>- Description of the resource--json- Output as JSON--api <url>- API server URL (default: “http://localhost”)
nut resource update
Update resource metadata (tags, description).
id- Resource ID to update
-t, --tags <tags>- Comma-separated tags (replaces existing)-d, --description <text>- Description (replaces existing)--json- Output as JSON--api <url>- API server URL (default: “http://localhost”)
nut resource delete
Delete a resource.
delete, rm
Arguments:
id- Resource ID to delete
-f, --force- Skip confirmation prompt--json- Output as JSON--api <url>- API server URL (default: “http://localhost”)
Deleting a resource is permanent. Make sure you want to remove it before confirming.
nut resource generate-image
Generate an image using AI models via Replicate.
generate-image, image
Arguments:
prompt- Description of the image to generate
-m, --model <model>- Model to use (default:nano-banana-pro)--save- Save generated image to resources (.nut/resources/)-o, --output <path>- Download image to local file path--api <url>- API server URL (default: “http://localhost”)
| CLI flag | Replicate model | Notes |
|---|---|---|
nano-banana-pro | google/nano-banana-pro | Default. Supports resolution (1K/2K/4K), image input for style reference |
flux-2-dev | black-forest-labs/flux-2-dev | Supports --go-fast, quality (60-100), image input |
flux-2-pro | black-forest-labs/flux-2-pro | Supports resolution (0.5 MP–4 MP), --safety (1-6), image input |
gpt-image-1.5 | openai/gpt-image-1.5 | Supports --quality (low/medium/high), --background (auto/transparent/opaque), limited aspect ratios (1:1, 3:2, 2:3) |
nut resource generate-audio
Generate audio from text using AI text-to-speech.
generate-audio, audio, tts
Arguments:
text- Text to convert to speech
-v, --voice <id>- Voice ID (default: “English_Trustworth_Man”)-s, --speed <number>- Speech speed multiplier, 0.5-2.0 (default: “1”)-p, --pitch <number>- Pitch adjustment, -12 to 12 (default: “0”)-e, --emotion <type>- Emotion style (auto, happy, sad, angry, fearful, surprised, disgusted) (default: “auto”)-l, --language <lang>- Language boost (default: “English”)-f, --format <format>- Audio format (mp3, wav, ogg) (default: “mp3”)--save- Save generated audio to resources (.nut/resources/)-o, --output <path>- Download audio to local file path--api <url>- API server URL (default: “http://localhost”)
minimax/speech-02-turbo for high-quality text-to-speech generation.
Examples:
Generated audio is suitable for narration, voiceovers, podcast intros, and other audio content needs.
nut resource generate-video
Generate a video using AI.
generate-video, video, vid
Arguments:
prompt- Description of the video to generate
-d, --duration <seconds>- Video duration in seconds, 5-16 (default: “8”)-r, --resolution <res>- Video resolution (480p, 720p, 1080p) (default: “720p”)-a, --aspect-ratio <ratio>- Aspect ratio (16:9, 9:16, 1:1) (default: “16:9”)--start-frame <id>- Resource ID of image to use as first frame--end-frame <id>- Resource ID of image to use as last frame--no-audio- Disable AI audio generation for the video--save- Save generated video to resources (.nut/resources/)-o, --output <path>- Download video to local file path--api <url>- API server URL (default: “http://localhost”)
google/veo-3.1-fast for fast, high-quality video generation.
Examples:
Use Cases
Documentation Assets
Marketing Materials
Audio Content
Best Practices
Write detailed prompts
Write detailed prompts
The quality of generated resources depends heavily on prompt clarity. Include specific details about what you want, including style, mood, colors, composition, and any key elements.
Iterate and refine
Iterate and refine
If the first result isn’t perfect, refine your prompt and try again. Small changes in wording can produce significantly different results.
Organize outputs
Organize outputs
Use the
--save option to store resources in your Coconut instance, or --output to save files locally in organized directories.Consider resource usage
Consider resource usage
AI resource generation can be computationally expensive. Be mindful of the number and complexity of assets you generate, especially videos.
Model Information
- Images: Generated via Replicate’s AI models
- Audio: Uses MiniMax speech-02-turbo for natural-sounding speech
- Video: Powered by Google’s Veo 3.1 Fast model for efficient video generation
Resource generation requires the Coconut server to be running (
nut serve) and a Replicate API token configured via nut config set replicate <token>.