Skip to main content
View as Markdown

Installing Keploy​

This guide walks you through installing the Keploy CLI, which enables you to record API calls and replay them as sandboxes for testing.

1. Install Keploy CLI​

Keploy captures your app's API calls and turns them into test cases and mocks/stubs. It runs natively on Linux, macOS and Windows (x86-64). Choose your OS to get started πŸš€


info

Make sure your Linux kernel version is 5.10 or higher.

πŸ‘‰ Choose your preferred method:


1. Install Keploy CLI​

source /dev/stdin <<<"$(curl -fsSL https://keploy.io/install.sh || echo 'echo Keploy installer download failed >&2; return 1')"

Prerequisites: bash, curl, and sha256sum (from coreutils, or shasum, required to verify downloads). gzip is recommended for ~64% smaller downloads; when gzip is absent, the installer falls back to the SHA-256-verified uncompressed binary. keploy update requires no external tools.

2. Once done, you should see something like this:​

🐰 Keploy: 2026-05-05T08:23:30.09586779Z        INFO    Starting Keploy {"version": "3.4.1", "buildSource": "unknown", "apiServerURL": "https://api.keploy.io", "inDocker": false}

β–“β–ˆβ–ˆβ–“β–„
β–“β–“β–“β–“β–ˆβ–ˆβ–“β–ˆβ–“β–„
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–’
β–€β–“β–“β–ˆβ–ˆβ–ˆβ–„ β–„β–„ β–„ β–Œ
β–„β–Œβ–Œβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆ β–“β–ˆβ–€ β–„β–Œβ–€β–„ β–“β–“β–Œβ–„ β–“β–ˆ β–„β–Œβ–“β–“β–Œβ–„ β–Œβ–Œ β–“
β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–“β–“ β–ˆβ–ˆβ–“β–ˆβ–„ β–“β–ˆβ–„β–“β–“ β–β–ˆβ–Œ β–ˆβ–ˆ β–“β–ˆ β–ˆβ–Œ β–ˆβ–ˆ β–ˆβ–Œ β–ˆβ–“
β–“β–“β–“β–“β–€β–€β–€β–€β–“β–“β–“β–“β–“β–“β–Œ β–ˆβ–ˆ β–ˆβ–“ β–“β–Œβ–„β–„ β–β–ˆβ–“β–„β–“β–ˆβ–€ β–ˆβ–“β–ˆ β–€β–ˆβ–„β–„β–ˆβ–€ β–ˆβ–“β–ˆ
β–“β–Œ β–β–ˆβ–Œ β–ˆβ–Œ
β–“

Keploy: 3.4.1

Keploy CLI

Usage:
keploy [command]

Available Commands:
agent starts keploy agent for hooking and starting proxy
cloud Manage cloud operations
config manage keploy configuration file
console manage keploy console file
contract Manage keploy contracts
create-branch Create a new branch on a Keploy app
create-test-suite Validate a test suite spec from JSON and insert it via api-server
debug Debug and reproduce Keploy failures locally
dedup manage keploy dedup file
diff compare two keploy test runs and print regressions/fixes
example Example to record and test via keploy
export export Keploy tests as postman collection
import import postman collection to Keploy tests
list-branches List branches on a Keploy app
login Authenticate with your Keploy account
logout Sign out of your Keploy account
mock Managing mocks
normalize Normalize Keploy
record record end to end api-calls
report report the keploy test results from the API calls
sanitize sanitize the keploy testcases to remove the sensitive data
templatize templatize the keploy testcases
test run the recorded testcases and execute assertions
test-gen AI agent-based API test generation β€” run, coverage, init
test-suite Run keploy test suites
test-suite-format Print the canonical test-suite step schema
ui Manage UI flow capture, testing, and reporting
update update keploy to latest version
update-test-suite Validate edits to a test suite and snapshot-replace it via api-server

Flags:
--config-path string Path to the local directory where keploy configuration file is stored (default ".")
--debug Run in debug mode
--disable-ansi Disable ANSI color in logs
-h, --help help for keploy
--json Print output in JSON format
--manual-login Use manual login prompt instead of opening browser
-v, --version version for keploy

Guided Commands:
help Help about any command

Examples:

Record:
keploy record -c "docker run -p 8080:8080 --name <containerName> --network keploy-network <applicationImage>" --container-name "<containerName>" --buildDelay 60

Test:
keploy test --c "docker run -p 8080:8080 --name <containerName> --network keploy-network <applicationImage>" --delay 10 --buildDelay 60

Config:
keploy config --generate -p "/path/to/localdir"


Use "keploy [command] --help" for more information about a command.

2. Log in to Keploy​

After installing, authenticate with your Keploy account. Choose the method that fits your setup:

Keploy uses OAuth device authorization (RFC 8628) and opens a browser window to approve the sign-in:

keploy login

If the browser cannot open automatically, Keploy prints a verification link and user code that you can open on any device:

To sign in to Keploy, open:

https://app.keploy.io/activate

and enter the code <USER_CODE>

Approve it only if you started this sign-in yourself. The code expires in <TIME_LEFT>.

Headless, remote, or AI-agent login (split flow)​

On a machine without a browser, or from an AI coding agent whose shell shows command output only after a command exits, split the sign-in into two steps:

# Print the verification link and user code and exit immediately
keploy login --no-wait

# After approving in the browser, collect the session (waits up to 70 seconds)
keploy login --finish
  • Add --json to both commands (keploy login --no-wait --json and keploy login --finish --json) to emit a single JSON NEXT block on stdout for agents and scripts.
  • Re-running keploy login --no-wait shows the still-waiting code again. Pass --new (keploy login --no-wait --new) to discard the waiting sign-in and start a new code.

Fresh sign-in for sensitive actions​

Some actions require a recent sign-in (such as creating API keys or service accounts, or changing members and roles). Pass --fresh to force a new browser sign-in even when you are already signed in:

keploy login --fresh

--fresh also works with --no-wait. It is refused while an API key is configured (KEPLOY_API_KEY or ~/.keploy/cred.yaml), because every Keploy command presents an API key before a browser session and an API key can never satisfy a recent-sign-in check. Unset KEPLOY_API_KEY or run keploy logout first.

Inspect your current login state​

Check which API key (last 4 characters only) and k8s-proxy URL Keploy will use here β€” and where each comes from (flag, environment variable, keploy.yml, or ~/.keploy) β€” without signing in:

keploy login --show

Now you can start using Keploy to record API calls and replay them as sandboxes for testing your application.

To explore what's available at each tier, visit keploy.io/pricing.

πŸŽ‰ Congratulations!​

You’ve successfully installed Keploy on Linux.

🎬 Start Capturing Test Cases


Record the test cases

keploy record -c "go run main.go"

Run the test cases

keploy test -c "go run main.go" --delay 10

πŸ“– What’s Next?

Now, take it further by following the Quickstart Guide and see Keploy in action with your app.