observal-cli 0.2.0__py3-none-any.whl

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.
Files changed (44) hide show
  1. observal_cli/README.md +150 -0
  2. observal_cli/__init__.py +0 -0
  3. observal_cli/analyzer.py +565 -0
  4. observal_cli/branding.py +19 -0
  5. observal_cli/client.py +264 -0
  6. observal_cli/cmd_agent.py +783 -0
  7. observal_cli/cmd_auth.py +823 -0
  8. observal_cli/cmd_doctor.py +674 -0
  9. observal_cli/cmd_hook.py +246 -0
  10. observal_cli/cmd_mcp.py +1044 -0
  11. observal_cli/cmd_migrate.py +764 -0
  12. observal_cli/cmd_ops.py +1250 -0
  13. observal_cli/cmd_profile.py +308 -0
  14. observal_cli/cmd_prompt.py +200 -0
  15. observal_cli/cmd_pull.py +324 -0
  16. observal_cli/cmd_sandbox.py +178 -0
  17. observal_cli/cmd_scan.py +1056 -0
  18. observal_cli/cmd_skill.py +202 -0
  19. observal_cli/cmd_uninstall.py +340 -0
  20. observal_cli/config.py +160 -0
  21. observal_cli/constants.py +151 -0
  22. observal_cli/hooks/__init__.py +0 -0
  23. observal_cli/hooks/buffer_event.py +97 -0
  24. observal_cli/hooks/flush_buffer.py +141 -0
  25. observal_cli/hooks/kiro_hook.py +210 -0
  26. observal_cli/hooks/kiro_stop_hook.py +220 -0
  27. observal_cli/hooks/observal-hook.sh +31 -0
  28. observal_cli/hooks/observal-stop-hook.sh +134 -0
  29. observal_cli/hooks/payload_crypto.py +78 -0
  30. observal_cli/hooks_spec.py +154 -0
  31. observal_cli/main.py +105 -0
  32. observal_cli/prompts.py +92 -0
  33. observal_cli/proxy.py +205 -0
  34. observal_cli/render.py +139 -0
  35. observal_cli/requirements.txt +3 -0
  36. observal_cli/sandbox_runner.py +217 -0
  37. observal_cli/settings_reconciler.py +188 -0
  38. observal_cli/shim.py +459 -0
  39. observal_cli/telemetry_buffer.py +163 -0
  40. observal_cli-0.2.0.dist-info/METADATA +528 -0
  41. observal_cli-0.2.0.dist-info/RECORD +44 -0
  42. observal_cli-0.2.0.dist-info/WHEEL +4 -0
  43. observal_cli-0.2.0.dist-info/entry_points.txt +5 -0
  44. observal_cli-0.2.0.dist-info/licenses/LICENSE +108 -0
observal_cli/README.md ADDED
@@ -0,0 +1,150 @@
1
+ # Observal CLI
2
+
3
+ Command-line interface for the Observal platform. Authenticate with a server, manage registry components, configure IDEs, and collect telemetry.
4
+
5
+ ## Install
6
+
7
+ The CLI is packaged as a Python project. From the repo root:
8
+
9
+ ```bash
10
+ uv pip install -e .
11
+ ```
12
+
13
+ This installs four entry points:
14
+
15
+ | Command | Purpose |
16
+ |---------|---------|
17
+ | `observal` | Main CLI |
18
+ | `observal-shim` | Telemetry wrapper that sits in front of MCP servers |
19
+ | `observal-proxy` | HTTP proxy for MCP servers |
20
+ | `observal-sandbox-run` | Sandbox execution runner |
21
+
22
+ ## Quick Start
23
+
24
+ ```bash
25
+ observal auth login # connect to your Observal server
26
+ observal scan # discover and register IDE components
27
+ observal pull my-agent --ide cursor # fetch agent config for Cursor
28
+ observal doctor # check IDE compatibility
29
+ ```
30
+
31
+ ## Commands
32
+
33
+ ### Authentication
34
+
35
+ ```
36
+ observal auth login # connect to server (initializes admin on first run)
37
+ observal auth register # create a new account
38
+ observal auth logout # clear saved credentials
39
+ observal auth whoami # show current user
40
+ observal auth status # check connectivity and buffer status
41
+ ```
42
+
43
+ ### Agent Workflow
44
+
45
+ ```
46
+ observal agent init # scaffold observal-agent.yaml
47
+ observal agent add mcp <id> # add a component to the agent definition
48
+ observal agent build # validate the definition
49
+ observal agent publish # push to the server
50
+ observal agent list # list active agents
51
+ observal agent show <id> # show agent details
52
+ observal agent install <id> --ide <ide> # get IDE config snippet
53
+ ```
54
+
55
+ ### Component Registry
56
+
57
+ Each component type (mcp, skill, hook, prompt, sandbox) shares the same subcommand pattern:
58
+
59
+ ```
60
+ observal registry <type> submit # submit for review
61
+ observal registry <type> list # list approved items
62
+ observal registry <type> show <id> # show details
63
+ observal registry <type> install <id> --ide <ide> # get IDE config
64
+ observal registry <type> delete <id> # delete
65
+ ```
66
+
67
+ Hooks have an extra `sync` subcommand. Prompts have an extra `render` subcommand for variable substitution.
68
+
69
+ ### Operations
70
+
71
+ ```
72
+ observal ops review list # pending submissions
73
+ observal ops review approve <id> # approve
74
+ observal ops review reject <id> --reason "..." # reject
75
+ observal ops telemetry status # check telemetry flow
76
+ observal ops telemetry test # send a test event
77
+ observal ops sync # flush buffered events
78
+ observal ops overview # system-wide stats
79
+ observal ops metrics <id> # metrics for an MCP or agent
80
+ ```
81
+
82
+ ### Utilities
83
+
84
+ ```
85
+ observal pull <agent> --ide <ide> # write agent config to IDE files
86
+ observal scan [--shim] [--all-ides] # discover components, optionally wrap with shim
87
+ observal use <profile> # swap IDE config from a profile
88
+ observal doctor # diagnose IDE/Observal issues
89
+ observal doctor sli # reinstall telemetry hooks
90
+ observal config show # show current config
91
+ observal uninstall # tear down Docker, remove config
92
+ ```
93
+
94
+ ## Supported IDEs
95
+
96
+ | IDE / Tool | Support Level |
97
+ |------------|--------------|
98
+ | Claude Code | Fully supported |
99
+ | Kiro CLI | Supported (next most tested) |
100
+ | Cursor, VS Code, Gemini CLI | Untested |
101
+
102
+ The `--ide` flag controls which config format is generated. Each IDE has its own config paths and JSON structure.
103
+
104
+ ## Config Files
105
+
106
+ All CLI state lives in `~/.observal/`:
107
+
108
+ | File | Contents |
109
+ |------|----------|
110
+ | `config.json` | Server URL, tokens, user ID |
111
+ | `aliases.json` | User-defined name-to-UUID aliases |
112
+ | `last_results.json` | Cached list results for numeric shorthand |
113
+ | `telemetry_buffer.db` | SQLite buffer for offline event queuing |
114
+ | `keys/server_public.pem` | Server public key for payload encryption |
115
+
116
+ ## Telemetry
117
+
118
+ When `observal scan --shim` wraps an MCP server, tool calls flow through `observal-shim` which records usage events. If the server is unreachable, events are buffered locally in `telemetry_buffer.db` and flushed on the next `observal ops sync`.
119
+
120
+ Hook scripts in `observal_cli/hooks/` capture IDE-level events (prompts, tool use, subagent spawning) and forward them to the server.
121
+
122
+ ## Directory Layout
123
+
124
+ ```
125
+ observal_cli/
126
+ ├── main.py # Root app, command registration
127
+ ├── config.py # Config file I/O
128
+ ├── client.py # HTTP client with auth and token refresh
129
+ ├── constants.py # Valid IDEs, categories, component types
130
+ ├── render.py # Rich output formatting
131
+ ├── analyzer.py # Repo analysis for MCP submission
132
+ ├── settings_reconciler.py # Non-destructive Claude Code settings merge
133
+ ├── cmd_auth.py # Auth commands
134
+ ├── cmd_agent.py # Agent commands
135
+ ├── cmd_mcp.py # MCP commands
136
+ ├── cmd_skill.py # Skill commands
137
+ ├── cmd_hook.py # Hook commands
138
+ ├── cmd_prompt.py # Prompt commands
139
+ ├── cmd_sandbox.py # Sandbox commands
140
+ ├── cmd_pull.py # Pull command
141
+ ├── cmd_scan.py # Scan command
142
+ ├── cmd_doctor.py # Doctor command
143
+ ├── cmd_ops.py # Operations commands
144
+ ├── cmd_profile.py # Profile swapping
145
+ ├── cmd_uninstall.py # Uninstall command
146
+ ├── shim.py # observal-shim entrypoint
147
+ ├── proxy.py # observal-proxy entrypoint
148
+ ├── sandbox_runner.py # observal-sandbox-run entrypoint
149
+ └── hooks/ # Telemetry hook scripts
150
+ ```
File without changes