Picard Code 以語音操作 OpenCode 2,向 Sir Patrick Stewart 致敬
Code like the Captain — a tribute to Sir Patrick Stewart
Stefan Broenner 的開源工具 Picard Code 為 OpenCode 2 提供語音介面,讓用戶以語音提出編碼要求。語音辨識和語音輸出預設使用本機 Whisper 和 Kokoro,亦支援 Azure MAI;OpenCode 2 可連接用戶選定的模型供應商。使用本機語音處理時,音訊留在電腦,但編碼請求及相關專案內容會傳送至所選模型供應商。
Captain Picard doesn’t type prompts. He talks to the computer. I wanted to code that way.
Picard Code is a voice-only interface to OpenCode 2, with an original TNG-inspired look and your own bridge crew. It’s my tribute to Captain Jean-Luc Picard and Sir Patrick Stewart—and I use it for real coding work.
With Node.js 24 or newer installed, open a terminal and run:
npx picard-code
It runs on macOS, Linux, and Windows and opens in your desktop browser.
Work from the Captain’s chair
Say “Computer,” give an order, and hear a brief response while the details appear on screen. Requests are spoken, not typed. The interface takes its visual cues from the computer in Star Trek: The Next Generation, with original artwork, a Captain’s log, and stardates.
To work on existing code, use the Project tile to choose the folder containing it. OpenCode reads the files, investigates problems, makes changes, and runs checks. Picard Code changes how you work with it, rather than replacing the coding engine.
Your bridge crew
The officers bring different expertise to your actual work:
| Officer | Role |
|---|---|
| Riker | Weighs options and recommends a course |
| Data | Investigates, researches, and explains |
| Geordi | Builds, repairs, and troubleshoots |
| Worf | Reviews risks, security, and privacy |
| Troi | Helps with writing, clarity, and usability |
| Crusher | Checks reliability and recovery |
Each has a distinct manner as well as a responsibility. Data is exact, Geordi is practical, Riker makes recommendations, and Worf gets to the point.
You can address an officer directly: “Computer, Data, explain this project.” Or give the request to the computer and let it choose the officer. When work needs several perspectives, the computer brings their reports together in a briefing for you.
The computer and crew also handle questions, writing, research, and planning—not just code.
A tribute you spend time with
The tribute goes beyond the colors and names. Source-linked facts appear alongside your work, and short spoken stories celebrate Picard’s fictional adventures and Sir Patrick Stewart’s real career. Those are kept distinct: the Captain’s life is fiction; the actor’s career is not.
The wording and artwork are original, with no copied television dialogue or cloned actor voices. The aim is the feeling of working with the computer and crew, not a collection of catchphrases.
Local and cloud speech
Listening and speaking use local Whisper and Kokoro by default. Picard Code also supports Azure MAI through your own Azure resources, with listening and speaking selected independently.
OpenCode 2 connects to your chosen model provider, including GitHub Copilot, Anthropic, OpenAI, Azure OpenAI, and supported local models. Local speech keeps audio processing on your computer; coding requests and relevant project content go to the model provider you select.
Help shape the computer
Picard Code is open source under the MIT license. I’d particularly welcome contributions to the computer and crew’s character, carefully sourced tribute material, and more speech and voice models and services.
Local or cloud-based, from any provider—there’s room to bring more voices aboard. Better pronunciation, more natural follow-ups, and testing with different accents and microphones would help too.
Questions? Leave them in the comments or on GitHub!
來源:DEV Community · dev.to