apicrafter-cli


Nameapicrafter-cli JSON
Version 0.1.7 PyPI version JSON
download
home_pageNone
SummaryA terminal-first, interactive API client that brings Postman-like features into the CLI
upload_time2025-09-05 12:04:16
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords api http client cli postman rest
VCS
bugtrack_url
requirements typer httpx rich questionary pydantic pyyaml click
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # apicrafter

A terminal-first, interactive API client that brings Postman-like features into the CLI. Built with modern Python tooling and designed for developers who prefer the command line.

## โœจ Features

- ๐ŸŒ **Full HTTP Support** - GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
- ๐Ÿ“ **Multiple Request Formats** - JSON, Form data, Raw text, Custom headers
- ๐ŸŽจ **Beautiful Output** - Syntax highlighting for JSON, XML, HTML responses
- ๐Ÿ’พ **Collections** - Save and organize your API requests
- ๐ŸŒ **Environments** - Manage dev/staging/prod configurations with variables
- ๐Ÿ”„ **Variable Substitution** - Use `{{VARIABLE}}` syntax for dynamic values
- ๐Ÿ“š **Request History** - Track all requests with timestamps and response times
- ๐Ÿงช **Basic Testing** - Assertions for status codes, response content, and more
- ๐ŸŽฏ **Interactive Mode** - Firebase CLI-style menus and prompts
- โšก **High Performance** - Built on httpx for fast, async-capable requests

## ๐Ÿš€ Quick Start

### Installation

```bash
pip install apicrafter-cli
```

### Basic Usage

```bash
# Send a simple GET request
apicrafter send GET https://jsonplaceholder.typicode.com/posts/1

# Send a POST request with JSON data
apicrafter send POST https://httpbin.org/post \
  --header "Content-Type: application/json" \
  --data '{"title": "Hello", "body": "World"}'

# Interactive mode for guided request building
apicrafter interactive
```

## ๐Ÿ“– Core Commands

### Send Requests

```bash
# Basic request
apicrafter send GET https://api.example.com/users

# With headers
apicrafter send POST https://api.example.com/users \
  --header "Authorization: Bearer token123" \
  --header "Content-Type: application/json"

# With JSON data
apicrafter send POST https://api.example.com/users \
  --data '{"name": "John", "email": "john@example.com"}'

# With form data
apicrafter send POST https://api.example.com/login \
  --form username=john \
  --form password=secret

# With query parameters
apicrafter send GET https://api.example.com/users \
  --param page=1 \
  --param limit=10
```

### Collections Management

```bash
# Save a request to a collection
apicrafter save get-users \
  --method GET \
  --url "https://api.example.com/users" \
  --header "Authorization: Bearer {{TOKEN}}"

# Run a saved request
apicrafter run get-users

# List all collections
apicrafter collections
```

### Environment Management

```bash
# Set environment variables
apicrafter env-set dev BASE_URL https://dev-api.example.com
apicrafter env-set dev TOKEN dev_token_123

# Run request with specific environment
apicrafter run get-users --env dev
```

### Request History

```bash
# View request history
apicrafter history

# Replay a request from history
apicrafter replay 1
```

### Testing

```bash
# Test a request with assertions
apicrafter test GET https://api.example.com/health \
  --assert-status 200 \
  --assert-json "status:healthy"
```

## ๐Ÿ”ง Configuration

apicrafter stores its configuration in `~/.apicrafter/`:

```
~/.apicrafter/
โ”œโ”€โ”€ collections.yaml    # Saved requests and collections
โ”œโ”€โ”€ envs.yaml          # Environment variables
โ””โ”€โ”€ history.log        # Request history
```

### Environment Variables

Use the `{{VARIABLE}}` syntax in your requests for dynamic values:

```yaml
# In collections.yaml
- name: get-user
  method: GET
  url: "{{BASE_URL}}/users/{{USER_ID}}"
  headers:
    Authorization: "Bearer {{TOKEN}}"
```

## ๐Ÿ“š Documentation

For more detailed documentation, visit the [GitHub repository](https://github.com/yash-vrdhan/apicrafter).

## ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## ๐Ÿ“ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- [httpx](https://github.com/encode/httpx) - Modern HTTP client
- [typer](https://github.com/tiangolo/typer) - CLI framework
- [rich](https://github.com/Textualize/rich) - Beautiful terminal output
- [questionary](https://github.com/tmbo/questionary) - Interactive prompts
- [pydantic](https://github.com/pydantic/pydantic) - Data validation

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "apicrafter-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Yash Singh <yashs3326@gmail.com>",
    "keywords": "api, http, client, cli, postman, rest",
    "author": null,
    "author_email": "Yash Singh <yashs3326@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/38/02/963162e6c88dbf69465cfd1306895b57a71e5891be7c428b2c5bc344e767/apicrafter_cli-0.1.7.tar.gz",
    "platform": null,
    "description": "# apicrafter\n\nA terminal-first, interactive API client that brings Postman-like features into the CLI. Built with modern Python tooling and designed for developers who prefer the command line.\n\n## \u2728 Features\n\n- \ud83c\udf10 **Full HTTP Support** - GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS\n- \ud83d\udcdd **Multiple Request Formats** - JSON, Form data, Raw text, Custom headers\n- \ud83c\udfa8 **Beautiful Output** - Syntax highlighting for JSON, XML, HTML responses\n- \ud83d\udcbe **Collections** - Save and organize your API requests\n- \ud83c\udf0d **Environments** - Manage dev/staging/prod configurations with variables\n- \ud83d\udd04 **Variable Substitution** - Use `{{VARIABLE}}` syntax for dynamic values\n- \ud83d\udcda **Request History** - Track all requests with timestamps and response times\n- \ud83e\uddea **Basic Testing** - Assertions for status codes, response content, and more\n- \ud83c\udfaf **Interactive Mode** - Firebase CLI-style menus and prompts\n- \u26a1 **High Performance** - Built on httpx for fast, async-capable requests\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\npip install apicrafter-cli\n```\n\n### Basic Usage\n\n```bash\n# Send a simple GET request\napicrafter send GET https://jsonplaceholder.typicode.com/posts/1\n\n# Send a POST request with JSON data\napicrafter send POST https://httpbin.org/post \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\"title\": \"Hello\", \"body\": \"World\"}'\n\n# Interactive mode for guided request building\napicrafter interactive\n```\n\n## \ud83d\udcd6 Core Commands\n\n### Send Requests\n\n```bash\n# Basic request\napicrafter send GET https://api.example.com/users\n\n# With headers\napicrafter send POST https://api.example.com/users \\\n  --header \"Authorization: Bearer token123\" \\\n  --header \"Content-Type: application/json\"\n\n# With JSON data\napicrafter send POST https://api.example.com/users \\\n  --data '{\"name\": \"John\", \"email\": \"john@example.com\"}'\n\n# With form data\napicrafter send POST https://api.example.com/login \\\n  --form username=john \\\n  --form password=secret\n\n# With query parameters\napicrafter send GET https://api.example.com/users \\\n  --param page=1 \\\n  --param limit=10\n```\n\n### Collections Management\n\n```bash\n# Save a request to a collection\napicrafter save get-users \\\n  --method GET \\\n  --url \"https://api.example.com/users\" \\\n  --header \"Authorization: Bearer {{TOKEN}}\"\n\n# Run a saved request\napicrafter run get-users\n\n# List all collections\napicrafter collections\n```\n\n### Environment Management\n\n```bash\n# Set environment variables\napicrafter env-set dev BASE_URL https://dev-api.example.com\napicrafter env-set dev TOKEN dev_token_123\n\n# Run request with specific environment\napicrafter run get-users --env dev\n```\n\n### Request History\n\n```bash\n# View request history\napicrafter history\n\n# Replay a request from history\napicrafter replay 1\n```\n\n### Testing\n\n```bash\n# Test a request with assertions\napicrafter test GET https://api.example.com/health \\\n  --assert-status 200 \\\n  --assert-json \"status:healthy\"\n```\n\n## \ud83d\udd27 Configuration\n\napicrafter stores its configuration in `~/.apicrafter/`:\n\n```\n~/.apicrafter/\n\u251c\u2500\u2500 collections.yaml    # Saved requests and collections\n\u251c\u2500\u2500 envs.yaml          # Environment variables\n\u2514\u2500\u2500 history.log        # Request history\n```\n\n### Environment Variables\n\nUse the `{{VARIABLE}}` syntax in your requests for dynamic values:\n\n```yaml\n# In collections.yaml\n- name: get-user\n  method: GET\n  url: \"{{BASE_URL}}/users/{{USER_ID}}\"\n  headers:\n    Authorization: \"Bearer {{TOKEN}}\"\n```\n\n## \ud83d\udcda Documentation\n\nFor more detailed documentation, visit the [GitHub repository](https://github.com/yash-vrdhan/apicrafter).\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## \ud83d\udcdd License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- [httpx](https://github.com/encode/httpx) - Modern HTTP client\n- [typer](https://github.com/tiangolo/typer) - CLI framework\n- [rich](https://github.com/Textualize/rich) - Beautiful terminal output\n- [questionary](https://github.com/tmbo/questionary) - Interactive prompts\n- [pydantic](https://github.com/pydantic/pydantic) - Data validation\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A terminal-first, interactive API client that brings Postman-like features into the CLI",
    "version": "0.1.7",
    "project_urls": {
        "Bug Tracker": "https://github.com/yash-vrdhan/apicrafter/issues",
        "Documentation": "https://github.com/yash-vrdhan/apicrafter#readme",
        "Homepage": "https://github.com/yash-vrdhan/apicrafter",
        "Repository": "https://github.com/yash-vrdhan/apicrafter"
    },
    "split_keywords": [
        "api",
        " http",
        " client",
        " cli",
        " postman",
        " rest"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "efcf6db73d84c158e846bedfa527b691bbe695493bfb91e9807fdc8139623569",
                "md5": "d58a970b9e49ea3787712ee582fd8e21",
                "sha256": "53738081c84ccbf75d957ad3cbe670d329350696f555e5cd24768982f846a931"
            },
            "downloads": -1,
            "filename": "apicrafter_cli-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d58a970b9e49ea3787712ee582fd8e21",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 49793,
            "upload_time": "2025-09-05T12:04:15",
            "upload_time_iso_8601": "2025-09-05T12:04:15.557124Z",
            "url": "https://files.pythonhosted.org/packages/ef/cf/6db73d84c158e846bedfa527b691bbe695493bfb91e9807fdc8139623569/apicrafter_cli-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3802963162e6c88dbf69465cfd1306895b57a71e5891be7c428b2c5bc344e767",
                "md5": "cda100598bc0d857c97aeb429a9dc365",
                "sha256": "1fc8e319be4a329110bf08f9c2ffb4903947d693cea7b077b4895b49dd1429f4"
            },
            "downloads": -1,
            "filename": "apicrafter_cli-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "cda100598bc0d857c97aeb429a9dc365",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 45170,
            "upload_time": "2025-09-05T12:04:16",
            "upload_time_iso_8601": "2025-09-05T12:04:16.847795Z",
            "url": "https://files.pythonhosted.org/packages/38/02/963162e6c88dbf69465cfd1306895b57a71e5891be7c428b2c5bc344e767/apicrafter_cli-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-05 12:04:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yash-vrdhan",
    "github_project": "apicrafter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "typer",
            "specs": [
                [
                    ">=",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "httpx",
            "specs": [
                [
                    ">=",
                    "0.24.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    ">=",
                    "13.0.0"
                ]
            ]
        },
        {
            "name": "questionary",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    ">=",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    ">=",
                    "8.0.0"
                ]
            ]
        }
    ],
    "lcname": "apicrafter-cli"
}
        
Elapsed time: 2.63113s