@openape/apes 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # @openape/apes
2
+
3
+ The unified OpenApe CLI for interacting with a DDISA Identity Provider — handles authentication, grants, delegations, adapter-based command authorization, and MCP server integration.
4
+
5
+ Ships three binaries:
6
+ - **`apes`** — main CLI (login, grants, run, admin, etc.)
7
+ - **`ape-shell`** — grant-secured shell wrapper (drop-in replacement for `bash -c`)
8
+ - MCP server mode via `apes mcp`
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ pnpm add -g @openape/apes
14
+ # or: npm install -g @openape/apes
15
+ ```
16
+
17
+ After installation you have `apes` and `ape-shell` in your PATH.
18
+
19
+ ## Quick Start
20
+
21
+ ```bash
22
+ # 1. Login to an IdP (opens browser for PKCE flow)
23
+ apes login --idp https://id.example.com
24
+
25
+ # 2. Check who you are
26
+ apes whoami
27
+
28
+ # 3. Request a grant and run a command
29
+ apes run -- git status
30
+ # → creates a grant, waits for approval, executes
31
+
32
+ # 4. List your grants
33
+ apes grants list
34
+ ```
35
+
36
+ ## ape-shell: Grant-Secured Shell Wrapper
37
+
38
+ `ape-shell` is a drop-in shell replacement that routes every command through a DDISA grant. Useful for sandboxing AI coding agents (OpenClaw, Claude Code, etc.) so they can only execute pre-approved commands.
39
+
40
+ ### How it works
41
+
42
+ ```
43
+ $SHELL -c "git status"
44
+
45
+ ape-shell -c "git status"
46
+
47
+ apes run --shell -- bash -c "git status"
48
+
49
+ 1. Find existing ape-shell session grant (timed/always)
50
+ 2. Grant found → execute immediately
51
+ 3. No grant → request + wait for human approval → execute
52
+ ```
53
+
54
+ ### Setup for an AI agent session
55
+
56
+ ```bash
57
+ # Point the agent's SHELL at ape-shell
58
+ SHELL=$(which ape-shell) openclaw
59
+ ```
60
+
61
+ The first command requests a session grant. After the human approves it (with `grant_type: timed, duration: 8h`), all subsequent commands reuse the same grant without interaction.
62
+
63
+ ### Example
64
+
65
+ ```bash
66
+ $ apes login
67
+ $ ape-shell -c "git status"
68
+ ℹ Requesting ape-shell session grant on my-host
69
+ ℹ Grant requested: grant_abc123
70
+ ℹ Waiting for approval...
71
+ # Human approves in browser → command executes
72
+ On branch main
73
+
74
+ $ ape-shell -c "git log --oneline -5"
75
+ # Grant is reused automatically — no approval prompt
76
+ abc123 Latest commit
77
+ def456 Previous commit
78
+ ...
79
+ ```
80
+
81
+ ## Commands
82
+
83
+ ### Authentication
84
+
85
+ | Command | Description |
86
+ |---|---|
87
+ | `apes login` | PKCE browser login or ed25519 key-based agent login |
88
+ | `apes logout` | Clear stored auth |
89
+ | `apes whoami` | Show current identity |
90
+ | `apes enroll` | Enroll an agent at the IdP |
91
+ | `apes register-user` | Register a new human user |
92
+
93
+ ### Grants
94
+
95
+ | Command | Description |
96
+ |---|---|
97
+ | `apes grants list` | List all grants |
98
+ | `apes grants inbox` | Show pending approval requests |
99
+ | `apes grants request` | Request a new grant |
100
+ | `apes grants approve <id>` | Approve a grant |
101
+ | `apes grants deny <id>` | Deny a grant |
102
+ | `apes grants revoke <id>` | Revoke an active grant |
103
+ | `apes grants token <id>` | Get the JWT for an approved grant |
104
+ | `apes grants delegate` | Create a delegation grant |
105
+
106
+ ### Execution
107
+
108
+ | Command | Description |
109
+ |---|---|
110
+ | `apes run -- <cmd>` | Run a command via a shapes adapter grant |
111
+ | `apes run --shell -- bash -c <cmd>` | Shell mode (used by `ape-shell`) |
112
+ | `apes run --as root -- <cmd>` | Elevate via `escapes` (separate binary) |
113
+ | `apes explain -- <cmd>` | Explain what grant a command would need |
114
+
115
+ ### Configuration
116
+
117
+ Auth and config are stored in `~/.config/apes/`:
118
+ - `auth.json` — access token, email, IdP URL
119
+ - `config.toml` — defaults (idp, agent key path, etc.)
120
+
121
+ ```bash
122
+ apes config get defaults.idp
123
+ apes config set defaults.idp https://id.example.com
124
+ ```
125
+
126
+ ## MCP Server
127
+
128
+ ```bash
129
+ apes mcp --transport stdio
130
+ # or
131
+ apes mcp --transport sse --port 3001
132
+ ```
133
+
134
+ Exposes all grant operations as MCP tools so AI agents (Claude Desktop, Cursor, etc.) can request and use grants directly.
135
+
136
+ ## See Also
137
+
138
+ - [DDISA Protocol](https://github.com/openape-ai/protocol) — the underlying identity and authorization protocol
139
+ - [OpenApe Docs](https://docs.openape.at) — full platform documentation
140
+ - [`escapes`](https://github.com/openape-ai/escapes) — Rust binary for privilege escalation (`apes run --as root`)
141
+
142
+ ## License
143
+
144
+ MIT © Patrick Hofmann — [Delta Mind GmbH](https://delta-mind.at)