Metadata-Version: 2.4
Name: dob-cli
Version: 1.0.3
Summary: DOB CLI for remote command execution with persona-based authentication.
Author: Mohamed Sesay
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: requests==2.28.2
Requires-Dist: cryptography==39.0.0
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 🚀 DOB CLI – Secure Remote Command Execution with Persona Authentication

The **DOB CLI** (`dob`) is a secure and extensible command-line interface for executing remote tasks on your infrastructure via signed persona tokens. It supports authenticated command forwarding and secure screenplay execution through configuration files.

---

## ✨ Features

- 🔐 **Persona-Based Authentication** – Execute remote commands using cryptographically signed tokens.
- 📁 **Screenplay File Execution** – Send `.yaml` config files for infrastructure automation.
- 🌐 **Remote Host Execution** – Forward commands from any environment to a central host.
- ⚙️ **Simple Configuration** – Configure once with `dob config`, then just run.

---

## 📦 Installation

### ✅ From PyPI (Recommended)

Install using pip:

```bash
pip install dob-cli
```

> Requires Python 3.6+

---

## 🔧 Configuration

Before executing any commands, configure your persona and host using:

```bash
dob config --persona-name <name> \
           --token <persona_token> \
           --private-key-path <path_to_private.pem> \
           --host-endpoint <http://host>
```

This creates a config file at:

```
~/.dobconfig.json
```

Example:

```bash
dob config \
  --persona-name alice_dev \
  --token 1234-abcd-token \
  --private-key-path ~/.ssh/alice_private.pem \
  --host-endpoint http://dob-819914.user.devops-bot.online/persona/api
```

---

## 🚀 Usage

### 1. Run a remote command

```bash
dob vault show
```

This will forward: `dob vault show` to your remote host via secure signed request.

---

### 2. Run a command with screenplay file

```bash
dob aws screenplay --file-path ec2.yaml
```

If `--file-path` is included, the file content will be read and sent inline.

---

## 🧪 Example

```bash
dob persona create \
  --name frontend \
  --role deploy \
  --namespace staging
```

or

```bash
dob aws screenplay --file-path ./infra/ec2.yaml
```

---

## 🛠 How It Works

1. `dob config` saves credentials + host endpoint to `~/.dobconfig.json`.
2. `dob` signs your token with the private key.
3. Command and file content (if any) are sent to the host via HTTP POST.
4. Host authenticates, executes, and returns output.

---

## ❓ Troubleshooting

- **Config file not found**  
  Run `dob config` first to generate `~/.dobconfig.json`.

- **Auth failed?**  
  Ensure token and private key match and host is reachable.

- **File not sent?**  
  Use `--file-path` with absolute or valid relative path.

---

## 💡 Development

Clone the repo and install in editable mode:

```bash
git clone https://github.com/Devops-Bot-Official/dob-cli.git
cd dob-cli
pip install -e .
```

---

## 📄 License

MIT License © 2025 Dee Empire GmbH / DevOps-Bot
