Commander Command instance configured for bridge protocol
# Upload file via bridge protocol
echo '{"oid":"abc123...","path":"/tmp/file.bin","credentialProvider":"git-credential"}' \
| proton-drive bridge upload
# Download file via bridge protocol
echo '{"oid":"abc123...","outputPath":"/tmp/out.bin"}' \
| proton-drive bridge download
# Check if file exists
echo '{"oid":"abc123..."}' \
| proton-drive bridge exists
# Authenticate (session reuse supported)
echo '{"username":"user@proton.me","password":"..."}' \
| proton-drive bridge auth
# Batch exists check
echo '{"oids":["abc123...","def456..."]}' \
| proton-drive bridge batch-exists
// Programmatic usage (Go adapter integration)
import { spawn } from 'child_process';
const bridge = spawn('proton-drive', ['bridge', 'upload']);
bridge.stdin.write(JSON.stringify({
oid: 'abc123...',
path: '/tmp/file.bin',
credentialProvider: 'git-credential',
}));
bridge.stdin.end();
bridge.stdout.on('data', (data) => {
const response = JSON.parse(data.toString());
if (response.ok) {
console.log('Upload successful:', response.payload);
} else {
console.error('Upload failed:', response.error);
}
});
// Go adapter usage
cmd := exec.Command("proton-drive", "bridge", "upload")
cmd.Stdin = bytes.NewBufferString(`{"oid":"abc123...","path":"/tmp/file.bin"}`)
output, err := cmd.Output()
var response BridgeResponse
json.Unmarshal(output, &response)
Create the bridge command for the CLI.
Implements the JSON-based bridge protocol for Git LFS integration with the Go adapter. Reads JSON requests from stdin, performs Proton Drive operations via SDK, and writes JSON responses to stdout. Designed for subprocess communication with the Git LFS adapter.
Bridge Protocol
Request Format (stdin):
Response Format (stdout):
Error Response (stdout):
Supported Commands
Security Features
Error Handling
Exit Codes