hacs-cli


Namehacs-cli JSON
Version 0.4.3 PyPI version JSON
download
home_pageNone
SummaryCommand-line interface for Healthcare Agent Communication Standard (HACS)
upload_time2025-08-12 14:27:56
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseApache-2.0
keywords agents ai cli fhir healthcare
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HACS CLI

**Command-line interface for Healthcare Agent Communication Standard**

*Currently in development - use MCP server for full functionality*

## 🚧 **Development Status**

The HACS CLI is **under development**. Current healthcare operations are available through:

1. **MCP Server** - 42+ Hacs Tools via JSON-RPC
2. **Docker Compose** - Infrastructure deployment and configuration
3. **LangGraph Agent** - Interactive AI workflows via examples

## 🚀 **Current Functionality**

### **Deployment & Setup**
```bash
# Start infrastructure with Docker Compose
docker-compose up -d

# Manual MCP server startup
python -m hacs_utils.mcp.cli

# FastMCP server for streamable HTTP
python -m hacs_utils.mcp.fastmcp_server

# Environment configuration
export HACS_MCP_SERVER_URL=http://127.0.0.1:8000
export DATABASE_URL=postgresql://hacs:hacs_dev@localhost:5432/hacs
```

### **Service Management**
```bash
# Docker Compose operations
docker-compose up -d              # Start all services
docker-compose down               # Stop services
docker-compose logs hacs-mcp-server  # View logs

# Health checks
curl $HACS_MCP_SERVER_URL         # MCP server
curl http://localhost:8001/       # LangGraph agent (if running)
```

## 🛠️ **MCP Server Interface**

All healthcare operations use the **Model Context Protocol** server:

```bash
# List available Hacs Tools (42 tools)
curl -X POST -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}' \
  $HACS_MCP_SERVER_URL

# Create patient record
curl -X POST -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "create_resource",
      "arguments": {
        "resource_type": "Patient",
        "resource_data": {
          "full_name": "John Smith",
          "birth_date": "1980-05-15",
          "gender": "male"
        }
      }
    },
    "id": 1
  }' \
  $HACS_MCP_SERVER_URL
```

## 📋 **Planned CLI Features**

Future development will include:

- `hacs validate` - Resource validation
- `hacs convert` - Format conversion (HACS ↔ FHIR)
- `hacs memory` - Memory management commands
- `hacs evidence` - Evidence and knowledge operations
- `hacs auth` - Authentication and permissions
- `hacs export` - Data export utilities

## 🏥 **Healthcare Workflows**

Use Python requests for programmatic access:

```python
import requests

def use_hacs_tool(tool_name, arguments):
    """Call HACS tools"""
    import os
    server_url = os.getenv('HACS_MCP_SERVER_URL', 'http://127.0.0.1:8000')
    response = requests.post(server_url, json={
        "jsonrpc": "2.0",
        "method": "tools/call",
        "params": {
            "name": tool_name,
            "arguments": arguments
        },
        "id": 1
    })
    return response.json()

# Clinical memory management
memory_result = use_hacs_tool("create_memory", {
    "content": "Patient shows improvement after medication adjustment",
    "memory_type": "episodic",
    "importance_score": 0.8
})

# Search clinical memories
search_result = use_hacs_tool("search_memories", {
    "query": "medication response",
    "limit": 5
})
```

## ⚙️ **Configuration**

### **Environment Setup**
```bash
# Healthcare organization configuration
export HACS_ORGANIZATION="your_health_system"
export HEALTHCARE_SYSTEM_NAME="Your Health System"
export DATABASE_URL="postgresql://hacs:password@localhost:5432/hacs"

# LLM Provider (for AI operations)
export ANTHROPIC_API_KEY="sk-ant-..."  # Recommended for healthcare
export OPENAI_API_KEY="sk-..."         # Alternative
```

### **Virtual Environment**
```bash
# Activate HACS environment
source .venv/bin/activate

# Check environment status
which python
pip list | grep hacs
```

## 🔍 **Troubleshooting**

### **Common Issues**
```bash
# Check MCP server status
curl http://localhost:8000/

# View server logs
docker-compose logs hacs-mcp-server

# Restart services
docker-compose restart hacs-mcp-server
```

### **Health Checks**
```bash
# Complete system health check
echo "📡 MCP Server:"
curl -s http://localhost:8000/ && echo "✅ Running" || echo "❌ Not responding"

echo "🗄️ PostgreSQL:"
docker-compose exec postgres pg_isready -U hacs && echo "✅ Ready" || echo "❌ Not ready"
```

## 📊 **Current Tool Categories**

Available via MCP server:

- 🔍 **Resource Discovery & Development** (5 tools)
- 📋 **Record Management** (8 tools)
- 🧠 **Memory Management** (5 tools)
- ✅ **Validation & Schema** (3 tools)
- 🎨 **Advanced Tools** (3 tools)
- 📚 **Knowledge Management** (1 tool)

## 📄 **License**

Apache-2.0 License - see [LICENSE](../../LICENSE) for details.

---

**For immediate healthcare AI development, use the MCP server interface** - it provides complete access to all HACS functionality through a standardized protocol.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "hacs-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "Solano Todeschini <solanovisitor@gmail.com>",
    "keywords": "agents, ai, cli, fhir, healthcare",
    "author": null,
    "author_email": "Solano Todeschini <solanovisitor@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/3c/c8/8159df66beb3f3722ad80433eeca7b5f3dd93a16700d64a02eee77ae5ad2/hacs_cli-0.4.3.tar.gz",
    "platform": null,
    "description": "# HACS CLI\n\n**Command-line interface for Healthcare Agent Communication Standard**\n\n*Currently in development - use MCP server for full functionality*\n\n## \ud83d\udea7 **Development Status**\n\nThe HACS CLI is **under development**. Current healthcare operations are available through:\n\n1. **MCP Server** - 42+ Hacs Tools via JSON-RPC\n2. **Docker Compose** - Infrastructure deployment and configuration\n3. **LangGraph Agent** - Interactive AI workflows via examples\n\n## \ud83d\ude80 **Current Functionality**\n\n### **Deployment & Setup**\n```bash\n# Start infrastructure with Docker Compose\ndocker-compose up -d\n\n# Manual MCP server startup\npython -m hacs_utils.mcp.cli\n\n# FastMCP server for streamable HTTP\npython -m hacs_utils.mcp.fastmcp_server\n\n# Environment configuration\nexport HACS_MCP_SERVER_URL=http://127.0.0.1:8000\nexport DATABASE_URL=postgresql://hacs:hacs_dev@localhost:5432/hacs\n```\n\n### **Service Management**\n```bash\n# Docker Compose operations\ndocker-compose up -d              # Start all services\ndocker-compose down               # Stop services\ndocker-compose logs hacs-mcp-server  # View logs\n\n# Health checks\ncurl $HACS_MCP_SERVER_URL         # MCP server\ncurl http://localhost:8001/       # LangGraph agent (if running)\n```\n\n## \ud83d\udee0\ufe0f **MCP Server Interface**\n\nAll healthcare operations use the **Model Context Protocol** server:\n\n```bash\n# List available Hacs Tools (42 tools)\ncurl -X POST -H \"Content-Type: application/json\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"method\":\"tools/list\",\"id\":1}' \\\n  $HACS_MCP_SERVER_URL\n\n# Create patient record\ncurl -X POST -H \"Content-Type: application/json\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"create_resource\",\n      \"arguments\": {\n        \"resource_type\": \"Patient\",\n        \"resource_data\": {\n          \"full_name\": \"John Smith\",\n          \"birth_date\": \"1980-05-15\",\n          \"gender\": \"male\"\n        }\n      }\n    },\n    \"id\": 1\n  }' \\\n  $HACS_MCP_SERVER_URL\n```\n\n## \ud83d\udccb **Planned CLI Features**\n\nFuture development will include:\n\n- `hacs validate` - Resource validation\n- `hacs convert` - Format conversion (HACS \u2194 FHIR)\n- `hacs memory` - Memory management commands\n- `hacs evidence` - Evidence and knowledge operations\n- `hacs auth` - Authentication and permissions\n- `hacs export` - Data export utilities\n\n## \ud83c\udfe5 **Healthcare Workflows**\n\nUse Python requests for programmatic access:\n\n```python\nimport requests\n\ndef use_hacs_tool(tool_name, arguments):\n    \"\"\"Call HACS tools\"\"\"\n    import os\n    server_url = os.getenv('HACS_MCP_SERVER_URL', 'http://127.0.0.1:8000')\n    response = requests.post(server_url, json={\n        \"jsonrpc\": \"2.0\",\n        \"method\": \"tools/call\",\n        \"params\": {\n            \"name\": tool_name,\n            \"arguments\": arguments\n        },\n        \"id\": 1\n    })\n    return response.json()\n\n# Clinical memory management\nmemory_result = use_hacs_tool(\"create_memory\", {\n    \"content\": \"Patient shows improvement after medication adjustment\",\n    \"memory_type\": \"episodic\",\n    \"importance_score\": 0.8\n})\n\n# Search clinical memories\nsearch_result = use_hacs_tool(\"search_memories\", {\n    \"query\": \"medication response\",\n    \"limit\": 5\n})\n```\n\n## \u2699\ufe0f **Configuration**\n\n### **Environment Setup**\n```bash\n# Healthcare organization configuration\nexport HACS_ORGANIZATION=\"your_health_system\"\nexport HEALTHCARE_SYSTEM_NAME=\"Your Health System\"\nexport DATABASE_URL=\"postgresql://hacs:password@localhost:5432/hacs\"\n\n# LLM Provider (for AI operations)\nexport ANTHROPIC_API_KEY=\"sk-ant-...\"  # Recommended for healthcare\nexport OPENAI_API_KEY=\"sk-...\"         # Alternative\n```\n\n### **Virtual Environment**\n```bash\n# Activate HACS environment\nsource .venv/bin/activate\n\n# Check environment status\nwhich python\npip list | grep hacs\n```\n\n## \ud83d\udd0d **Troubleshooting**\n\n### **Common Issues**\n```bash\n# Check MCP server status\ncurl http://localhost:8000/\n\n# View server logs\ndocker-compose logs hacs-mcp-server\n\n# Restart services\ndocker-compose restart hacs-mcp-server\n```\n\n### **Health Checks**\n```bash\n# Complete system health check\necho \"\ud83d\udce1 MCP Server:\"\ncurl -s http://localhost:8000/ && echo \"\u2705 Running\" || echo \"\u274c Not responding\"\n\necho \"\ud83d\uddc4\ufe0f PostgreSQL:\"\ndocker-compose exec postgres pg_isready -U hacs && echo \"\u2705 Ready\" || echo \"\u274c Not ready\"\n```\n\n## \ud83d\udcca **Current Tool Categories**\n\nAvailable via MCP server:\n\n- \ud83d\udd0d **Resource Discovery & Development** (5 tools)\n- \ud83d\udccb **Record Management** (8 tools)\n- \ud83e\udde0 **Memory Management** (5 tools)\n- \u2705 **Validation & Schema** (3 tools)\n- \ud83c\udfa8 **Advanced Tools** (3 tools)\n- \ud83d\udcda **Knowledge Management** (1 tool)\n\n## \ud83d\udcc4 **License**\n\nApache-2.0 License - see [LICENSE](../../LICENSE) for details.\n\n---\n\n**For immediate healthcare AI development, use the MCP server interface** - it provides complete access to all HACS functionality through a standardized protocol.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Command-line interface for Healthcare Agent Communication Standard (HACS)",
    "version": "0.4.3",
    "project_urls": {
        "Changelog": "https://github.com/solanovisitor/hacs-ai/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/solanovisitor/hacs-ai/blob/main/docs/",
        "Homepage": "https://github.com/solanovisitor/hacs-ai",
        "Issues": "https://github.com/solanovisitor/hacs-ai/issues",
        "Repository": "https://github.com/solanovisitor/hacs-ai"
    },
    "split_keywords": [
        "agents",
        " ai",
        " cli",
        " fhir",
        " healthcare"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "014d232b008ee047535c867e93153bd4a0721b7e6ce254a7a7796b409e815ea6",
                "md5": "496dc4dcc17bd38eae68a1507c806799",
                "sha256": "7b2b781ef0bfc4ce33e5225e47f2e8cad14355e333fa7fb9f28d66e3636244ce"
            },
            "downloads": -1,
            "filename": "hacs_cli-0.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "496dc4dcc17bd38eae68a1507c806799",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 13454,
            "upload_time": "2025-08-12T14:27:45",
            "upload_time_iso_8601": "2025-08-12T14:27:45.844378Z",
            "url": "https://files.pythonhosted.org/packages/01/4d/232b008ee047535c867e93153bd4a0721b7e6ce254a7a7796b409e815ea6/hacs_cli-0.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3cc88159df66beb3f3722ad80433eeca7b5f3dd93a16700d64a02eee77ae5ad2",
                "md5": "ad7b5a8592485008c730c4f7611c55f9",
                "sha256": "4aff4239faeefd4fbb95afc6d336027755e426c379711d098f901ac30640837e"
            },
            "downloads": -1,
            "filename": "hacs_cli-0.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "ad7b5a8592485008c730c4f7611c55f9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 13304,
            "upload_time": "2025-08-12T14:27:56",
            "upload_time_iso_8601": "2025-08-12T14:27:56.139908Z",
            "url": "https://files.pythonhosted.org/packages/3c/c8/8159df66beb3f3722ad80433eeca7b5f3dd93a16700d64a02eee77ae5ad2/hacs_cli-0.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-12 14:27:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "solanovisitor",
    "github_project": "hacs-ai",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hacs-cli"
}
        
Elapsed time: 1.75604s