Skip to content

studiowebux/restcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST CLI

Keyboard-driven TUI for testing HTTP endpoints with Vim-style navigation.

Breaking Changes (V0.0.28)

Database Schema Update: The database schema has been updated to include profile_name across all tables (history, analytics, stress test). Existing databases from previous versions may encounter migration warnings. For a clean start, remove old database files from ~/.restcli/data/ before upgrading.

Why?

Manage API calls using directory and file structure instead of massive JSON files.

No more merge conflicts. No more outdated collections. Each endpoint is a file. Git-friendly. Team-friendly.

Features

Core

  1. File-based requests (.http, .yaml, .json, .jsonc, openapi) - one endpoint per file
  2. Variable substitution with {{varName}} and shell commands $(cmd)
  3. Multi-value variables with aliases (e.g., dev, staging, prod)
  4. Profile system for environment-specific headers and variables
  5. Request history with split view and live preview

Execution & Control

  1. Streaming support for SSE and real-time responses
  2. GraphQL & HTTP protocols with automatic detection
  3. Request cancellation (ESC to abort in-progress requests)
  4. Confirmation modals for critical endpoints
  5. Concurrent request blocking prevents accidental request

Security & Auth

  1. OAuth 2.0 with PKCE flow and token auto-extraction
  2. mTLS support with client certificates
  3. Variable interpolation in TLS paths for dynamic cert loading

Analysis & Debugging

  1. Inline filter editor with bookmark system - filter responses while viewing JSON structure
  2. Response filtering with JMESPath or bash commands
  3. Response pinning and diff for regression testing
  4. Error detail modals with full stack traces
  5. Embedded documentation viewer with collapsible trees
  6. Analytics tracking with per-endpoint stats and aggregated metrics
  7. Request history with persistent storage and search
  8. HTTP method color coding in file list for quick identification

Performance Testing

  1. Stress testing with configurable concurrency and load
  2. Ramp-up control for gradual load increase
  3. Real-time metrics (latency, RPS, percentiles P50/P95/P99)
  4. Test result persistence with historical comparison
  5. One-click re-run for saved test configurations

Automation

  1. CLI mode for scripting (JSON/YAML output)
  2. cURL converter (convert cURL to request files)
  3. OpenAPI converter (generate requests from specs)

Installation

Pre-built binaries

Download from releases or use the binary in bin/.

From source

git clone https://github.com/studiowebux/restcli
cd restcli/src
go build -o ../bin/restcli ./cmd/restcli
mv ../bin/restcli /usr/local/bin/

Quick Start

1. Create a request file

get-user.http:

### Get User
GET https://jsonplaceholder.typicode.com/users/1

2. Run in TUI mode

restcli

Navigate with j/k, press Enter to execute, ESC to cancel.

3. Or use CLI mode for automation

restcli run get-user.http
restcli run get-user.http --json  # Output as JSON

4. Add variables and profiles

### Get User
GET {{baseUrl}}/users/{{userId}}
Authorization: Bearer {{token}}

Create .profiles.json:

{
  "profiles": [
    {
      "name": "dev",
      "variables": {
        "baseUrl": "https://api.dev.example.com",
        "userId": "1"
      }
    }
  ]
}

Run with profile:

restcli -p dev

Analytics & Performance Testing

View Analytics

Press A in the TUI to view request analytics:

  • Per-endpoint statistics (count, avg/min/max latency, error rate)
  • Aggregated metrics across all requests
  • Historical tracking with timestamps
  • Grouped by file or normalized path

Run Stress Tests

Press S (Shift+s) to access stress testing:

  1. Create a new test - Press n to configure:

    • Request file and endpoint to test
    • Concurrent connections (workers)
    • Total requests to send
    • Ramp-up duration (gradual load increase)
    • Test duration limit
  2. Run the test - Ctrl+S to save config and start

    • Real-time progress with live metrics
    • Latency percentiles (P50, P95, P99)
    • Requests per second (RPS)
    • Success/error counts
  3. View results - Automatic on completion:

    • Historical test runs with comparison
    • Detailed statistics and metrics
    • Press r on any run to re-execute
    • Press l to load saved configurations

See docs/guides/stress-testing.md for detailed usage.

Key Shortcuts

Full reference: Press ? in-app or see docs/reference/keyboard-shortcuts.md

Documentation

Complete documentation at docs/

  1. Installation
  2. Quick Start
  3. TUI Mode
  4. CLI Mode
  5. File Formats
  6. Variables
  7. Profiles
  8. Authentication
  9. Filtering & Querying
  10. Analytics
  11. Stress Testing
  12. Examples

License

See LICENSE