cli

command module
v0.0.0-...-8926f87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 40 Imported by: 0

README ยถ

๐Ÿฆ… Kest

The CLI-First API Testing Tool Built for Vibe Coding

curl is stateless. Postman is heavy. Kest remembers everything.

Built for developers who live in the terminal with AI copilots โ€” Cursor, Windsurf, Copilot, Cline.

Go Report Card PRs Welcome

Website | Quick Start | Why Kest? | Docs


๐Ÿš€ Quick Start

curl -fsSL https://kest.dev/install.sh | sh

For the latest released CLI, use the install script above. If you need the current repo source instead of the latest release:

git clone https://github.com/kest-labs/kest.git
cd kest/cli
go build -o ~/.local/bin/kest .
kest init                                                    # Initialize project
kest get /api/users -a "status==200"                         # Test an endpoint
kest post /api/login -d '{"user":"admin"}' -c "token=data.token"  # Capture token
kest get /api/profile -H "Authorization: Bearer {{token}}"   # Use it instantly

Every request is auto-recorded. Variables chain automatically. No copy-paste.


๐Ÿ”„ Sync To Kest Platform

Kest CLI can upload local API history back to the Kest Web Console. The recommended flow is:

  1. Open the project in the Web Console.
  2. Open the project detail page.
  3. In the CLI Sync card, click Generate CLI Token.
  4. Copy the one-line setup command or run:
kest sync config \
  --platform-url "https://api.kest.dev/v1" \
  --platform-token "kest_pat_..." \
  --project-id "12"

This writes platform_url, platform_token, and platform_project_id into .kest/config.yaml when run inside a Kest project.

You can verify the saved config:

kest config list

Preview the upload first:

kest sync push --dry-run

Then upload your local history-derived specs:

kest sync push

CLI uploads use a project-scoped token, not your OpenAI sk-... key.

What gets uploaded:

  • API method + path inferred from local history
  • summary / version / simple response schema stubs
  • sanitized examples derived from request history

What is redacted before storage:

  • Authorization, Cookie, X-API-Key and similar sensitive headers
  • common secret-shaped JSON fields such as password, token, secret, api_key, client_secret

โšก Why Kest?

Kest is designed for Vibe Coding โ€” the workflow where you and an AI copilot build together in the terminal.

Without Kest

  • curl forgets every response
  • Copy-paste tokens between requests
  • API broke? Manually re-test everything
  • Postman needs GUI + cloud account + $$$
  • Test files are 5000-line JSON blobs
  • Switch between IDE and Postman constantly

With Kest

  • Every request auto-recorded to local DB
  • Variables chain: -c "token=data.token" โ†’ {{token}}
  • kest replay last --diff โ€” instant regression check
  • 100% terminal, 100% local, 100% free
  • .flow.md โ€” Markdown that AI reads natively
  • Runs inline in Cursor/Windsurf terminal

The Vibe Coding loop: kest โ†’ AI sees output โ†’ AI suggests fix โ†’ kest replay โ†’ verified. All in one terminal.


๐Ÿง  AI-Powered

Kest uses your local request history as context for AI โ€” something no other tool can do.

kest why                           # AI diagnoses why your last request failed
kest suggest                       # AI suggests the next logical API call
kest explain 42                    # AI explains what record #42 does
kest review auth.flow.md           # AI audits your flow for security gaps
kest gen "test user registration"  # AI generates a complete .flow.md
kest config set ai_key sk-xxx      # Supports OpenAI, Azure, any compatible API
kest config set ai_model gpt-4o

๐Ÿ“ Markdown Flow โ€” Documentation IS Your Test Suite

Write tests as .flow.md files โ€” readable by humans, executable by Kest, reviewable in PRs.

```step
@id login
POST /api/login
Content-Type: application/json
{"user": "admin", "pass": "secret"}

[Captures]
token = data.token

[Asserts]
status == 200
```

```step
@id profile
GET /api/profile
Authorization: Bearer {{token}}

[Asserts]
status == 200
body.user == "admin"
```
$ kest run login.flow.md

  โ–ถ login POST /api/login
    โœ… 200 (142ms)

  โ–ถ profile GET /api/profile
    โœ… 200 (89ms)

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                 TEST SUMMARY                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โœ“ [POST] /api/login                  142ms โ”‚
โ”‚ โœ“ [GET]  /api/profile                  89ms โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Total: 2  โ”‚  Passed: 2  โ”‚  Time: 231ms โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿ”ฅ More Features

Mock Server โ€” zero config, from your history
kest mock --port 8080
# Serves recorded responses automatically
# GET  /api/users โ†’ 200    POST /api/login โ†’ 200
Snapshot Testing โ€” like Jest, but for APIs
kest snap /api/users              # Save snapshot
kest snap /api/users --verify     # โŒ 'role' field changed!
kest snap /api/users --update     # Accept new snapshot
Replay & Diff โ€” instant regression detection
kest replay last --diff
# - "role": "admin"
# + "role": "superadmin"  โ† changed!
File Watch โ€” TDD for APIs
kest watch login.flow.md
# [14:03:21] โœ… All 4 steps passed (1.2s)
# [14:03:35] ๐Ÿ“ File changed, re-running...
# [14:03:36] โœ… All 4 steps passed (0.9s)
gRPC + TLS
kest grpc localhost:50051 pkg.Service/Method -p app.proto -d '{}'
kest grpc api.example.com:443 pkg.Service/Method --tls --cert ca.pem
SSE / LLM Streaming
kest post /v1/chat/completions -d '{"stream":true, ...}' --stream

๐Ÿ† Comparison

Feature curl Postman Hurl Kest
Zero config โœ… โŒ โœ… โœ…
Auto history โŒ โŒ โŒ โœ…
Variable chaining โŒ โœ… โœ… โœ…
AI diagnosis โŒ โŒ โŒ โœ…
AI test generation โŒ โŒ โŒ โœ…
Mock server โŒ ๐Ÿ’ฐ โŒ โœ…
Snapshot testing โŒ ๐Ÿ’ฐ โŒ โœ…
File watch โŒ โŒ โŒ โœ…
Replay & diff โŒ โŒ โŒ โœ…
gRPC + TLS โŒ โŒ โŒ โœ…
Git-friendly tests โŒ โŒ โœ… โœ…
SSE streaming โŒ โŒ โŒ โœ…
CI/CD ready โŒ โŒ โœ… โœ…
100% local โœ… โŒ โœ… โœ…

๐Ÿ“– Command Reference

HTTP Requests
kest get /api/users                              # GET
kest post /api/users -d '{"name":"Alice"}'       # POST with JSON body
kest put /api/users/1 -d '{"name":"Bob"}'        # PUT
kest delete /api/users/1                         # DELETE
kest post /api/upload -d @file.json              # Body from file

# Flags
-H "Key: Value"       # Header
-q "key=value"        # Query param
-c "var=json.path"    # Capture variable
-a "status==200"      # Assertion
-v                    # Verbose (show headers)
--max-time 5000       # Timeout (ms)
--retry 3             # Retry count
--retry-delay 1000    # Retry delay (ms)
--stream              # SSE streaming
--var key=value       # Set variable
History & Replay
kest history                # Recent records
kest history -n 50          # Last 50
kest show last              # Full request/response details
kest show 42                # Specific record
kest diff 100 last          # Compare two records
kest replay last --diff     # Re-execute and compare
Testing & Automation
kest run login.flow.md                  # Run flow file
kest run login.flow.md --var key=val    # With variables
kest run tests/ --parallel --jobs 8     # Parallel execution
kest watch login.flow.md                # Auto-rerun on change
kest snap /api/users                    # Save snapshot
kest snap /api/users --verify           # Verify against snapshot
kest mock --port 8080                   # Mock server from history
Configuration
kest init                   # Initialize project
kest config set ai_key sk-xxx
kest config set ai_model gpt-4o
kest env set staging        # Switch environment
kest vars                   # List captured variables
kest completion zsh         # Shell completion

๐Ÿ— Architecture

Terminal                              Local Storage
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ kest get /users  โ”‚โ”€โ”€auto-recordโ”€โ”€โ†’โ”‚ SQLite DB     โ”‚
โ”‚ kest post /login โ”‚โ”€โ”€capture varโ”€โ”€โ†’โ”‚ Variables     โ”‚
โ”‚ kest run flow.md โ”‚โ”€โ”€assertionsโ”€โ”€โ†’ โ”‚ History       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                            โ”‚
                                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                   โ”‚ AI Engine        โ”‚
                                   โ”‚ why ยท suggest    โ”‚
                                   โ”‚ explain ยท review โ”‚
                                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

100% local. No cloud. No account. No telemetry. Your data never leaves your machine.


๐Ÿค Contributing

git clone https://github.com/kest-labs/kest.git
cd kest/cli
go build -o kest .
go test ./...

See VISION.md for project philosophy. PRs welcome!


Keep Every Step Tested. ๐Ÿฆ…

Website ยท GitHub ยท Report Bug

If Kest saves you time, consider giving it a โญ

MIT License โ€” See LICENSE

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis
internal
ai

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL