Write in VS Code, Publish to StarLaker
Use VS Code as your writing environment. Write in Markdown, publish with one keyboard shortcut. No browser needed.
1. Get Your API Key
- Sign in to StarLaker
- Go to Dashboard → API Keys
- Click Generate API Key
- Copy the key — it starts with
sl_live_
2. Option A: VS Code REST Client (easiest)
Install the REST Client extension (35M+ installs). Create publish.http:
### Publish to StarLaker
POST https://starlaker.com/api/v1/posts
Authorization: Bearer sl_live_YOUR_KEY_HERE
Content-Type: application/json
{
"title": "My VS Code Post",
"content": "# Hello from VS Code",
"tags": ["tech", "vscode"],
"status": "published"
}Click "Send Request" above the POST line. Your post goes live instantly.
💡 Pro tip: VS Code Snippets
Go to File → Preferences → Configure Snippets → http.json. Type starlaker + Tab to insert a publish template.
3. Option B: Terminal (cURL)
No extensions needed. Write a markdown file and publish from terminal:
curl -X POST https://starlaker.com/api/v1/posts \
-H "Authorization: Bearer $STARLAKER_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Terminal Post","content":"## Hello","tags":["cli"],"status":"published"}'Add this to ~/.bashrc for a reusable publish command:
export STARLAKER_KEY="sl_live_your_key_here"
publish() {
curl -s -X POST https://starlaker.com/api/v1/posts \
-H "Authorization: Bearer $STARLAKER_KEY" \
-H "Content-Type: application/json" \
-d "{\"title\":\"$1\",\"content\":\"$(cat $2)\",\"status\":\"published\"}"
}
# Usage: publish "My Title" post.md4. Option C: GitHub Actions
Auto-publish on every push. Create .github/workflows/publish.yml:
name: Publish to StarLaker
on:
push:
paths: ['posts/*.md']
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish posts
run: |
for file in posts/*.md; do
title=$(head -1 "$file" | sed 's/^# //')
curl -s -X POST https://starlaker.com/api/v1/posts \
-H "Authorization: Bearer ${{ secrets.STARLAKER_KEY }}" \
-H "Content-Type: application/json" \
-d "{\"title\":\"$title\",\"content\":\"$(cat $file)\",\"status\":\"published\"}"
doneAdd STARLAKER_KEY to GitHub → Settings → Secrets and Variables → Actions.
5. Option D: Watch Mode
Auto-publish when you save a .md file:
npm install -g nodemon
nodemon -e md --exec "bash publish.sh"Quick Reference
| Method | Setup | Best for |
|---|---|---|
| REST Client | 1 min | One-click from VS Code |
| cURL | 30 sec | Terminal, scripts, automation |
| GitHub Actions | 5 min | Git-based publishing workflow |
| Watch Mode | 1 min | Auto-publish on file save |
See also: Full API Reference