← Catalog

pi-super-curl

HTTP request extension for pi shitty coding agent with auto-config, JWT generation, and named endpoints

Extension

Install

Install with PiG

pig install npm:pi-super-curl

Install with Pi

pi install npm:pi-super-curl
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Video

Declared by the package manifest. Open the file ↗

Pi manifest JSON

The pi field of package.json.

{
  "video": "https://raw.githubusercontent.com/Graffioh/pi-super-curl/main/demo.mp4",
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 1.1.3 (README.md). PiG does not review it.

pi-super-curl

A pi coding agent extension for API testing with an interactive TUI.

Two Modes

ModePurpose
DefaultSimple Postman client — manually fill URL, method, headers, body
TemplatePre-configured requests — just fill a few input fields

Press Ctrl+T to switch between modes.

Install

pi install npm:pi-super-curl

Quick Start

1. Create config file

Create .pi-super-curl/config.json in your project:

{
  "defaults": {
    "baseUrl": "$API_BASE_URL",
    "envFile": ".env",
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "templates": [
    {
      "name": "create-user",
      "description": "Create a new user",
      "url": "/api/users",
      "method": "POST",
      "auth": {
        "type": "bearer",
        "token": "$API_TOKEN"
      },
      "body": {
        "name": "",
        "email": ""
      },
      "fields": [
        { "name": "name", "label": "Name", "path": "name" },
        { "name": "email", "label": "Email", "path": "email" }
      ]
    }
  ]
}

2. Create .env file

API_BASE_URL=http://localhost:3000
API_TOKEN=your-token-here

3. Run /scurl

Commands

CommandDescription
/scurlOpen request builder
/scurl-historyBrowse and replay past requests
/scurl-logCapture logs after request (requires customLogging)

Keybindings

KeyAction
TabNavigate fields
↑↓Change selection / scroll
EnterSend request
Ctrl+TSwitch Default/Template mode
Ctrl+UImport from cURL command
EscCancel

Configuration

Structure Overview

{
  "defaults": { ... },      // Settings for Default mode (simple Postman)
  "templates": [ ... ],     // Pre-configured requests for Template mode
  "customLogging": { ... }  // Optional: log capture for debugging
}

defaults — Simple Postman Mode

Settings used when you manually build requests in Default mode:

{
  "defaults": {
    "baseUrl": "$API_BASE_URL",
    "timeout": 30000,
    "envFile": ".env",
    "headers": {
      "Content-Type": "application/json"
    },
    "auth": {
      "type": "bearer",
      "token": "$API_TOKEN"
    }
  }
}
FieldDescription
baseUrlPrepended to relative URLs
timeoutRequest timeout in ms (default: 30000)
envFilePath to .env file
headersDefault headers for all requests
authDefault authentication

templates — Pre-configured Requests

Each template is self-contained with its own URL, auth, headers, etc:

{
  "templates": [
    {
      "name": "get-user",
      "description": "Get user by ID",
      "baseUrl": "$API_BASE_URL",
      "url": "/api/users/{{env.USER_ID}}",
      "method": "GET",
      "auth": {
        "type": "bearer",
        "token": "$API_TOKEN"
      }
    },
    {
      "name": "create-post",
      "description": "Create a blog post",
      "url": "/api/posts",
      "method": "POST",
      "headers": {
        "X-Custom-Header": "value"
      },
      "body": {
        "title": "",
        "content": "",
        "author_id": "{{env.USER_ID}}"
      },
      "fields": [
        { "name": "title", "label": "Title", "path": "title" },
        { "name": "content", "label": "Content", "path": "content" }
      ]
    }
  ]
}
Template Fields
FieldDescription
nameTemplate identifier
descriptionShown in UI selector
baseUrlOptional, overrides defaults.baseUrl
urlEndpoint path (supports template variables)
methodHTTP method (GET, POST, PUT, PATCH, DELETE)
streamEnable SSE streaming
authTemplate-specific auth config
headersTemplate-specific headers
bodyRequest body template
fieldsUser input fields
appendFieldAuto-add "Additional Instructions" field
Input Fields

Define what users fill in:

{
  "fields": [
    {
      "name": "prompt",
      "label": "Your prompt",
      "path": "data.message",
      "hint": "→ data.message",
      "default": "Hello",
      "required": true
    }
  ]
}
FieldDescription
nameField identifier
labelDisplay label
pathJSON path where value is injected (e.g., data.message)
hintOptional hint shown in UI
defaultDefault value
requiredWhether field is required
sendToAgentIf true, value goes to pi agent instead of HTTP body

Authentication Types

// Bearer token
{ "auth": { "type": "bearer", "token": "$API_TOKEN" } }

// API key (custom header)
{ "auth": { "type": "api-key", "token": "$API_KEY", "header": "X-API-Key" } }

// Basic auth
{ "auth": { "type": "basic", "username": "$USER", "password": "$PASS" } }

// JWT (auto-generated per request)
{
  "auth": {
    "type": "jwt",
    "secret": "$JWT_SECRET",
    "algorithm": "HS256",
    "expiresIn": 3600,
    "payload": {
      "user_id": "{{env.USER_ID}}",
      "role": "authenticated"
    }
  }
}

Template Variables

Use anywhere in URLs, headers, body:

VariableDescription
{{uuid}}Random UUID v4
{{uuidv7}}Time-ordered UUID v7
{{timestamp}}Unix timestamp (seconds)
{{timestamp_ms}}Unix timestamp (ms)
{{date}}ISO date string
{{env.VAR}} or {{$VAR}}Environment variable

Note: Use $VAR syntax for top-level config fields (baseUrl, auth.token, auth.secret).
Use {{env.VAR}} syntax inside URLs, headers, body, and JWT payloads.

Custom Logging

Capture server logs after requests for debugging:

{
  "customLogging": {
    "enabled": true,
    "outputDir": "~/Desktop/api-logs",
    "logs": {
      "backend": "/tmp/server.log",
      "app": "logs/app.log"
    },
    "postScript": "process-logs.js"
  }
}

Run /scurl-log after a request to save timestamped logs.

Example: Full Config

{
  "defaults": {
    "baseUrl": "$API_BASE_URL",
    "envFile": ".env",
    "timeout": 30000,
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "templates": [
    {
      "name": "health-check",
      "description": "Check API health",
      "url": "/health",
      "method": "GET"
    },
    {
      "name": "login",
      "description": "Authenticate user",
      "url": "/api/auth/login",
      "method": "POST",
      "body": {
        "email": "",
        "password": ""
      },
      "fields": [
        { "name": "email", "label": "Email", "path": "email" },
        { "name": "password", "label": "Password", "path": "password" }
      ]
    },
    {
      "name": "create-item",
      "description": "Create new item",
      "url": "/api/items",
      "method": "POST",
      "auth": {
        "type": "bearer",
        "token": "$API_TOKEN"
      },
      "body": {
        "id": "{{uuidv7}}",
        "name": "",
        "created_at": "{{date}}"
      },
      "fields": [
        { "name": "name", "label": "Item name", "path": "name" }
      ]
    }
  ],
  "customLogging": {
    "enabled": true,
    "outputDir": "~/Desktop/api-logs",
    "logs": {
      "server": "/tmp/server.log"
    }
  }
}

License

MIT