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

  1. Sign in to StarLaker
  2. Go to Dashboard → API Keys
  3. Click Generate API Key
  4. 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.md

4. 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\"}"
          done

Add 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

MethodSetupBest for
REST Client1 minOne-click from VS Code
cURL30 secTerminal, scripts, automation
GitHub Actions5 minGit-based publishing workflow
Watch Mode1 minAuto-publish on file save

See also: Full API Reference