Metadata-Version: 2.4
Name: akashcli
Version: 4.8.4
Summary: Akash CLI — secure remote shell relay, file vault, and device management
License-Expression: MIT
Keywords: akash,cli,relay,remote-shell,vault
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx
Requires-Dist: certifi
Requires-Dist: typer
Requires-Dist: cryptography
Requires-Dist: pydantic
Requires-Dist: websockets

<div align="center">

# ⚡ Akash CLI (`akash`)
### Encrypted Cloud Vault · Remote Terminal Relay · AI Agent Tool Bridge

[![Python Version](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://python.org)
[![Security](https://img.shields.io/badge/encryption-AES--256--GCM%20%7C%20X25519-green.svg)](https://cryptography.io)
[![Protocol](https://img.shields.io/badge/MCP-Model%20Context%20Protocol-orange.svg)](https://modelcontextprotocol.io)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

*The developer-first CLI for instant environment backups, zero-setup remote terminals, encrypted peer-to-peer file transfers, and safe AI agent execution.*

---

[📖 Easy Master Guide](GUIDE.md) •
[Quickstart](#-quickstart-in-60-seconds) •
[Core Features](#-core-features) •
[Zero-Login Guest Mode](#-zero-login-guest-mode) •
[Documentation](#-in-depth-documentation-guides) •
[Command Matrix](#-command-matrix)

---

</div>

## 🌟 Why Akash CLI?

Modern developer workflows demand flexibility across multiple machines — laptops, cloud servers, and mobile environments like Android Termux. Akash CLI solves daily pain points with a unified, secure toolkit:

* 🖥️ **Remote Shell Anywhere**: Connect to any remote device or share an interactive terminal session in seconds across firewalls and NATs.
* 💾 **Instant Environment Snapshots**: Backup dotfiles, shell configs, and package inventories with automated secret scrubbing and 1-click restore.
* ☁️ **Encrypted Cloud Vault**: Store files, stream video directly into VLC, and pipe shell outputs without writing to disk.
* 🔐 **P2P Zero-Knowledge Transfers**: Send end-to-end encrypted files to other users using X25519 ECDH — even the storage server cannot inspect them.
* 🔒 **Hardware-Bound .env Store**: Manage local and cloud-synced environment variables encrypted with machine-specific seeds.
* 🤖 **AI Agent Gateway (MCP)**: Safely expose local tools to Cursor IDE and Claude Desktop with real-time terminal approval guards and auto-undo checkpoints.

---

## 🚀 Quickstart in 60 Seconds

### 1. Installation
```bash
# Clone and install in editable mode:
git clone https://github.com/juniorsir/akashcli.git
cd akashcli
pip install -e . --break-system-packages
```

### 2. Connect Your Machine
Obtain an API key from the [Akash Telegram Bot](https://t.me/EveryDL_bot) (go to **👤 My Account** ➔ **🔑 Generate API Key**), then run:
```bash
akash login --label "laptop"
```
*(Alternatively, explore without logging in using [Guest Mode](#-zero-login-guest-mode)!)*

### 3. Check Account Status
```bash
akash whoami
```

---

## 🤝 Zero-Login Guest Mode

Need to pair two machines instantly without an account or API key?

```bash
# On Machine A (Host):
akash serve --share
# ➔ Generates pairing code: A3F7B2

# On Machine B (Client):
akash shell --code A3F7B2
# ➔ Instantly connected to Host's interactive terminal!
```

---

## ⚡ Core Features

### 1. 💾 Environment Backups & Disaster Recovery
Capture your entire shell setup and restore it on any machine in seconds:
```bash
# Save your terminal configuration to cloud (or local file with -o):
akash backup --label "workstation"

# Restore on a new computer (zero login required):
akash pull 8k9F2a

# Restore from cloud code or local archive:
akash restore 8k9F2a
akash restore ~/my_backup.tar.gz

# Preview what will be extracted before touching disk:
akash restore 8k9F2a --dry-run
akash restore 8k9F2a --tree
```
* **Auto Secret Scrubbing**: Redacts tokens, passwords, and private keys from history files.
* **Bloat Pruning**: Skips `node_modules`, `__pycache__`, and `.venv`.
* **Package Manifests**: Inventories `apt`, `brew`, `pip`, `npm`, `cargo` for auto-reinstallation.

### 2. 🖥️ Remote Shells & Persistent Devices
Manage your fleet of servers and workstations:
```bash
# Run listener on your phone or remote server:
akash serve --daemon --label termux

# Open interactive shell from your laptop:
akash shell --device termux

# Run individual command remotely:
akash run "uptime" --device termux
```

### 3. ☁️ Cloud File Vault & Streaming
```bash
# Upload a file with 7-day auto-expiry:
akash cloud upload my_doc.pdf --expiry 7

# One-time burn-after-read:
akash cloud upload --burn secret_report.pdf

# Stream video directly into VLC without downloading:
akash cloud stream 7xY3a0 --vlc

# Pipe command output directly into the cloud vault:
mysqldump -u root db | akash pipe -n "db_backup.sql"
```

### 4. 🔐 P2P Encrypted File Transfers
Zero-knowledge file exchange using Curve25519 / X25519:
```bash
# View your public key and fingerprint:
akash id

# Send encrypted file to a contact:
akash send bob sensitive_dataset.zip -m "Q3 dataset"

# Recipient receives and decrypts:
akash inbox
akash inbox 7qR92x
```

### 5. 🔒 Hardware-Encrypted .env Store
```bash
# Set secrets into encrypted store:
akash env set prod DATABASE_URL="postgresql://user:pass@host/db"

# Retrieve secret for automation:
akash env get prod DATABASE_URL --raw

# Push encrypted secrets to cloud vault with burn-on-read:
akash env push prod --burn

# Pull secrets onto remote server:
akash env pull eX481p prod
```

### 6. 🤖 AI Agent Gateway (MCP) & Guard Console
Supercharge Cursor and Claude Desktop with local terminal execution, protected by real-time human approval:
```bash
# 1. Create agent profile with safe role preset:
akash agent create --name "Cursor" --role @coder

# 2. Generate configuration snippet for Cursor / Claude Desktop:
akash mcp share --claude --temp 30m

# 3. Start local tool execution worker with auto-undo checkpoints:
akash mcp serve

# 4. In a separate terminal, open live approval console:
akash guard
```

---

## 📚 In-Depth Documentation Guides

Explore comprehensive guides in the [`docs/`](docs/) directory:

| Document | Topic Covered |
| :--- | :--- |
| **[01. Quickstart & Installation](docs/01-quickstart-and-install.md)** | Setup on Linux, macOS, Windows, Android Termux / PRoot, and troubleshooting |
| **[02. Remote Terminal & Relays](docs/02-remote-terminal-and-relays.md)** | WebSocket relay, 1-click guest pairing, background daemons, remote execution |
| **[03. Environment Backups](docs/03-backup-and-disaster-recovery.md)** | Dotfile snapshots, secret scrubbing, visual tree explorer, package recovery |
| **[04. Cloud Vault & Streaming](docs/04-cloud-vault-and-streaming.md)** | Uploads, burn-after-read, direct VLC streaming, Unix pipe streaming |
| **[05. P2P Encrypted Transfers](docs/05-p2p-encrypted-transfers.md)** | X25519 ECDH asymmetric encryption, zero-knowledge storage, inbox management |
| **[06. Secrets & .env Vault](docs/06-env-and-secrets-vault.md)** | Local encrypted store, .env file import/export, cloud push/pull sync |
| **[07. AI Agents & MCP](docs/07-ai-agents-and-mcp.md)** | Model Context Protocol, Claude/Cursor integration, terminal guard approvals |
| **[08. Security & Integrity Audit](docs/08-security-integrity-audit.md)** | Hardware machine keys, SHA-256 HMAC code integrity sealing, audit logs |
| **[09. Full Command Reference](docs/09-full-command-reference.md)** | Exhaustive command cheat-sheet with every argument, flag, and option |

---

## 📊 Command Matrix

```text
akash
 ├── login           Connect API key with hardware binding
 ├── whoami          Account quota & device fingerprint
 ├── backup          Save terminal environment to cloud or local archive
 ├── restore         Restore environment (with --tree, --explore, --dry-run)
 ├── saves           List cloud-saved terminal snapshots
 ├── shell           Open interactive PTY (local, remote device, or guest code)
 ├── run             Execute command remotely or save output to vault
 ├── serve           Make device reachable (--daemon, --share for guest mode)
 ├── devices         List, authorize, or revoke enrolled machines
 ├── cloud
 │    ├── upload     Upload file or secret text snippet
 │    ├── files      List vault files
 │    ├── stream     Direct streaming link or launch in VLC
 │    ├── bulk       Recursively upload directory
 │    └── delete     Purge file permanently
 ├── pipe            Upload stdin or command output directly to cloud
 ├── send            End-to-end encrypted P2P transfer to user public key
 ├── inbox           Receive and decrypt incoming P2P files
 ├── id              View or export P2P identity key and manage contacts
 ├── env
 │    ├── list       List env stores or keys
 │    ├── set        Add or update key-value secret
 │    ├── get        Retrieve secret (--raw for scripting)
 │    ├── import     Import .env file into encrypted store
 │    ├── export     Export encrypted store to .env
 │    ├── push       Push encrypted store to cloud vault
 │    └── pull       Pull and restore env store on new machine
 ├── agent
 │    ├── create     Generate agent profile (Client ID + Secret + Scopes)
 │    ├── list       List agent profiles
 │    └── revoke     Revoke agent access
 ├── mcp
 │    ├── serve      High-reliability MCP worker with undo checkpoints
 │    ├── share      Generate configuration snippet for Claude & Cursor
 │    ├── guard      Interactive terminal approval console
 │    └── status     One-glance MCP gateway status
 ├── check           Verify package source integrity (--seal to update)
 └── log             Operational audit log (--stats for graphic summary)
```

---

## 🛡️ Security & Privacy Architecture

Akash CLI enforces security at every layer:
1. **Zero-Knowledge P2P Transfers**: Files are encrypted with X25519 and AES-256-GCM before leaving your device.
2. **Machine-Bound Secrets**: Local tokens, `.env` stores, and keys are tied to a unique `~/.akash/machine.key` that cannot be copied to other systems.
3. **Automated Secret Sanitization**: Sensitive variables, connection strings, and tokens in shell history files are scrubbed prior to archiving.
4. **Source Tamper Detection**: `akash check` computes cryptographic HMAC digests over package files to block malicious code modifications.

---

## 📄 License

Distributed under the MIT License. See [LICENSE](LICENSE) for details.
