OpenCode plugin for Shakespeare AI provider with NIP-98 auth, NIP-46 remote signing, Shakespeare Deploy, and Nostr Git
OpenCode plugin for Shakespeare AI provider with NIP-46 remote signing and Nostr development tools.
- Shakespeare AI Provider: Use Claude and other models via Shakespeare AI with NIP-98 authentication
- NIP-46 Remote Signing: Authenticate via QR code scan - your private key never leaves your signer app
- Shakespeare Deploy: Deploy static sites to shakespeare.wtf
- Nostr Git (ngit): Publish repositories to decentralized git hosting using NIP-34
- mkstack Integration: Initialize new Nostr projects using the mkstack framework
- Shakespeare Agent: Specialized AI agent for building Nostr applications
Install once and use in all projects:
``bash`
mkdir -p ~/.config/opencode
cat > ~/.config/opencode/opencode.json << 'EOF'
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@shakespeare.diy/opencode-plugin"]
}
EOF
Then restart OpenCode - it will auto-install the plugin.
Add to your project's opencode.json:
`json`
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@shakespeare.diy/opencode-plugin"]
}
The plugin will automatically configure the Shakespeare AI provider and models on first run.
The Shakespeare agent provides natural language commands for Nostr development:
`bash`
mkdir -p ~/.config/opencode/agent
cp node_modules/@shakespeare.diy/opencode-plugin/agent/shakespeare.md ~/.config/opencode/agent/
For enhanced Nostr functionality:
`json`
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@shakespeare.diy/opencode-plugin"],
"mcp": {
"nostr": {
"type": "local",
"command": ["npx", "-y", "@nostrbook/mcp@latest"]
}
}
}
Shakespeare AI uses NIP-46 remote signing for authentication. This means:
- Your private key (nsec) never leaves your signer app
- You authenticate by scanning a QR code
- Authentication persists across sessions
1. Start OpenCode in your project
2. Run shakespeare_connect - a QR code will be displayedshakespeare_complete
3. Scan the QR code with your signer app (Amber or Primal)
4. Approve the connection in your signer app
5. Run to finish the connection
`
> shakespeare_connect
[QR Code displayed]
Scan with Amber (Android) or Primal (iOS/Android)
> shakespeare_complete
Connected successfully!
User pubkey: npub1...
`
`
> shakespeare_status
Connected: Yes
Public Key: npub1...
Relays: wss://relay.nsec.app
`
After connecting, select a Shakespeare model via /models or /connect:
1. Press /connect and search for "Shakespeare"claude-sonnet-4.5
2. Select "Nostr (NIP-46)" authentication
3. Choose a model (e.g., )
Or set it in your opencode.json:
`json`
{
"plugin": ["@shakespeare.diy/opencode-plugin"],
"model": "shakespeare/claude-sonnet-4.5"
}
The plugin automatically fetches available models from Shakespeare AI. Current models include:
- claude-sonnet-4.5 - Fast, capable model for most tasksclaude-opus-4.5
- - Most capable model for complex tasks
| Tool | Description |
|------|-------------|
| shakespeare_connect | Display QR code to initiate NIP-46 connection |shakespeare_complete
| | Complete the connection after scanning QR code |shakespeare_status
| | Check authentication status |shakespeare_disconnect
| | Disconnect and clear credentials |shakespeare_sign_event
| | Sign a Nostr event using remote signer |shakespeare_get_pubkey
| | Get connected user's public key |shakespeare_init
| | Initialize a new mkstack project |shakespeare_deploy
| | Deploy dist/ to shakespeare.wtf |shakespeare_ngit
| | Publish repository to Nostr Git (NIP-34) |
Once connected, Shakespeare AI works like any other provider:
`
> Help me build a REST API endpoint
[Claude responds via Shakespeare AI with NIP-98 authentication]
`
`
> shakespeare_deploy
Building site from dist/...
Deploying to shakespeare.wtf...
Your site is live at: https://yourapp.shakespeare.wtf
`
`
> shakespeare_ngit
Publishing repository to Nostr Git...
Published!
Repository: my-project
Clone with: git clone nostr://npub1.../my-project
`
`
> shakespeare_init my-nostr-app
Cloning mkstack template...
Installing dependencies...
Project created at ./my-nostr-app
`
The plugin uses this relay for NIP-46 communication:
- wss://relay.nsec.app
Specify custom relays when connecting:
``
> shakespeare_connect with relays wss://my-relay.com,wss://other-relay.com
Credentials are stored in ~/.config/shakespeare/auth.json:
- Client keypair (for relay communication only)
- Bunker public key
- User public key
- Connected relays
Your private key is never stored - it remains in your signer app.
- Amber (Android)
- Primal (Android/iOS)
Run shakespeare_connect followed by shakespeare_complete to establish a connection.
The plugin auto-configures on first run. If models don't appear:
1. Restart OpenCode
2. Check that opencode.json has the provider.shakespeare section/connect
3. Run and select Shakespeare AI
Check that ~/.config/shakespeare/auth.json exists after connecting. If it's being deleted, there may be a permission issue with the config directory.
- Ensure your signer app supports NIP-46 (nostrconnect://)
- Try different relays if the default ones are unreachable
- Check that your phone and computer are on the same network (not required, but helps)
`bashClone the repo
git clone https://gitlab.com/soapbox-pub/shakespeare-opencode-plugin
cd shakespeare-opencode-plugin
MIT