1 unstable release
| 0.2.0 | Jul 20, 2025 |
|---|
#299 in HTTP client
155KB
3K
SLoC
blueline
A lightweight, profile-based HTTP client with REPL interface.
Overview
Blueline is a modern command-line HTTP client featuring:
- REPL Interface: Interactive Read-Eval-Print Loop with vi-style navigation
- Profile-based Configuration: Store and reuse connection settings, headers, and authentication
- Security-first Design: REPL-only mode prevents piped input vulnerabilities
- Split-pane UI: Request editing and response viewing in separate panes
- JSON Support: Automatic JSON formatting and syntax highlighting
- Verbose Mode: Detailed connection and request/response information
Installation
From Source
git clone https://github.com/samwisely75/blueline
cd blueline
cargo build --release
From Package Managers
Note: Package manager releases coming soon
Quick Start
Basic Usage
# Start blueline with default profile
blueline
# Start with specific profile
blueline -p staging
# Start with verbose output
blueline -v
Profile Configuration
Create ~/.blueline/profile with your API configurations:
[default]
host = https://api.example.com
@content-type = application/json
@accept = application/json
[staging]
host = https://staging-api.example.com
@authorization = Bearer your-token-here
user = username
password = secret
[local]
host = http://localhost:8080
@content-type = application/json
insecure = true
REPL Commands
Once in the REPL interface:
- Navigation: Use vi-style keys (
h,j,k,l) to move around - Insert Mode: Press
ito enter insert mode for editing - Normal Mode: Press
Escto return to normal mode - Execute Request: Press
Enterto send the HTTP request - Quit: Press
:qorCtrl+Cto exit
Command Line Options
blueline [OPTIONS]
Options:
-p, --profile <PROFILE> Use specified profile from ~/.blueline/profile [default: default]
-v, --verbose Enable verbose output showing connection details
-h, --help Print help information
-V, --version Print version information
Profile Configuration Reference
Connection Settings
host- Base URL for API endpoints (required)insecure- Skip TLS certificate verification (true/false)ca_cert- Path to custom CA certificate fileproxy- HTTP/HTTPS proxy URL
Authentication
user- Username for Basic Authenticationpassword- Password for Basic Authentication
Headers
Prefix header names with @:
@authorization- Authorization header@content-type- Content-Type header@accept- Accept header@user-agent- User-Agent header
Example Profile
[production]
host = https://api.production.com
@authorization = Bearer prod-token-here
@content-type = application/json
@accept = application/json
user = api-user
password = secure-password
ca_cert = /etc/ssl/certs/production-ca.pem
proxy = http://corporate-proxy:8080
insecure = false
REPL Interface
Split-Pane Layout
┌─────────────────────────────────┐
│ Request Pane │
│ │
│ Method: GET │
│ Path: /api/users │
│ Body: {"name": "John"} │
│ │
├─────────────────────────────────┤
│ Response Pane │
│ │
│ Status: 200 OK │
│ { │
│ "users": [...] │
│ } │
└─────────────────────────────────┘
Vi-Style Navigation
h- Move cursor leftj- Move cursor downk- Move cursor upl- Move cursor rightw- Move to next wordb- Move to previous word0- Move to beginning of line$- Move to end of line
Editing Commands
i- Enter insert mode at cursora- Enter insert mode after cursoro- Insert new line below and enter insert modex- Delete character under cursordd- Delete current lineu- Undo last change
Verbose Mode
When using -v flag, blueline displays detailed information:
Connection Details
> connection:
> host: https://api.example.com
> port: 443
> scheme: https
> ca-cert: <none>
> insecure: false
> headers:
> content-type: application/json
> authorization: Bearer token
> proxy: <none>
Request Information
> request:
> method: POST
> path: /api/users
> body: {"name": "John", "email": "john@example.com"}
Response Details
> response:
> status: 201 Created
> headers:
> content-type: application/json
> location: /api/users/123
Security Features
- No piped input: Prevents injection attacks through stdin
- Profile isolation: Credentials stored separately from commands
- TLS verification: Certificate validation enabled by default
- Secure defaults: Conservative configuration options
Architecture
Blueline uses the bluenote HTTP client library for profile-based HTTP requests. The bluenote library provides reusable HTTP client functionality with configuration management that can be used independently in other Rust projects.
Development
Building
# Build entire workspace
cargo build
# Build specific crate (now just blueline)
cargo build --package blueline
# Run tests
cargo test
Project Structure
blueline/
├── blueline/ # REPL application crate
│ ├── src/
│ │ ├── main.rs # Application entry point
│ │ ├── cmd.rs # Command line parsing
│ │ └── repl.rs # REPL interface
│ └── tests/ # Integration tests
└── Cargo.toml # Workspace configuration
License
Licensed under the Elastic License 2.0. See LICENSE file for details.
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
Related Projects
- httpc: Command-line HTTP client (predecessor)
- curl: Classic HTTP client tool
- httpie: Modern HTTP client
- postman: GUI API testing tool
Dependencies
~26–47MB
~771K SLoC