GuidesHow to Use the /ptt Command in OpenCode

How to Use the /ptt Command in OpenCode

The /ptt (push-to-talk) slash command is the core of walkie-talkie mode. It toggles recording on and off — type it once to start, again to stop and send.

1
Start a session
Open any OpenCode session. The AI can be idle or actively generating a response — /ptt works in both states.
2
Type /ptt to start recording
Type /ptt and press enter. A toast shows "🎤 Recording..." The session aborts if generation was in progress, and the mic starts capturing audio.
3
Speak your correction
Say your correction, question, or redirection clearly. The recording captures 16kHz mono WAV audio until you type /ptt again.
4
Type /ptt again to send
Type /ptt and press enter again. The recording stops, whisper transcribes it, and the transcript is sent as your next user message. A toast shows "✅ Sent: ..."
Tips
• The /ptt toggle works even when the AI is idle — you can pre-record a message and send it when ready.
• If no audio is detected (silent recording), you'll see a "⚠️ No audio captured" warning. Speak louder or check your mic.
• Set OPENAI_API_KEY for better transcription accuracy with accents and technical vocabulary.

Troubleshooting

If /ptt does not appear as a recognized command, ensure the plugin loaded correctly. Run opencode plugin list to verify. Check ~/.local/share/opencode/log/ for errors.

Ready to try it?

Get started free →