Skip to content

api-ghost/api-ghost

Repository files navigation

APIGHOST

image

Table of Contents

  1. Overview
  2. QuickStart
  3. Command List
  4. API List
  5. Relationship with other repositories in the organization
  6. How to Contribute
  7. License



Overview

API Ghost is a tool that allows you to easily create complex API integration tests and load tests with just drag and drop.

You can connect APIs in sequence on a web screen without writing code, or define test scenarios with simple YAML files.
You can test from local development to actual service environments in the same way, and check results with reports that you can see at a glance, greatly reducing test time for development and QA teams.



QucickStart

1. Install apighost with curl on the computer where you want to run tests

curl -fsSL https://github.com/api-ghost/api-ghost/releases/download/BETA-0.0.1/install.sh | sed 's/\r$//' | bash

2. Config file setup

If you installed Apighost with curl, a new folder will be installed at home\user\.apighost.
You need to create a configuration file named api-ghost.yaml inside that folder.

The configuration file should contain mainly

  • OpenAI service key
  • The URL of the service where your project you want to test is running.

apighost:
  tool:
    openAiKey: your-service-key
    libs:
      - https://yousinsa.duckdns.org/app1
      - https://yousinsa.duckdns.org/app2
      - https://yousinsa.duckdns.org/app3

3. Writing scenarios

apighost edit filename.yaml

You can create scenario YAML files in the console window through commands. (Currently not supported in ubuntu environment. In that environment, please write scenarios through GUI.) GUI mode installation and usage guide


4. Execute integration API test

apighost execute filename.yaml

scenariotest_capture

You can run integration API tests based on scenarios in the console window through commands.


5. Execute load test

apighost loadtest filename.yaml

apighost_cli_loadtest

You can run load tests based on the scenarios you wrote and load test settings through commands.



Command List

  • apighost ls: View list of scenario test files (YAML)

  • apighost ls result: View list of test results (JSON)

  • apighost cat filename.json: View test result contents

  • apighost ui: Enter GUI mode

  • apighsot execute filename.yaml : Execute scenario test

  • apighost ls loadtest : View load test YAML list

  • apighost loadtest filename.yaml : Execute load test

  • apighost rm filename.yaml : Delete files (scenario, load test, result files)



API List

Scenario

Method Endpoint Description
GET /apighost/scenario-list Retrieve list of scenario test files
GET /apighost/scenario-info Retrieve detailed information of a scenario test
GET /apighost/result-list Retrieve list of scenario test result files
GET /apighost/result-info Retrieve detailed information of a scenario test result
GET /apighost/endpoint-json Collect endpoint data
GET /apighost/scenario-test Execute scenario test and return results every 5 seconds
POST /apighost/generate-data Generate LLM-based body and parameter values

Loadtest

Method Endpoint Description
GET /apighost/loadtest-list Retrieve list of load test configuration files
POST /apighost/loadtest-export Create a load test configuration file
GET /apighost/loadtest-info Retrieve detailed info of a load test config
GET /apighost/loadtest-execute Execute load test and receive real-time results



Module Description

APIGHOST has adopted a multi-module structure.

cli: Implements commands to use apighost through terminal commands

core: Main functions of ApiGhost such as load tests, scenario tests, etc.

generator: Generate random parameter values using LLM

loadtest: Key functions related to load testing

model:Define Java model formats to use in scenario tests and load tests

parser: Conversion logic related to file input/output that has the same content but different formats

util: Functions commonly used in multiple modules, such as time initialization or finding user directory locations

web: Web-related modules using vanilla servlets for interaction with GUI

Some of the above modules are partially shared with ApiGhost Agent.

Contribution Guide

  • Please submit issues for bug reports or feature suggestions.
    Bug Issue

  • Follow the pull request and code review process.
    PR Issue



License

This project is licensed under the MIT License.

About

api-ghost cli tool

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors